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

🏗️ Enableln.connect() in lamindb #668

Merged
merged 24 commits into from
Mar 7, 2024
Merged

🏗️ Enableln.connect() in lamindb #668

merged 24 commits into from
Mar 7, 2024

Conversation

falexwolf
Copy link
Member

No description provided.

@falexwolf falexwolf changed the title 🏗️ Require calling ln.setup.connect() in lamindb 🏗️ Require calling ln.setup.connect() in lamindb Mar 7, 2024
Copy link

github-actions bot commented Mar 7, 2024

@github-actions github-actions bot temporarily deployed to pull request March 7, 2024 02:10 Inactive
Copy link

codecov bot commented Mar 7, 2024

Codecov Report

Attention: Patch coverage is 92.96875% with 9 lines in your changes are missing coverage. Please review.

Project coverage is 80.89%. Comparing base (cac8551) to head (6aa18f0).
Report is 3 commits behind head on main.

Files Patch % Lines
lamindb_setup/_connect_instance.py 63.63% 4 Missing ⚠️
lamindb_setup/core/_settings.py 92.30% 2 Missing ⚠️
lamindb_setup/_check_setup.py 90.90% 1 Missing ⚠️
lamindb_setup/_init_instance.py 95.23% 1 Missing ⚠️
lamindb_setup/_schema.py 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #668      +/-   ##
==========================================
- Coverage   82.17%   80.89%   -1.29%     
==========================================
  Files          39       38       -1     
  Lines        2312     2340      +28     
==========================================
- Hits         1900     1893       -7     
- Misses        412      447      +35     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@github-actions github-actions bot temporarily deployed to pull request March 7, 2024 08:38 Inactive
@falexwolf falexwolf changed the title 🏗️ Require calling ln.setup.connect() in lamindb 🏗️ Enableln.connect() in lamindb Mar 7, 2024
@Koncopd
Copy link
Member

Koncopd commented Mar 7, 2024

setting cache should work for all instances, it sets the cache folder for all instances, not for the current one only, so it should not be commented out, if it is broken, then it is a genuine bug, i believe.

@falexwolf
Copy link
Member Author

@Koncopd - I made an issue about this, it has nothing to do with the cache but between the impossibility of switching between instances: #669

I'm not entirely clear why ln_setup.close() enabled it before, it shouldn't have been possible because we currently can't switch between lamindb instances.

@github-actions github-actions bot temporarily deployed to pull request March 7, 2024 16:26 Inactive

if _LAMINDB_CONNECTED_TO is not None:
return True
if IS_SETUP:
Copy link
Member Author

Choose a reason for hiding this comment

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

@Koncopd - this line makes it more rigorous because this measures whether django is setup or not.

Copy link
Member Author

Choose a reason for hiding this comment

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

This is why now, we need the _test flag. I will try this.

(Just confirming what you said on the call before!)

Copy link
Member Author

Choose a reason for hiding this comment

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

Tried it and it doesn't work because it doesn't attempt to access the SQLite file when run with _test. Let's see whether I can change this.

Copy link
Member

Choose a reason for hiding this comment

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

No, this should not matter, lock is called in _load_db, which is called always on load / connect.

@github-actions github-actions bot temporarily deployed to pull request March 7, 2024 17:35 Inactive
@falexwolf falexwolf merged commit 666a340 into main Mar 7, 2024
10 of 11 checks passed
@falexwolf falexwolf deleted the noload branch March 7, 2024 17:55
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