lamindb_setup 1.7.0__py3-none-any.whl → 1.7.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
lamindb_setup/__init__.py CHANGED
@@ -35,7 +35,7 @@ Modules & settings:
35
35
 
36
36
  """
37
37
 
38
- __version__ = "1.7.0" # denote a release candidate for 0.1.0 with 0.1rc1
38
+ __version__ = "1.7.1" # denote a release candidate for 0.1.0 with 0.1rc1
39
39
 
40
40
  import os
41
41
 
@@ -9,7 +9,10 @@ from lamin_utils import logger
9
9
 
10
10
  from ._check_setup import _check_instance_setup, _get_current_instance_settings
11
11
  from ._disconnect import disconnect
12
- from ._init_instance import load_from_isettings
12
+ from ._init_instance import (
13
+ MESSAGE_CANNOT_SWITCH_DEFAULT_INSTANCE,
14
+ load_from_isettings,
15
+ )
13
16
  from ._silence_loggers import silence_loggers
14
17
  from .core._hub_core import connect_instance_hub
15
18
  from .core._hub_utils import (
@@ -238,9 +241,9 @@ def connect(instance: str | None = None, **kwargs: Any) -> str | tuple | None:
238
241
  logger.important(f"connected lamindb: {settings.instance.slug}")
239
242
  return None
240
243
  else:
241
- from lamindb_setup.core.django import reset_django
242
-
243
- reset_django()
244
+ raise CannotSwitchDefaultInstance(
245
+ MESSAGE_CANNOT_SWITCH_DEFAULT_INSTANCE
246
+ )
244
247
  elif (
245
248
  _write_settings
246
249
  and settings._instance_exists
@@ -215,6 +215,16 @@ def validate_init_args(
215
215
  return name_str, instance_id, instance_state, instance_slug
216
216
 
217
217
 
218
+ MESSAGE_CANNOT_SWITCH_DEFAULT_INSTANCE = """
219
+ You cannot write to different instances in the same Python session.
220
+
221
+ Do you want to read from another instance via `SQLRecord.using()`? For example:
222
+
223
+ ln.Artifact.using("laminlabs/cellxgene").filter()
224
+
225
+ Or do you want to switch off auto-connect via `lamin settings set auto-connect false`?
226
+ """
227
+
218
228
  DOC_STORAGE_ARG = "A local or remote folder (`'s3://...'` or `'gs://...'`). Defaults to current working directory."
219
229
  DOC_INSTANCE_NAME = (
220
230
  "Instance name. If not passed, it will equal the folder name passed to `storage`."
@@ -262,9 +272,7 @@ def init(
262
272
  from ._check_setup import _check_instance_setup
263
273
 
264
274
  if _check_instance_setup() and not _test:
265
- from lamindb_setup.core.django import reset_django
266
-
267
- reset_django()
275
+ raise CannotSwitchDefaultInstance(MESSAGE_CANNOT_SWITCH_DEFAULT_INSTANCE)
268
276
  elif _write_settings:
269
277
  disconnect(mute=True)
270
278
  from .core._hub_core import init_instance_hub
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: lamindb_setup
3
- Version: 1.7.0
3
+ Version: 1.7.1
4
4
  Summary: Setup & configure LaminDB.
5
5
  Author-email: Lamin Labs <open-source@lamin.ai>
6
6
  Requires-Python: >=3.10
@@ -1,15 +1,15 @@
1
- lamindb_setup/__init__.py,sha256=czSdhM6f8e3Kh7eGH6JIMndX_G6Bf4SuZjt-QilKceQ,2782
1
+ lamindb_setup/__init__.py,sha256=jC_Rb1xvhIFtY2hWmuzYijeL2V6dfen9NrVtKjGJlr4,2782
2
2
  lamindb_setup/_cache.py,sha256=5o749NuW6zi6uP4rmBtwxg7ifWpAHXVngzC0tEgXLgo,2776
3
3
  lamindb_setup/_check.py,sha256=28PcG8Kp6OpjSLSi1r2boL2Ryeh6xkaCL87HFbjs6GA,129
4
4
  lamindb_setup/_check_setup.py,sha256=bXuqx2HEc178RM7gbKZQ65PEVJFu6uSOKiHAs_xz6GI,5575
5
- lamindb_setup/_connect_instance.py,sha256=WjkQ-u__4vogsofmjKX2Vc5ELG7P4IuK3O2MEEcboKQ,12638
5
+ lamindb_setup/_connect_instance.py,sha256=wQARuWyPSc9V5gYSADi_GIrwkyxNlZmsQT8-SbDHh-8,12724
6
6
  lamindb_setup/_delete.py,sha256=2KnZOqd5Kgr45XzjiDE9der35LODDUajZD6_hcurGtQ,5676
7
7
  lamindb_setup/_disconnect.py,sha256=p6tRLhixU4CuSxMKqzGTr-ovKmTRlZ8aID5dWQxOsg8,1092
8
8
  lamindb_setup/_django.py,sha256=uIQflpkp8l3axyPaKURlk3kacgpElVP5KOKmFxYSMGk,1454
9
9
  lamindb_setup/_entry_points.py,sha256=sKwXPX9xjOotoAjvgkU5LBwjjHLWVkh0ZGdiSsrch9k,522
10
10
  lamindb_setup/_exportdb.py,sha256=QLjoH4dEwqa01A12naKaDPglCCzl2_VLKWFfJRE_uSg,2113
11
11
  lamindb_setup/_importdb.py,sha256=fKv9ev5OOj_-bmzC8XZ1GxOcjIjI486yrHSHDWQrJeI,1874
12
- lamindb_setup/_init_instance.py,sha256=KeY3qcmQecCKjNVUN5ah59sztdi4lKoaeq8L7FVmIoQ,14967
12
+ lamindb_setup/_init_instance.py,sha256=Zb0YjDkAkNCY3KHdiU0tNDB8vc7GH4dSGyFzzzXmyhc,15300
13
13
  lamindb_setup/_migrate.py,sha256=ya-15sc91i4JmEWI4j00T2892x8hdy2fSW-qz4IdxLs,9739
14
14
  lamindb_setup/_register_instance.py,sha256=zmk7UrOF6qED_zTEaTM8GbZurMSP1SwddkRy7rpYmUY,1215
15
15
  lamindb_setup/_schema.py,sha256=b3uzhhWpV5mQtDwhMINc2MabGCnGLESy51ito3yl6Wc,679
@@ -44,7 +44,7 @@ lamindb_setup/core/exceptions.py,sha256=qjMzqy_uzPA7mCOdnoWnS_fdA6OWbdZGftz-YYpl
44
44
  lamindb_setup/core/hashing.py,sha256=Y8Uc5uSGTfU6L2R_gb5w8DdHhGRog7RnkK-e9FEMjPY,3680
45
45
  lamindb_setup/core/types.py,sha256=T7NwspfRHgIIpYsXDcApks8jkOlGeGRW-YbVLB7jNIo,67
46
46
  lamindb_setup/core/upath.py,sha256=tvu178E08VSC7YUNrcDYxri4ODuVtX3BGNhJO8UZf00,34302
47
- lamindb_setup-1.7.0.dist-info/LICENSE,sha256=UOZ1F5fFDe3XXvG4oNnkL1-Ecun7zpHzRxjp-XsMeAo,11324
48
- lamindb_setup-1.7.0.dist-info/WHEEL,sha256=CpUCUxeHQbRN5UGRQHYRJorO5Af-Qy_fHMctcQ8DSGI,82
49
- lamindb_setup-1.7.0.dist-info/METADATA,sha256=0xpYGkvJz0YXz4VJ6QWctANg8n3ecQ8ndqjDQNjjUp8,1797
50
- lamindb_setup-1.7.0.dist-info/RECORD,,
47
+ lamindb_setup-1.7.1.dist-info/LICENSE,sha256=UOZ1F5fFDe3XXvG4oNnkL1-Ecun7zpHzRxjp-XsMeAo,11324
48
+ lamindb_setup-1.7.1.dist-info/WHEEL,sha256=CpUCUxeHQbRN5UGRQHYRJorO5Af-Qy_fHMctcQ8DSGI,82
49
+ lamindb_setup-1.7.1.dist-info/METADATA,sha256=wa-lWsy1r7Sf-zRXpIAoWtBB9KiyKd8x97ynmUQnIcE,1797
50
+ lamindb_setup-1.7.1.dist-info/RECORD,,