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

Implement migrator that removes obsolete slots from MassSpectrometry documents #182

Conversation

eecavanna
Copy link

@eecavanna eecavanna commented Jun 3, 2024

In this branch, I implemented a new migrator.

This migrator processes every document in the data_generation_set collection. For each document, the migrator checks whether it is of type nmdc:MassSpectrometry. If it isn't, the migrator skips processing this document. Otherwise, the migrator proceeds as follows.

The migrator checks whether the document has any of the fields that are in a list of obsolete fields. If the document has any of those fields, the migrator checks whether the field is empty or not. If it is empty, the migrator deletes the field (using "emptiness" criteria specific to the kind of field). On the other hand, if it is not empty, the migrator raises an exception.

I designed this migrator to run after all 14 other migrators that currently exist.

Fixes microbiomedata#2027

@turbomam turbomam merged commit 45d965f into main Jun 4, 2024
2 checks passed
@turbomam turbomam deleted the 2027-berkeley-schema-fy24-implement-migrator-that-removes-specific-slots branch June 4, 2024 19:31
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.

berkeley-schema-fy24: Implement migrator that removes slots from nmdc:MassSpectrometry documents
4 participants