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

Fixes for a few bugs I encountered while testing the command #351

Merged
merged 9 commits into from
Feb 19, 2024

Conversation

mberacochea
Copy link
Member

No description provided.

Add support for Assembly and Run based jobs (both).
Remove the public check, we only submit public data to the exchange.
Normalize argument names in the MGX wrapper.
Added some docstrings
The MGX API returns a json with the error message, which is useful
for debugging.
@mberacochea mberacochea marked this pull request as ready for review February 16, 2024 15:36
return analysis_registry_id, metadata_match

data = response.json()
datasets = data.get("datasets", [])

# The API will return an emtpy datasets array if it can find the accession
if not len(datasets):
logging.info(f"{source_id} does not exist in ME")
logging.info(f"{mgya} does not exist in ME")
return analysis_registry_id, metadata_match

sourceIDs = [item.get("sourceID") for item in datasets]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can it be:

try:
    found_record = next(item for item in datasets if item.get("sourceID") == mgya)
except StopIteration:
    ...

or similar?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, it could be. I think method needs some improvements and some more unit tests. I'll create a JIRA ticket improve it.

tests/me/test_metagenomics_exchange.py Show resolved Hide resolved
Copy link
Contributor

@KateSakharova KateSakharova left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@mberacochea mberacochea merged commit c98171c into develop Feb 19, 2024
4 checks passed
@mberacochea mberacochea deleted the bugfix/metagenomics-exchange-bug-fixes branch February 19, 2024 13:40
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.

3 participants