if not isinstance(bands_requested, (Sequence, ListConfig)):
raise ValueError(
f"Requested bands should be a list."
f"\nGot {bands_requested} of type {type(bands_requested)}"
)
The message suggest a list is requested but it only checks for sequence or Listconfig.
Then, it is treated as a sequence nonetheless:
if bands_requested:
raster_bands_request = [int(b) for b in bands_requested.split(",")]
Suggested behavior
The parameter should be a list. There should not be any split of sequence, just treating the list as is.
The bands_requested parameter should be accepting list, currently supports only sequence of strings, which is not intuitive nor practical.
Current behavior
The parameter verification is wrong:
The message suggest a list is requested but it only checks for sequence or Listconfig.
Then, it is treated as a sequence nonetheless:
Suggested behavior
The parameter should be a list. There should not be any split of sequence, just treating the list as is.