Use model_validator mode=before for MappableConcept#620
Open
knQzx wants to merge 2 commits intoga4gh:mainfrom
Open
Use model_validator mode=before for MappableConcept#620knQzx wants to merge 2 commits intoga4gh:mainfrom
knQzx wants to merge 2 commits intoga4gh:mainfrom
Conversation
mode=after constructs the full object before validating, which is wasteful when we just need to check if name or primaryCoding exists. switched to mode=before so it checks the raw dict directly. also removes the unused Self import. Fixes ga4gh#618
jsstevenson
requested changes
Mar 25, 2026
Contributor
jsstevenson
left a comment
There was a problem hiding this comment.
see linter results -- feel free to # noqa the ANN401 violations but the "single if statement" fix should be done
Author
fixed, merged the nested ifs and added noqa for ANN401 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
split out from #619
switches
require_name_or_primary_codingfrommode="after"tomode="before", so no need to construct the full object just to check if name or primaryCoding is set, also drops theSelfimport since it's no longer usedfixes #618
I emailed you about GSoC 2026 (knqzx0@gmail.com)