-
-
Notifications
You must be signed in to change notification settings - Fork 699
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
✨ Support sqlmodel_rebuild
#1270
base: main
Are you sure you want to change the base?
Conversation
sqlmodel_rebuild
Linter doesn't understand the special call handling for this case.
@svlandeg I think there were some merge errors in one of the commits in this thread. The following should show changes to only
|
The diff on this PR only shows changes in As you can see, the tests for Pydantic v1 are failing. This needs to be addressed before we can properly review this PR. Thanks! 🙏 |
That's the inconsistency I'm calling out. What the UI shows and I'm thinking I'll close this and create a new PR as a workaround. |
I looked into the
If I run pytest in each individual directory, they all pass. However, if I try to turn I can reproduce this behavior on the |
Hm, that's puzzling to me as well, as the tests do seem to succeed just fine on other recent PRs for this repo 🤔 |
@svlandeg the above test run verifies that the pydantic-v1 breakage was caused by my change. Looking into the actual cause of the failure, I think there is some Solving this boils down to figuring out how to correctly invoke |
@svlandeg tests are all green. Please review. |
The
@sqlmodel
decorator introduced byfquery.sqlmodel
moves schema definitions and types closer to the object model (references) instead of foreign_keys.Instead of writing:
you could write:
Everything works the same as before. Only the syntax has changed. However, if
Team
also has a foreign key toHero
, then one of them will have to use forward declaration so type checkers work.In those cases we need a two pass solution where in the second pass, with the full type definition available, we can generate the correct code.
Refactor some of the existing code to introduce
sqlmodel_rebuild()
.