Skip to content

Passing an identifier string (not in a list) silently truncates it #1010

@ghyatzo

Description

@ghyatzo

Hello,

I've got bitten by this bug (not sure if it is fair to call it a bug, maybe more a footgun):

        assert len(identifier) > 0
        request["CoverageID"] = identifier[0]

The code above that checks for the coverage will silently truncate the coverage id if it is passed as a single string. i.e.

    response = wcs.getCoverage(
        identifier="some_id",
        format="image/tiff",
        subsets=[
            ("lat", bounds.south, bounds.north),
            ("lon", bounds.west, bounds.east)
        ],
        interpolation="nearest"
    )

If the desired api is using only lists, then It would make more sense to check for it directly and possibly error early explaining what happened.

Thanks for your work!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions