Skip to content

Conversation

DouweM
Copy link
Contributor

@DouweM DouweM commented Apr 16, 2025

Change Summary

Companion to pydantic/pydantic-core#1692 to stop using deprecated field_name argument on validation function schemas.

Fixes #11737.

Related issue number

Checklist

  • The pull request title is a good summary of the changes - it will be used in the changelog
  • Unit tests for the changes exist
  • Tests pass on CI
  • Documentation reflects the changes where applicable
  • My PR is ready to review, please add a comment including the phrase "please review" to assign reviewers

Copy link
Contributor

hyperlint-ai bot commented Apr 16, 2025

PR Change Summary

Removed the deprecated field_name argument from the validation function schemas to enhance compatibility with the latest pydantic-core updates.

  • Eliminated the use of the deprecated field_name argument in validation functions.
  • Updated the validation function schemas to align with the latest pydantic-core changes.
  • Pinned pydantic-core to a specific branch until the new version is released.

Modified Files

  • docs/concepts/types.md

How can I customize these reviews?

Check out the Hyperlint AI Reviewer docs for more information on how to customize the review.

If you just want to ignore it on this PR, you can add the hyperlint-ignore label to the PR. Future changes won't trigger a Hyperlint review.

Note specifically for link checks, we only check the first 30 links in a file and we cache the results for several hours (for instance, if you just added a page, you might experience this). Our recommendation is to add hyperlint-ignore to the PR to ignore the link check for this PR.

Copy link

codspeed-hq bot commented Apr 16, 2025

CodSpeed Performance Report

Merging #11761 will not alter performance

Comparing DouweM:validator-function-field-name (b25047c) with main (07b33c3)

Summary

✅ 46 untouched benchmarks

Copy link
Contributor

github-actions bot commented Apr 16, 2025

Coverage report

Click to see where and how coverage changed

FileStatementsMissingCoverageCoverage
(new stmts)
Lines missing
  pydantic
  functional_validators.py
  version.py
  pydantic/_internal
  _generate_schema.py
Project Total  

This report was generated by python-coverage-comment-action

@DouweM DouweM force-pushed the validator-function-field-name branch from f880c7e to a8825c0 Compare April 17, 2025 17:35
@DouweM DouweM marked this pull request as ready for review April 17, 2025 17:37
@DouweM DouweM changed the title Stop using deprecated field_name argument on validation function schemas Bump pydantic-core to v2.34.0 Apr 17, 2025
@DouweM
Copy link
Contributor Author

DouweM commented Apr 17, 2025

@Viicos Pleas review!

@Viicos Viicos changed the title Bump pydantic-core to v2.34.0 Do not provide field_name in validator core schemas Apr 17, 2025
Copy link
Member

@Viicos Viicos left a comment

Choose a reason for hiding this comment

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

Let's add a test reproducing the original issue in #11737. I also released 2.34.1 yesterday so you can use it; it should fix the free threaded CI. Otherwise looks good!

@DouweM DouweM force-pushed the validator-function-field-name branch from a8825c0 to c6be7b8 Compare April 18, 2025 14:05
@DouweM
Copy link
Contributor Author

DouweM commented Apr 18, 2025

@Viicos Bumped to 2.34.1 and added the test!

@DouweM DouweM force-pushed the validator-function-field-name branch from 4096dbb to 92109b3 Compare April 18, 2025 14:34
@DouweM DouweM force-pushed the validator-function-field-name branch from 92109b3 to b25047c Compare April 18, 2025 14:36
Copy link
Member

@Viicos Viicos left a comment

Choose a reason for hiding this comment

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

Nice, I'm glad this isn't stored on the schema anymore!

@Viicos Viicos merged commit bce81ef into pydantic:main Apr 18, 2025
63 checks passed
bmwiedemann pushed a commit to bmwiedemann/openSUSE that referenced this pull request Jun 24, 2025
https://build.opensuse.org/request/show/1287850
by user dgarcia + anag_factory
To stage with the python-pydantic-core 2.35.1 update in sr#1287849

- Add patch bump-pydantic-core-2.35.1.patch to support latest
  pydantic-core, gh#pydantic/pydantic#11963
- Add patch field-name-validator-core-schemas.patch to remove
  deprecation warning, gh#pydantic/pydantic#11761
- Update to 2.11.7
  * Copy FieldInfo instance if necessary during FieldInfo build by @Viicos in #11980
2.11.6
  * Rebuild dataclass fields before schema generation by @Viicos in #11949
  * Always store the original field assignment on FieldInfo by @Viicos in #11946
2.11.5
  * Check if FieldInfo is complete after applying type variable map by @Viicos in #11855
  * Do not delete mock validator/serializer in model_rebuild() by @Viicos in #11890
  * Do not duplicate metadata on model rebuild by @Viicos in #11902
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
relnotes-fix Used for bugfixes.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Incorrect ValidationInfo.field_name when using type statement
2 participants