-
Notifications
You must be signed in to change notification settings - Fork 7
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
blueapi cannot generate a JsonSchema for bluesky.protocols.Movable
after update to 1.13.1
#843
Comments
bluesky.protocols.Movable
after update to 0.13.1bluesky.protocols.Movable
after update to 1.13.1
how did this get through regression testing? the acceptance criteria need to have a point to add a test to prevent this from arising in the future. Alternatively a new issue could be made |
This didn't get through regression tests. The CI is currently failing when bluesky is not pinned to <=1.13.0. |
What I've got going over at #844 is working to deserialise plans and devices, but looking at how to handle generics in jsonschema compatible ways, I'd like to take a bit more time to get it potentially interoperable with future things, potentially after getting the first approach merged if the need for dodal and bluesky 1.13.1 is urgent and rolling back bluesky to 1.13.0 isn't an option It's going to take some munging to handle generics and make non-generics look similar to generics: ...
{
"name": "set_relative",
"description": "words",
"schema": {
"additionalProperties": false,
"properties": {
"movable": {
"title": "Movable",
"type": "bluesky.protocols.Movable['dodal.plan_stubs.wrapped.T']"
},
"value": {
"title": "Value"
}
},
"required": [
"movable",
"value"
],
"title": "set_relative",
"type": "object"
}
} changes to something closer to (still fiddling with the exact expected form) {"$defs": { "moveable-axis": { "$Anchor": "T" } },
...
{
"name": "set_relative",
"description": "words",
"schema": {
"additionalProperties": false,
"properties": {
"movable": {
"title": "Movable",
"type": "bluesky.protocols.Movable",
"properties": {"axis": "$moveable-axis"}
},
"value": {
"title": "Value",
"type": "$moveable-axis"
}
},
"required": [
"movable",
"value"
],
"title": "set_relative",
"type": "object"
}
} :: ...
{
"name": "concrete_set",
"description": "words",
"schema": {
"additionalProperties": false,
"properties": {
"movable": {
"title": "Movable",
"type": "bluesky.protocols.Movable",
"properties": {"axis": {"type": "float"}}
},
"value": {
"title": "Value",
"type": "float"
}
},
"required": [
"movable",
"value"
],
"title": "set_relative",
"type": "object"
}
} |
I have rolled everything back. Happy to stay on 1.13.0 until this is sorted |
@DiamondJoseph isn't on the UI end the |
It is passed as a string, but the plan parameters are correct in the generated schema, and when we allow querying for devices of type |
Describe the Bug
After updating
bluesky
to version 1.13.1,blueapi
fails to generate a JSON schema forbluesky.protocols.Movable
, raising the following error:This issue affects plans in
dodal
, specifically in[wrapped.py](https://github.com/DiamondLightSource/dodal/blob/main/src/dodal/plan_stubs/wrapped.py)
.Expected Behavior
blueapi
should correctly generate a JSON schema forbluesky.protocols.Movable
without errors.Actual Behavior
blueapi
fails withPydanticInvalidForJsonSchema
, preventing JSON schema generation and causing issues in plans.Steps To Reproduce
bluesky
to version 1.13.1.blueapi
to generate a JSON schema involvingbluesky.protocols.Movable
.PydanticInvalidForJsonSchema
error.Acceptance Criteria
blueapi
successfully generates a JSON schema forbluesky.protocols.Movable
without errors.dodal
function as expected without schema-related failures.The text was updated successfully, but these errors were encountered: