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

Fix: Get Reagent Info #56

Merged
merged 10 commits into from
Jan 9, 2025
Merged

Fix: Get Reagent Info #56

merged 10 commits into from
Jan 9, 2025

Conversation

mekhlakapoor
Copy link
Contributor

@mekhlakapoor mekhlakapoor commented Jan 7, 2025

closes #57

This PR:

  • removes deprecated fields from reagent content model
  • adds model for reagent details in reference data record table
  • given a reagent pk in wash -> reagent content -> reagent reference data record -> source
  • groups all related reagent information together

@mekhlakapoor mekhlakapoor marked this pull request as draft January 7, 2025 01:34
@mekhlakapoor mekhlakapoor changed the title replace reagent alias with active alias Fix: Get Reagent Info Jan 7, 2025
@mekhlakapoor mekhlakapoor marked this pull request as ready for review January 8, 2025 06:05
class SlimsReagentDetailsRdrc(SlimsBaseModel):
"""Model for a Reagent Catalog Reference Data Record"""

pk: Optional[int] = Field(
Copy link
Collaborator

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?

Copy link
Contributor Author

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

Copy link
Contributor

@jtyoung84 jtyoung84 Jan 8, 2025

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?

Copy link
Contributor Author

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.

Copy link
Collaborator

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.

Copy link
Contributor Author

@mekhlakapoor mekhlakapoor Jan 8, 2025

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

Copy link
Contributor

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?

@mekhlakapoor mekhlakapoor merged commit c6c0084 into main Jan 9, 2025
3 checks passed
@mekhlakapoor mekhlakapoor deleted the fix-reagent branch January 9, 2025 05:11
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.

Fix Reagent
3 participants