Skip to content

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

Merged
sydney-runkle merged 8 commits intopydantic:mainfrom
nix010:7828-add-warning-on-low-level-alias-in-annotated-field
May 20, 2024
Merged

Add warning when set "alias" in low level annontated field#9170
sydney-runkle merged 8 commits intopydantic:mainfrom
nix010:7828-add-warning-on-low-level-alias-in-annotated-field

Conversation

@nix010
Copy link
Copy Markdown
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

@codspeed-hq
Copy link
Copy Markdown

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
Copy Markdown
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
Comment thread pydantic/_internal/_fields.py Outdated
Comment thread pydantic/_internal/_fields.py Outdated
Comment thread pydantic/_internal/_fields.py Outdated
Comment thread pydantic/_internal/_fields.py Outdated
Comment thread tests/test_annotated.py Outdated
Comment thread tests/test_annotated.py Outdated
@sydney-runkle
Copy link
Copy Markdown
Contributor

@nix010,

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

Comment thread tests/test_annotated.py Outdated
Comment thread tests/test_annotated.py
@sydney-runkle
Copy link
Copy Markdown
Contributor

@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
Copy Markdown
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
Copy Markdown
Contributor

@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
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