You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Have an error if a device composite is not found in the blueapi context #1526
When injecting a device composite instead of a single device, if the composite has not been added to the module and not discoverable by blueapi, the only error that will show up on the blueapi logs is a PydanticInvalidForJsonSchema pointing to the first device in the composite, eg
raise self._value
pydantic.errors.PydanticInvalidForJsonSchema: Cannot generate a JsonSchema for core_schema.IsInstanceSchema (<class 'dodal.devices.beamlines.i19.diffractometer.FourCircleDiffractometer'>)
This is a bit confusing because it doesn't really give any information about where the error might be - in particular when the device otherwise connects and is used in other plans.
Related to #1525 . Run into this while testing on I19 and couldn't figure out what was missing until I took a look at the planFunctions module used in hyperion.
I'm not sure how this can be related to not having the composite type imported. Without the import blueapi will fail to import the module with eg NameError: name 'DemoComposite' is not defined.
One way I could see this error being raised is if the composite doesn't have allow_arbitrary_types=True in its config. At that point, any field that wasn't serialisable (most devices) would cause a "Cannot create JsonSchema` error.
Do you have an example of the plan module that was causing the problem?
Activity
tpoliaw commentedon May 5, 2026
I'm not sure how this can be related to not having the composite type imported. Without the import blueapi will fail to import the module with eg
NameError: name 'DemoComposite' is not defined.One way I could see this error being raised is if the composite doesn't have
allow_arbitrary_types=Truein its config. At that point, any field that wasn't serialisable (most devices) would cause a "Cannot create JsonSchema` error.Do you have an example of the plan module that was causing the problem?