Skip to content

Commit

Permalink
⚡️ Add the option not to reload lamindb on connect (#923)
Browse files Browse the repository at this point in the history
Add the option not to reload lamindb on connect
  • Loading branch information
Koncopd authored Jan 2, 2025
1 parent 4de1419 commit b5a612f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lamindb_setup/_connect_instance.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,7 @@ def connect(slug: str, **kwargs) -> str | tuple | None:
"_db",
"_write_settings",
"_raise_not_found_error",
"_reload_lamindb",
"_test",
"_user",
}
Expand All @@ -210,6 +211,7 @@ def connect(slug: str, **kwargs) -> str | tuple | None:
_db: str | None = kwargs.get("_db", None)
_write_settings: bool = kwargs.get("_write_settings", True)
_raise_not_found_error: bool = kwargs.get("_raise_not_found_error", True)
_reload_lamindb: bool = kwargs.get("_reload_lamindb", True)
_test: bool = kwargs.get("_test", False)

access_token: str | None = None
Expand Down Expand Up @@ -300,7 +302,8 @@ def connect(slug: str, **kwargs) -> str | tuple | None:
# except ProgrammingError:
# pass
load_from_isettings(isettings, user=_user, write_settings=_write_settings)
importlib.reload(importlib.import_module("lamindb"))
if _reload_lamindb:
importlib.reload(importlib.import_module("lamindb"))
except Exception as e:
if isettings is not None:
if _write_settings:
Expand Down

0 comments on commit b5a612f

Please sign in to comment.