Conversation
eppo_client/models.py
Outdated
| class BanditData(SdkBaseModel): | ||
| bandit_key: str | ||
| model_name: str | ||
| bandit_model_name: str |
There was a problem hiding this comment.
You will need to provide an alias for these fields so that Pydantic knows what property names to use when deserializing from JSON (example payload)
There was a problem hiding this comment.
| subject["subjectKey"], | ||
| ContextAttributes( | ||
| numeric_attributes=subject["subjectAttributes"]["numeric_attributes"], | ||
| numeric_attributes=subject["subjectAttributes"]["numericAttributes"], |
giorgiomartini0
left a comment
There was a problem hiding this comment.
Code change looks good. Need to understand the test failure before merging - are some of the attributes not being processed correctly, leading to a different bandit assignment? Or did the upstream test data change?
Python did not get updated with empty-action-list behaviour. The fix for that is not super straightforward. This PR should be OK to merge with the fix for FF-2573 coming after. |
typotter
left a comment
There was a problem hiding this comment.
Thanks for jumping on this!
| class BanditData(SdkBaseModel): | ||
| bandit_key: str | ||
| model_name: str | ||
| bandit_model_name: str = Field(alias="modelName") |
Fixes: #FF-2537
Motivation and Context
Fields prefixed with
model_are throwing Pydantic warnings like:Description
Renamed
model_fields tobandit_modelHow has this been tested?
Reproducing errors locally, renaming model fields and seeing it without those validation warnings.