-
Notifications
You must be signed in to change notification settings - Fork 2
🚸 Set up Django on every import of lamindb via a "mock instance" #1063
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
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1063 +/- ##
==========================================
+ Coverage 85.10% 85.21% +0.10%
==========================================
Files 45 45
Lines 3747 3794 +47
==========================================
+ Hits 3189 3233 +44
- Misses 558 561 +3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
@@ -339,6 +340,7 @@ def init( | |||
if _write_settings: | |||
settings.auto_connect = True | |||
importlib.reload(importlib.import_module("lamindb")) | |||
reset_django_module_variables() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i don't think it should always reset, it should do the reset only on re-connect. Also not clear why importlib.reload
deosn't do this already.
It is ready! |
I see the the tests still fail on |
That was something trivial related to refactoring the error behavior. |
Got it, I will check tmr morning. |
I think that very likely we can also eliminate the whole But these simplifications can also go into another PR, I guess. 🤔 |
The change here should allow us to eliminate the conditional import in the lamindb root module.
This PR fixes several issues with the reset logic introduced here:
Stale class issue: https://claude.ai/share/b4b3dcb5-4685-42dc-8e32-50851d41c5ac