Skip to content

Bugfix clientcustomheaders pydanticvalidation #18613

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

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

rekumar
Copy link

@rekumar rekumar commented Jul 29, 2025

closes #18611

Change Overview

  1. Add a field_validator to Client.custom_headers client settings model to ensure that strings are parsed into dicts. This allows setting header dicts via the CLI tool and toml config files.
  2. Add a test to ensure the CLI tool mechanism successfully sets headers.

Checklist

  • This pull request references any related issue by including "closes <link to issue>"
  • If this pull request adds new functionality, it includes unit tests that cover the changes
  • If this pull request removes docs files, it includes redirect settings in mint.json.
  • If this pull request adds functions or classes, it includes helpful docstrings.

@github-actions github-actions bot added the bug Something isn't working label Jul 29, 2025
Copy link

codspeed-hq bot commented Jul 29, 2025

CodSpeed Performance Report

Merging #18613 will not alter performance

Comparing rekumar:bugfix-clientcustomheaders-pydanticvalidation (cfa696f) with main (7ff666a)

Summary

✅ 2 untouched benchmarks

@desertaxle
Copy link
Member

Thanks for the PR @rekumar! Since this is a relatively general before validator, I think it'd be worthwhile to add an annotated type in src/prefect/types/__init__.py so that it can be resued.

Copy link
Contributor

This pull request is stale because it has been open 14 days with no activity. To keep this pull request open remove stale label or comment.

…h handles fields that are sometimes dicts and sometimes string-serialized dict representations.
@rekumar
Copy link
Author

rekumar commented Aug 17, 2025

@desertaxle done. Feel free to change the annotation name haha.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Pydantic settings cannot parse PREFECT_CLIENT_CUSTOM_HEADERS
2 participants