-
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): Fix None
ambiguity in labware offset filtering
#17218
fix(robot-server): Fix None
ambiguity in labware offset filtering
#17218
Conversation
None
ambiguity in labware offset filtering
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.
Interesting. Looks like a good way to solve the problem. I guess we can't use normal pydantic queries about whether the field was set because they're fastapi url params?
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.
Love it! Thank you!
Yeah exactly.
|
|
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.
Looks great! Thank you!
Overview
This fixes an unreleased bug in the
/labwareOffsets
API.This API lets you filter on a bunch of independent fields. Internally, we were representing the default condition, where there is no filter on a field, as
None
. But that's ambiguous for thelocation.moduleModel
andlocation.definitionUri
fields, whereNone
corresponds to JSONnull
, which is a possible legitimate value that you might want to filter for.So:
None
, to represent the default "do not filter" condition.?someField=null
to filter for JSON"someField": null
?someField="foo"
to filter for JSON"someField": "foo"
?someField="null"
to filter for JSON"someField": "null"
someField
query param to not filter onsomeField
at allTest Plan and Hands on Testing
Review requests
Is this a good way to implement this?
If you provide a completely invalid value, like this:
GET /labwareOffsets?locationModuleModel=123
Then the internal sentinel leaks out and causes a confusing error message:
Which is unfortunate, but I couldn't find a way to fix it.
Risk assessment
Low. This code is currently unused.