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

Add warning when set "alias" in low level annontated field #9170

Conversation

nix010
Copy link
Contributor

@nix010 nix010 commented Apr 5, 2024

Change Summary

Add warning message when user setup annotated field with alias kwarg at low level. #7828.

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

Fix #7828

Selected Reviewer: @adriangb

Copy link

codspeed-hq bot commented Apr 5, 2024

CodSpeed Performance Report

Merging #9170 will not alter performance

Comparing nix010:7828-add-warning-on-low-level-alias-in-annotated-field (b4ff2c5) with main (15b82a9)

Summary

✅ 13 untouched benchmarks

@nix010 nix010 changed the title Add warning in low level annontated field Add warning when set "alias" in low level annontated field Apr 5, 2024
@nix010
Copy link
Contributor Author

nix010 commented Apr 5, 2024

please review.

@sydney-runkle sydney-runkle added the relnotes-change Used for changes to existing functionality which don't have a better categorization. label Apr 14, 2024
@sydney-runkle
Copy link
Member

@nix010,

Great work here, thanks! Will merge once tests pass - I made a few minor modifications to function names + warning wording.

@sydney-runkle
Copy link
Member

@nix010,

Sorry - not sure what exactly the last linting issue is with the test file - could you check locally? Other than that, we're good to merge!

@nix010
Copy link
Contributor Author

nix010 commented May 19, 2024

@sydney-runkle resolved the linting. Should be good now.

@sydney-runkle sydney-runkle enabled auto-merge (squash) May 20, 2024 13:25
Copy link
Member

@sydney-runkle sydney-runkle left a comment

Choose a reason for hiding this comment

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

Great work here, thanks!

@sydney-runkle sydney-runkle merged commit 46a0565 into pydantic:main May 20, 2024
52 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready for review relnotes-change Used for changes to existing functionality which don't have a better categorization.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Warn when Field(alias=...) is used as nested Annotated metadata
4 participants