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

Fix schema generation for generics with union type bounds #7899

Merged
merged 2 commits into from Oct 23, 2023

Conversation

sydney-runkle
Copy link
Member

@sydney-runkle sydney-runkle commented Oct 23, 2023

Change Summary

Fix schema generation for generics with union type bounds

Related issue number

Initially reported as part of a thread in #7884

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

@sydney-runkle
Copy link
Member Author

Please review

Copy link
Contributor

@davidhewitt davidhewitt left a comment

Choose a reason for hiding this comment

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

LGTM!

@@ -1508,6 +1508,22 @@ class MyInt(int):
ReferenceModel[MyInt]


def test_generic_with_referenced_generic_union_type_bound():
T = TypeVar('T', bound=Union[str, int])
Copy link
Contributor

Choose a reason for hiding this comment

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

From typing docs there is an example of a union bound, so I think it is completely correct to test this case 👍

@sydney-runkle sydney-runkle merged commit 47aa97e into main Oct 23, 2023
60 of 62 checks passed
@sydney-runkle sydney-runkle deleted the support-type-with-generic-bounds branch October 23, 2023 12:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants