EBI-Metagenomics / emg-toolkit

MGnify API toolkit
https://www.ebi.ac.uk/metagenomics
Apache License 2.0
21 stars 4 forks source link

Bug fix - empty tags are breaking original metadata #32

Closed mberacochea closed 8 months ago

mberacochea commented 8 months ago

Example of query that doesn't work ATM:

$ mg-toolkit original_metadata -a ERP012177
File "/rds/project/rds-aFEMMKDjWlo/software/mambaforge-pypy3/envs/ena-metadata/lib/python3.9/site-packages/mg_toolkit/metadata.py", line 151, in fetch_metadata
    _meta = self.get_metadata(sample["sample_accession"])
  File "/rds/project/rds-aFEMMKDjWlo/software/mambaforge-pypy3/envs/ena-metadata/lib/python3.9/site-packages/mg_toolkit/metadata.py", line 83, in get_metadata
    key_value = value.text.strip()
AttributeError: 'NoneType' object has no attribute 'strip'