lamindb_setup 1.18.2__py3-none-any.whl → 1.19.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 +4 -19
- lamindb_setup/_cache.py +87 -87
- lamindb_setup/_check.py +7 -7
- lamindb_setup/_check_setup.py +131 -131
- lamindb_setup/_connect_instance.py +443 -438
- lamindb_setup/_delete.py +155 -151
- lamindb_setup/_disconnect.py +38 -38
- lamindb_setup/_django.py +39 -39
- lamindb_setup/_entry_points.py +19 -19
- lamindb_setup/_init_instance.py +423 -429
- lamindb_setup/_migrate.py +331 -327
- lamindb_setup/_register_instance.py +32 -32
- lamindb_setup/_schema.py +27 -27
- lamindb_setup/_schema_metadata.py +451 -451
- lamindb_setup/_set_managed_storage.py +81 -80
- lamindb_setup/_setup_user.py +198 -198
- lamindb_setup/_silence_loggers.py +46 -46
- lamindb_setup/core/__init__.py +25 -34
- lamindb_setup/core/_aws_options.py +276 -266
- lamindb_setup/core/_aws_storage.py +57 -55
- lamindb_setup/core/_clone.py +50 -50
- lamindb_setup/core/_deprecated.py +62 -62
- lamindb_setup/core/_docs.py +14 -14
- lamindb_setup/core/_hub_client.py +288 -294
- lamindb_setup/core/_hub_core.py +0 -2
- lamindb_setup/core/_hub_crud.py +247 -247
- lamindb_setup/core/_hub_utils.py +100 -100
- lamindb_setup/core/_private_django_api.py +80 -80
- lamindb_setup/core/_settings.py +440 -434
- lamindb_setup/core/_settings_instance.py +32 -7
- lamindb_setup/core/_settings_load.py +162 -159
- lamindb_setup/core/_settings_save.py +108 -96
- lamindb_setup/core/_settings_storage.py +433 -433
- lamindb_setup/core/_settings_store.py +162 -92
- lamindb_setup/core/_settings_user.py +55 -55
- lamindb_setup/core/_setup_bionty_sources.py +44 -44
- lamindb_setup/core/cloud_sqlite_locker.py +240 -240
- lamindb_setup/core/django.py +414 -413
- lamindb_setup/core/exceptions.py +1 -1
- lamindb_setup/core/hashing.py +134 -134
- lamindb_setup/core/types.py +1 -1
- lamindb_setup/core/upath.py +1031 -1028
- lamindb_setup/errors.py +72 -70
- lamindb_setup/io.py +423 -416
- lamindb_setup/types.py +17 -17
- {lamindb_setup-1.18.2.dist-info → lamindb_setup-1.19.1.dist-info}/METADATA +4 -2
- lamindb_setup-1.19.1.dist-info/RECORD +51 -0
- {lamindb_setup-1.18.2.dist-info → lamindb_setup-1.19.1.dist-info}/WHEEL +1 -1
- {lamindb_setup-1.18.2.dist-info → lamindb_setup-1.19.1.dist-info/licenses}/LICENSE +201 -201
- lamindb_setup-1.18.2.dist-info/RECORD +0 -51
lamindb_setup/errors.py
CHANGED
|
@@ -1,70 +1,72 @@
|
|
|
1
|
-
"""Errors.
|
|
2
|
-
|
|
3
|
-
.. autoexception:: CurrentInstanceNotConfigured
|
|
4
|
-
.. autoexception:: ModuleWasntConfigured
|
|
5
|
-
.. autoexception:: StorageAlreadyManaged
|
|
6
|
-
.. autoexception:: StorageNotEmpty
|
|
7
|
-
.. autoexception:: InstanceLockedException
|
|
8
|
-
.. autoexception:: SettingsEnvFileOutdated
|
|
9
|
-
.. autoexception:: CannotSwitchDefaultInstance
|
|
10
|
-
.. autoexception:: InstanceNotFoundError
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
-
|
|
32
|
-
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
"'
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
1
|
+
"""Errors.
|
|
2
|
+
|
|
3
|
+
.. autoexception:: CurrentInstanceNotConfigured
|
|
4
|
+
.. autoexception:: ModuleWasntConfigured
|
|
5
|
+
.. autoexception:: StorageAlreadyManaged
|
|
6
|
+
.. autoexception:: StorageNotEmpty
|
|
7
|
+
.. autoexception:: InstanceLockedException
|
|
8
|
+
.. autoexception:: SettingsEnvFileOutdated
|
|
9
|
+
.. autoexception:: CannotSwitchDefaultInstance
|
|
10
|
+
.. autoexception:: InstanceNotFoundError
|
|
11
|
+
.. autoexception:: InstanceNotCreated
|
|
12
|
+
|
|
13
|
+
"""
|
|
14
|
+
|
|
15
|
+
from __future__ import annotations
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
class DefaultMessageException(Exception):
|
|
19
|
+
default_message: str | None = None
|
|
20
|
+
|
|
21
|
+
def __init__(self, message: str | None = None):
|
|
22
|
+
if message is None:
|
|
23
|
+
message = self.default_message
|
|
24
|
+
super().__init__(message)
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
class CurrentInstanceNotConfigured(DefaultMessageException):
|
|
28
|
+
default_message = """\
|
|
29
|
+
No instance is connected! Call
|
|
30
|
+
- CLI: lamin connect / lamin init
|
|
31
|
+
- Python: ln.connect() / ln.setup.init()
|
|
32
|
+
- R: ln$connect() / ln$setup$init()"""
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
MODULE_WASNT_CONFIGURED_MESSAGE_TEMPLATE = (
|
|
36
|
+
"'{}' wasn't configured for this instance -- "
|
|
37
|
+
"if you want it, go to your instance settings page and add it under 'schema modules' (or ask an admin to do so)"
|
|
38
|
+
)
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
class ModuleWasntConfigured(Exception):
|
|
42
|
+
pass
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
class StorageAlreadyManaged(Exception):
|
|
46
|
+
pass
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
class StorageNotEmpty(Exception):
|
|
50
|
+
pass
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
class InstanceNotFoundError(Exception):
|
|
54
|
+
pass
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
class InstanceNotCreated(Exception):
|
|
58
|
+
pass
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
# raise if a cloud SQLite instance is already locked
|
|
62
|
+
# ignored by unlock_cloud_sqlite_upon_exception
|
|
63
|
+
class InstanceLockedException(Exception):
|
|
64
|
+
pass
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
class SettingsEnvFileOutdated(Exception):
|
|
68
|
+
pass
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
class CannotSwitchDefaultInstance(Exception):
|
|
72
|
+
pass
|