Skip to content

Conversation

alexmojaki
Copy link
Contributor

@alexmojaki alexmojaki commented Oct 21, 2023

Change Summary

GenerateSchema._computed_field_schema already looks at the return type annotation to determine the final return type of a computed field, this just saves that in the ComputedFieldInfo.return_type.

Related issue number

Closes #7858

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

Selected Reviewer: @Kludex

@alexmojaki
Copy link
Contributor Author

please review

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.

Looks great, thanks!

@sydney-runkle sydney-runkle merged commit 18c3880 into pydantic:main Oct 25, 2023
@JonAnCla
Copy link
Contributor

Great! Thanks all for super fast turn around :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

computed_field: introspect return_type from annotation of wrapped method
5 participants