Skip to content
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

coerce work pool env values to str #13782

Merged
merged 6 commits into from
Jun 4, 2024
Merged

coerce work pool env values to str #13782

merged 6 commits into from
Jun 4, 2024

Conversation

zzstoatzz
Copy link
Contributor

when a value like {"bar": 42} (valid JSON) is set on a workpool's env, the changes in pydantic 2 made it so that BaseJobConfiguration (which has env: Dict[str, str | None]) was failing on 42 with validation errors

all env values should be strings, so this PR adds a model_validator to coerce any non None values that are not strings when we construct a job config object

@zzstoatzz zzstoatzz added the fix A fix for a bug in an existing feature label Jun 4, 2024
@zzstoatzz zzstoatzz self-assigned this Jun 4, 2024
@zzstoatzz zzstoatzz requested review from zangell44 and a team as code owners June 4, 2024 18:08
@zzstoatzz zzstoatzz requested a review from desertaxle June 4, 2024 19:17
Copy link
Member

@desertaxle desertaxle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@zzstoatzz zzstoatzz merged commit fda5fb2 into main Jun 4, 2024
27 checks passed
@zzstoatzz zzstoatzz deleted the investigate-job-vars branch June 4, 2024 19:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix A fix for a bug in an existing feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants