Skip to content

Conversation

Viicos
Copy link
Member

@Viicos Viicos commented Aug 9, 2024

Fixes #10078

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

Copy link

cloudflare-workers-and-pages bot commented Aug 9, 2024

Deploying pydantic-docs with  Cloudflare Pages  Cloudflare Pages

Latest commit: 4493ecc
Status: ✅  Deploy successful!
Preview URL: https://25ce9029.pydantic-docs.pages.dev
Branch Preview URL: https://10078-1.pydantic-docs.pages.dev

View logs

@github-actions github-actions bot added the relnotes-fix Used for bugfixes. label Aug 9, 2024
Copy link

codspeed-hq bot commented Aug 9, 2024

CodSpeed Performance Report

Merging #10092 will not alter performance

Comparing 10078-1 (4493ecc) with main (07b7f64)

Summary

✅ 17 untouched benchmarks

Update documentation regarding invalid decorators
Copy link
Contributor

github-actions bot commented Aug 9, 2024

Coverage report

Click to see where and how coverage changed

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

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

Copy link
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.

@Viicos,

Truly fantastic work here. It's awesome to see how comfortable you are with the typing in this space of the codebase, and great to see such significant improvements.

I've left a few questions / requests.

Great work expanding the pyright test suite. This is a great way to track typing support issues / features going forward!


return dec
return dec # pyright: ignore[reportReturnType]
Copy link
Contributor

Choose a reason for hiding this comment

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

Part of the reason I'm wondering if we lost some specificity here...

@@ -363,14 +392,14 @@ def serialize_model(self):
The decorator function.
"""

def dec(f: Callable[..., Any]) -> _decorators.PydanticDescriptorProxy[Any]:
def dec(f: AnyModelPlainSerializer | AnyModelWrapSerializer) -> _decorators.PydanticDescriptorProxy[Any]:
Copy link
Contributor

Choose a reason for hiding this comment

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

👀

ModelSerializer: TypeAlias = 'AnyModelPlainSerializer | AnyModelWrapSerializer'

Copy link
Member Author

Choose a reason for hiding this comment

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

Good catch

@pydantic-hooky pydantic-hooky bot added awaiting author revision awaiting changes from the PR author labels Aug 10, 2024
Copy link
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 for explaining some of the nitty gritty typing patters here. Feel free to merge when you're ready 👍

@Viicos Viicos merged commit d2f944c into main Aug 12, 2024
61 checks passed
@Viicos Viicos deleted the 10078-1 branch August 12, 2024 19:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting author revision awaiting changes from the PR author relnotes-fix Used for bugfixes.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve pyright test suite
2 participants