KEMBAR78
Fix: allow empty string aliases with `AliasGenerator` by sydney-runkle · Pull Request #8810 · pydantic/pydantic · GitHub
Skip to content

Conversation

@sydney-runkle
Copy link
Contributor

@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
Contributor Author

Please review

@cloudflare-workers-and-pages
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

@codspeed-hq
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.

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