Skip to content

Conversation

@ygsh0816
Copy link
Contributor

@ygsh0816 ygsh0816 commented Jun 20, 2025

Change Summary

  1. Added PydanticSkipValidationWarning: Introduced a new warning subclass in warnings.py to categorise warnings related to unsupported types when using SkipValidation.

  2. Updated _generate_schema.py: Modified the warning logic to use PydanticSkipValidationWarning instead of the generic UserWarning.

  3. Enhanced functional_validators.py: Wrapped the handler call in SkipValidation with a mechanism to catch and suppress PydanticSkipValidationWarning.

  4. Test Coverage: Added tests to ensure SkipValidation properly suppresses warnings and bypasses validation as expected.

Related issue number

Fixes #11997

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

@github-actions github-actions bot added the relnotes-fix Used for bugfixes. label Jun 20, 2025
@ygsh0816 ygsh0816 changed the title fix(SkipValidation): Properly suppress PydanticSkipValidationWarning Fix(SkipValidation): Properly suppress PydanticSkipValidationWarning Jun 20, 2025
@codspeed-hq
Copy link

codspeed-hq bot commented Jun 20, 2025

CodSpeed Performance Report

Merging #12002 will not alter performance

Comparing ygsh0816:fix-warning-11997 (08ebfeb) with main (0c4a22b)

Summary

✅ 46 untouched benchmarks

@github-actions
Copy link
Contributor

github-actions bot commented Jun 23, 2025

Coverage report

Image Image

This PR does not seem to contain any modification to coverable code.

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.

Thanks @ygsh0816, but please refrain from doing AI contributions without at least assessing the quality of the patch. Several things were not correct (e.g. your added test which wasn't testing anything in reality). Fixing this is time consuming.

@Viicos Viicos changed the title Fix(SkipValidation): Properly suppress PydanticSkipValidationWarning Suppress core schema generation warning when using SkipValidation Jun 23, 2025
@Viicos Viicos enabled auto-merge (squash) June 23, 2025 09:39
@Viicos Viicos merged commit 188dc9a into pydantic:main Jun 23, 2025
54 checks passed
@ygsh0816
Copy link
Contributor Author

Thanks @ygsh0816, but please refrain from doing AI contributions without at least assessing the quality of the patch. Several things were not correct (e.g. your added test which wasn't testing anything in reality). Fixing this is time consuming.

Thank you for the feedback, and I appreciate you pointing out the issues with my PR.

This was my first-ever contribution to open source, so I’m still learning the ropes. I completely understand the importance of submitting well-reviewed and meaningful changes, and I’ll ensure that I am more thorough in future contributions, particularly in writing effective tests and validating the impact of the patch.

Thanks again for your patience, and I’m grateful for the opportunity to learn from this experience!

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.

pydantic.SkipValidation not properly suppressing warning

2 participants