-
Notifications
You must be signed in to change notification settings - Fork 1
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
Fix: Get Reagent Info #56
Conversation
class SlimsReagentDetailsRdrc(SlimsBaseModel): | ||
"""Model for a Reagent Catalog Reference Data Record""" | ||
|
||
pk: Optional[int] = Field( |
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.
Are all these fields really Optional?
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.
I'd rather leave them all as optional for now since in the dev instance there's no clear pattern of what is optional/required and at this point validation errors on these models shouldn't stop the fetch operations
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.
I think primary keys are always in the responses. Have you found any records that had a null pk field?
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.
No, but if a user wants to use the API to enter info into SLIMS then they shouldn't assign the pk. It currently isn't a use case though. There are mult models across the repo that have Optional pks so we can update all of them.
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.
Okay. I forgot that we were de facto using pk as an indicator of if the record was from slims or to be added. Don't love how that's structured, I would prefer if we had clearer indications of which fields are optional in different situations, both in our models and in general from the SLIMS side, as it's hard to tell. I suppose that's a use for the higher-level "operations" methods where they can have clearer required arguments.
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.
I'm hoping to develop a SQL plugin to fetch data from SLIMS. If this is possible after the trainings, we won't need to rely on the python api models and operations for fetches which'll clarify these distinctions.
For now, this model (as long as some of the others I've written) are only expected to be used by the operations to fetch data. Once we've figured out the SQL plugin we can remove the pk fields all together
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.
Is this conversation resolved for now?
closes #57
This PR: