-
Notifications
You must be signed in to change notification settings - Fork 0
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
Filter by Statuses #28
Conversation
…s filtering since python 3.12
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks Sandy.
This seems like it's going to enhance code reusability. Happy to approve. But I have the following thoughts for future considerations:
I was wondering why we need to check for possible null values for the status fields.
Would be possible for us to enforce a rule that status fields in our DB should not be nullable by design ? or perhaps we could even try to make them more uniform. That way we would have less conditions to check in this Mixin Manager. Or is it that perhaps the structure of the fields is not always in our control.
Thanks @MGS-sails ! |
…lter added pre-qc-failed status filter
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rewrote my PR based on that. Thank you!
This PR:
status
fields.status
field likeanalysis.status == {"analysis_started": True, "analysis_failed": False}
.study.analyses.filter_by_statuses([analysis.AnalysisStates.ANALYSIS_STARTED, "some_custom_key"]).exclude_by_statuses([analysis.AnalysisStates.ANALYSIED_BLOCKED])
.value
– this seems to be a change when moving to Python 3.12.TODO in future:
status
field definitions to the same base model file as this manager, including helpers like themark_status_as
methods, and perhaps a utility for handling default state setting.Assembly
too.