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

Develop fix submit keyerror #831

Merged
merged 9 commits into from
Jul 20, 2022
Merged

Conversation

mialy-defelice
Copy link
Collaborator

The purpose of this PR is to address an issue from HTAN.

The error surfaced in the function format_row_annotations. The purpose was to format annotations to display on synapse. If there was a list of values, we need to split them up so they display properly. So its looking to split the entry if the validation rule is a list. The problem surfaced because the way the validation rules was being accessed was through a SchemaExplorer (SE) object that was instantiated using defaults, so it was only loading the default Biothings Schema.

Biothings does not contain ProtocolLink hence the KeyError.

To get around this, I found it was easier to just move through the SchemaGenerator (SG) instead. There is an analogous function to pull out the validation rules. I just instantiated the SG within the metadata.py init, and passed it to downstream functions as needed.

Tested effected functions.

@mialy-defelice mialy-defelice merged commit 4c2d975 into develop Jul 20, 2022
@mialy-defelice mialy-defelice deleted the develop-fix-submit-keyerror branch July 20, 2022 22:26
@linglp linglp mentioned this pull request Aug 24, 2022
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.

2 participants