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: handle nullable SQLA constraints #602

Merged
merged 5 commits into from
Nov 24, 2024

Conversation

adhtruong
Copy link
Collaborator

@adhtruong adhtruong commented Nov 6, 2024

Description

  • Constraints should be hashable to handle downstream usage
  • Create Frozendict to hold constraints
  • Alternative approachs
    • Update to vendor in annotated-types-esque classes and change internal to support this and use factories per type to generate. This would be backwards breaking and hard to generate for a user.
    • Pass constraints separately or another way. Not sure if can do this and pass these to FieldMeta whilst not breaking exposed interface

Closes

@adhtruong adhtruong requested a review from guacs as a code owner November 6, 2024 23:33
@adhtruong adhtruong marked this pull request as draft November 6, 2024 23:39
@adhtruong adhtruong marked this pull request as ready for review November 7, 2024 19:34
Copy link
Member

@provinzkraut provinzkraut left a comment

Choose a reason for hiding this comment

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

Good to merge IMO, except the one open comment

Copy link

Documentation preview will be available shortly at https://litestar-org.github.io/polyfactory-docs-preview/602

@adhtruong adhtruong merged commit 660183b into main Nov 24, 2024
23 checks passed
@adhtruong adhtruong deleted the fix-handle-nullable-sqla-column-constraints branch November 24, 2024 18:45
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.

Bug: SQLAlchemy instance build fails for models with nullable constraints
2 participants