-
Notifications
You must be signed in to change notification settings - Fork 179
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(robot-server): add default to robot serial #13802
Merged
Merged
Conversation
This file contains 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
Some combination of pydantic and fastapi (fastapi, I'm pretty sure, due to things like pydantic/pydantic#1223 ) conflate "null" and "not present" in weird ways. This means that in the health response pydantic class, - If you create robot_serial in the proper way to have a pydantic field that can be either a string or null but must always be passed in to the constructor - annotation Optional[str] and do not provide a default - then pydantic will say there's a field missing if you explicitly pass in null (the bug this fixes, since this 500s the route) - If you create robot_serial with a default value, which is _not correct_ because there is no default, then something (probably fastapi) will remove the _key_ from the model rather than issueing it with a null, which is terrible, but is better than the other way I guess. Updating fastapi might help with this maybe. I don't know.
shlokamin
reviewed
Oct 17, 2023
..., | ||
description="The robot serial number. Should be used if not none; if none, use result of /server/update/health.", | ||
default=None, | ||
description="The robot serial number. Should be used if not present; if not present, use result of /server/update/health.", |
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.
this should be Should be used if present
right?
shlokamin
approved these changes
Oct 17, 2023
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.
tested on flexy which has a serial number on the eeprom
y3rsh
added a commit
that referenced
this pull request
Oct 25, 2023
* edge: (77 commits) fix(app): update move gantry text in change pipette flow (#13712) fix(app): fix CI after release merge back (#13816) chore(hardware): add opentrons hardware package to ot 2 build (#13770) feat(protocol-designer): correct step count in create file wizard (#13807) feat(protocol-designer): error handling in create file wizard (#13804) fix(app): invalidate OT2 calibration queries when calibration flows complete (#13809) always jog (#13806) chore(app): point updates at dns not s3 (#13798) docs(api): updated Flex default flow rates (#13796) fix(api): Flag pipette as not ready to aspirate after pushing out air (#13728) fix(api, hardware): allow OT3Controller to disable tip motors (#13805) more blank trials; longer scale stabilize wait; submerge 2.5mm (#13788) fix(app): unload adapters after checking position of labware on adapter on heater shaker module (#13803) feat(app): wire up location conflict modal for ODD (#13797) feat(app): add Deck configuration page component (#13784) fix(robot-server): add default to robot serial (#13802) feat(protocol-designer, components): prep work for deck config in PD (#13775) feat(app, protocol-designer): plug in waste chute asset (#13800) fix(app): do not check mag block in calibration status (#13799) feat(protocol-designer): edit additional items staging area support (#13752) ...
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.
Some combination of pydantic and fastapi (fastapi, I'm pretty sure, due to things like pydantic/pydantic#1223 ) conflate "null" and "not present" in weird ways. This means that in the health response pydantic class,
Updating fastapi might help with this maybe. I don't know.
This changes the semantics of this field to "present and not-null or not present" rather than "always present and maybe null"; luckily, the app side of this will be fine without changes because it was written to handle older health responses that wouldn't have the field.
testing
/var/serial
and check thatGET /health
still works and now does not have a robot_serial fieldwhere "works" means "doesn't 500"