Handle invalid obsm keys with actionable error message (SCP-5496) #390
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Background
Previously when a user enters an incorrect obsm_key, AnnData ingest failed with a KeyError, resulting in “Unexpected exit status 1”. With the switch Batch API, the KeyError messaging is swallowed entirely, obscuring the cause of the failure for the study owner and makes troubleshooting take longer for an SCP admin.
Manual testing
python ingest_pipeline.py --study-id 5d276a50421aa9117c982845 --study-file-id 5dd5ae25421aa910a723a337 ingest_anndata --extract "['cluster']" --ingest-anndata --anndata-file ../tests/data/anndata/anndata_test.h5ad --obsm-keys "['foo']"
[optional]
gcr.io/broad-singlecellportal-staging/scp-ingest-jlc_report_obsm_error:d20f5b8