Skip to content

Annotated tzinfo example#9468

Merged
sydney-runkle merged 8 commits intopydantic:mainfrom
ChrisPappalardo:annotated_tzinfo_example
May 21, 2024
Merged

Annotated tzinfo example#9468
sydney-runkle merged 8 commits intopydantic:mainfrom
ChrisPappalardo:annotated_tzinfo_example

Conversation

@ChrisPappalardo
Copy link
Copy Markdown
Contributor

@ChrisPappalardo ChrisPappalardo commented May 21, 2024

Change Summary

Add an example and a unit test for custom timezone validation.

Related issue number

#8088

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 May 21, 2024
@codspeed-hq
Copy link
Copy Markdown

codspeed-hq Bot commented May 21, 2024

CodSpeed Performance Report

Merging #9468 will not alter performance

Comparing ChrisPappalardo:annotated_tzinfo_example (768ad34) with main (9030415)

Summary

✅ 13 untouched benchmarks

@ChrisPappalardo
Copy link
Copy Markdown
Contributor Author

Tests pass with the following exception:
image

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.

Amazing! This is such a great use case for the combination of custom validators, annotated types, and modifying schema with annotated type metadata.

Excited to have this as a reference for a future.

@sydney-runkle sydney-runkle enabled auto-merge (squash) May 21, 2024 14:07
auto-merge was automatically disabled May 21, 2024 14:40

Head branch was pushed to by a user without write access

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.

Nice, thanks for moving things around so this follows the wrap validator pattern!

@sydney-runkle sydney-runkle enabled auto-merge (squash) May 21, 2024 15:05
@sydney-runkle sydney-runkle merged commit 5479258 into pydantic:main May 21, 2024
@jaymbans jaymbans mentioned this pull request May 31, 2024
5 tasks
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.

2 participants