Skip to content

Commit

Permalink
⚡️ Do not reload lamindb on lamin connect (#101)
Browse files Browse the repository at this point in the history
  • Loading branch information
Koncopd authored Jan 2, 2025
1 parent 48aca0e commit 07b1f89
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
4 changes: 2 additions & 2 deletions lamin_cli/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ def connect(instance: str):
from lamindb_setup import settings as settings_, connect as connect_

settings_.auto_connect = True
return connect_(slug=instance)
return connect_(slug=instance, _reload_lamindb=False)


@main.command()
Expand Down Expand Up @@ -239,7 +239,7 @@ def load(entity: str, uid: str = None, key: str = None, with_env: bool = False):
# f"! please use: lamin connect {entity}"
# )
settings_.auto_connect = True
return connect(slug=entity)
return connect(slug=entity, _reload_lamindb=False)
else:
from lamin_cli._load import load as load_

Expand Down
4 changes: 0 additions & 4 deletions lamin_cli/_load.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,6 @@ def script_to_notebook(
logger.important(f"{transform.type} is here: {target_relpath}")

if with_env:
import lamindb as ln

ln.settings.track_run_inputs = False
if (
transform.latest_run is not None
Expand All @@ -145,8 +143,6 @@ def script_to_notebook(

return target_relpath
elif entity == "artifact":
import lamindb as ln

ln.settings.track_run_inputs = False

if query_by_uid:
Expand Down
3 changes: 2 additions & 1 deletion lamin_cli/_save.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
from __future__ import annotations
from pathlib import Path
from typing import Union
import lamindb_setup as ln_setup
from lamin_utils import logger
import re

Expand Down Expand Up @@ -47,6 +46,8 @@ def save_from_filepath_cli(
description: str | None,
registry: str | None,
) -> str | None:
import lamindb_setup as ln_setup

if not isinstance(filepath, Path):
filepath = Path(filepath)

Expand Down

0 comments on commit 07b1f89

Please sign in to comment.