Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid KeyError if a product metadata doesn't have a namespace #151

Merged
merged 1 commit into from
Jun 3, 2024

Conversation

jteulade
Copy link
Contributor

@jteulade jteulade commented Jun 3, 2024

For this product: s3://sertit-rms2/archives/rms/2013/R0009_CHARTE452_Senegal_Inondations_2013/images_crise/Dakar/RISAT-1/133330111.zip
We have this error

Traceback (most recent call last):
  File "E:\JTeulade\repositories\stac\scripts\test.py", line 24, in <module>
    func()
  File "E:\JTeulade\repositories\stac\libs\sertit-utils\sertit\s3.py", line 99, in s3_env_wrapper
    return function(*_args, **_kwargs)
  File "E:\JTeulade\repositories\stac\scripts\test.py", line 16, in func
    prod: Product = Reader().open(tata, remove_tmp=True, method=CheckMethod.MTD)
  File "e:\jteulade\repositories\eoreader\eoreader\reader.py", line 528, in open
    prod = self._open_path(
  File "e:\jteulade\repositories\eoreader\eoreader\reader.py", line 690, in _open_path
    prod = create_product(
  File "e:\jteulade\repositories\eoreader\eoreader\reader.py", line 957, in create_product
    prod = class_(
  File "e:\jteulade\repositories\eoreader\eoreader\products\sar\sar_product.py", line 200, in __init__
    super().__init__(product_path, archive_path, output_path, remove_tmp, **kwargs)
  File "e:\jteulade\repositories\eoreader\eoreader\products\product.py", line 241, in __init__
    self._pre_init(**kwargs)
  File "e:\jteulade\repositories\eoreader\eoreader\products\sar\rs2_product.py", line 382, in _pre_init
    namespace = nsmap[None]
KeyError: None

We reuse code from iceye product here

@jteulade jteulade merged commit 920b8d6 into main Jun 3, 2024
2 checks passed
@jteulade jteulade deleted the avoid_KeyError_rcm_rs2_product branch June 3, 2024 13:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant