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: allow empty string aliases with AliasGenerator #8810

Merged
merged 1 commit into from Feb 15, 2024

Conversation

sydney-runkle
Copy link
Member

@sydney-runkle sydney-runkle commented Feb 14, 2024

Fix #8808

Selected Reviewer: @dmontagu

@sydney-runkle sydney-runkle added the relnotes-fix Used for bugfixes. label Feb 14, 2024
@sydney-runkle
Copy link
Member Author

Please review

Copy link

Deploying with  Cloudflare Pages  Cloudflare Pages

Latest commit: 158a2bc
Status: ✅  Deploy successful!
Preview URL: https://c9f31cc9.pydantic-docs2.pages.dev
Branch Preview URL: https://alias-gen-str-fixes.pydantic-docs2.pages.dev

View logs

Copy link

codspeed-hq bot commented Feb 14, 2024

CodSpeed Performance Report

Merging #8810 will not alter performance

Comparing alias-gen-str-fixes (158a2bc) with main (b290b31)

Summary

✅ 10 untouched benchmarks

Copy link
Contributor

@dmontagu dmontagu left a comment

Choose a reason for hiding this comment

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

LGTM feel free to ignore my suggestion.

@@ -296,6 +296,15 @@ def push(self, for_type: type[Any]):
self._types_namespace_stack.pop()


def _get_first_non_null(a: Any, b: Any) -> Any:
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
def _get_first_non_null(a: Any, b: Any) -> Any:
def _get_first_not_none(a: Any, b: Any) -> Any:

not a big deal.

Copy link
Contributor

Choose a reason for hiding this comment

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

For what it's worth, I don't think it would be crazy to just copy the if <a> is not None else everywhere, but I'm okay with this too.

@sydney-runkle sydney-runkle merged commit 42ec73d into main Feb 15, 2024
56 checks passed
@sydney-runkle sydney-runkle deleted the alias-gen-str-fixes branch February 15, 2024 01:39
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.

Fix AliasGenerator handling of '' alias specifications
2 participants