Skip to content

Conversation

@Viicos
Copy link
Member

@Viicos Viicos commented Oct 17, 2025

Reverts #11957.

Fixes #12413.

The reported flawed signature from the original issue was using the following signature: (cls, values, info) -> .... However, #11957 resulted in the much more common (as per this GH search) (cls, values) -> ... signature (also not supposed to be accepted) to be confusingly broken (not rejected at build time, but the values argument is now the validation info).

According to this comment, the high usage of the invalid signature is probably due to V1 root validators changed to after model validators, without changing from a class method to an instance method. As such, I updated the migration guide to mention this change.

Change Summary

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

@Viicos Viicos added relnotes-fix Used for bugfixes. backport-2.12 Needs backport to 2.12 labels Oct 17, 2025
@github-actions
Copy link
Contributor

Coverage report

Click to see where and how coverage changed

FileStatementsMissingCoverageCoverage
(new stmts)
Lines missing
  pydantic
  functional_validators.py
  warnings.py
Project Total  

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

@codspeed-hq
Copy link

codspeed-hq bot commented Oct 17, 2025

CodSpeed Performance Report

Merging #12414 will degrade performances by 5.59%

Comparing revert-error-after-validator-classmethod (6732095) with main (31af2c5)

Summary

❌ 1 regression
✅ 45 untouched

⚠️ Please fix the performance issues or acknowledge them on CodSpeed.

Benchmarks breakdown

Benchmark BASE HEAD Change
test_model_validators_serializers 768.8 µs 814.3 µs -5.59%

@Viicos Viicos merged commit adfac8a into main Oct 17, 2025
68 of 69 checks passed
@Viicos Viicos deleted the revert-error-after-validator-classmethod branch October 17, 2025 12:01
Viicos added a commit that referenced this pull request Oct 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport-2.12 Needs backport to 2.12 relnotes-fix Used for bugfixes.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Pydantic 2.12.2 issue when using intake.open_esm_datastore

3 participants