Skip to content

Consider all field aliases in convenience constructors#165

Merged
adamnsch merged 3 commits intomainfrom
case-insensitive-continued
May 20, 2025
Merged

Consider all field aliases in convenience constructors#165
adamnsch merged 3 commits intomainfrom
case-insensitive-continued

Conversation

@adamnsch
Copy link
Collaborator

@adamnsch adamnsch commented May 16, 2025

Thank you for your contribution to the Graph Visualization for Python project by Neo4j.

Before submitting this PR, please read Contributing to the Neo4j Ecosystem.

Make sure:

  • You signed the Neo4j CLA (Contributor License Agreement) so that we are allowed to ship your code in our library
  • Your contribution is covered by tests

@adamnsch adamnsch force-pushed the case-insensitive-continued branch 2 times, most recently from 3507ea2 to 424fe12 Compare May 16, 2025 14:29
@adamnsch adamnsch force-pushed the case-insensitive-continued branch from 424fe12 to c756fc9 Compare May 16, 2025 14:30
@adamnsch adamnsch requested a review from FlorentinD May 19, 2025 09:03
Comment on lines +100 to +110
def all_validation_aliases(exempted_fields: Optional[list[str]] = None) -> set[str]:
if exempted_fields is None:
exempted_fields = []

by_field = [
v.validation_alias.choices # type: ignore
for k, v in Relationship.model_fields.items()
if k not in exempted_fields
]

return {str(alias) for aliases in by_field for alias in aliases}
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit. could be nice to have a test

Co-Authored-By: Florentin Dörre <florentin.dorre@neotechnology.com>
@adamnsch adamnsch merged commit d3ded3d into main May 20, 2025
11 checks passed
@adamnsch adamnsch deleted the case-insensitive-continued branch May 20, 2025 08:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants