Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support inject for default plan arguments again
When preparing the parameters for a plan, pydantic creates an instance of the dynamically generated BaseModel, relying on the 'Reference' types to convert from strings to instances of the devices. This includes strings that are used as default field values (default parameters created using the `inject` method). We then convert the model back to a dictionary to pass as kwargs to the plan. The previously used `model_fields_set` field on the model only iterates over the fields set via the input JSON (the user supplied arguments) and skips the fields populated via the default factories in the base model. Using the `__pydantic_fields__` class variable, allows all fields to be used including the defaults. This was previously avoided as it generated warnings for unknown types but it is possible to opt-out of these warnings.
- Loading branch information