lamin_cli 1.5.2__py2.py3-none-any.whl → 1.5.3__py2.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.
- lamin_cli/__init__.py +1 -1
- lamin_cli/_save.py +17 -1
- {lamin_cli-1.5.2.dist-info → lamin_cli-1.5.3.dist-info}/METADATA +1 -1
- {lamin_cli-1.5.2.dist-info → lamin_cli-1.5.3.dist-info}/RECORD +7 -7
- {lamin_cli-1.5.2.dist-info → lamin_cli-1.5.3.dist-info}/LICENSE +0 -0
- {lamin_cli-1.5.2.dist-info → lamin_cli-1.5.3.dist-info}/WHEEL +0 -0
- {lamin_cli-1.5.2.dist-info → lamin_cli-1.5.3.dist-info}/entry_points.txt +0 -0
lamin_cli/__init__.py
CHANGED
lamin_cli/_save.py
CHANGED
|
@@ -6,6 +6,7 @@ from typing import TYPE_CHECKING
|
|
|
6
6
|
|
|
7
7
|
import click
|
|
8
8
|
from lamin_utils import logger
|
|
9
|
+
from lamindb_setup.core.hashing import hash_file
|
|
9
10
|
|
|
10
11
|
if TYPE_CHECKING:
|
|
11
12
|
from pathlib import Path
|
|
@@ -155,6 +156,10 @@ def save_from_path_cli(
|
|
|
155
156
|
return None
|
|
156
157
|
|
|
157
158
|
if registry == "transform":
|
|
159
|
+
if key is not None:
|
|
160
|
+
logger.warning(
|
|
161
|
+
"key is ignored for transforms, the transform key is determined by the filename"
|
|
162
|
+
)
|
|
158
163
|
if is_cloud_path:
|
|
159
164
|
logger.error("Can not register a transform from a cloud path")
|
|
160
165
|
return "transform-with-cloud-path"
|
|
@@ -201,8 +206,19 @@ def save_from_path_cli(
|
|
|
201
206
|
if transform is None:
|
|
202
207
|
uid = f"{stem_uid}0000"
|
|
203
208
|
else:
|
|
204
|
-
# TODO: account for folders
|
|
209
|
+
# TODO: account for folders as we do in ln.track()
|
|
210
|
+
transform_hash, _ = hash_file(path)
|
|
205
211
|
transform = ln.Transform.filter(key=path.name, is_latest=True).one_or_none()
|
|
212
|
+
if transform is not None and transform.hash is not None:
|
|
213
|
+
if transform.hash == transform_hash:
|
|
214
|
+
logger.important(
|
|
215
|
+
f"found existing Transform('{uid}') with matching hash"
|
|
216
|
+
)
|
|
217
|
+
return None
|
|
218
|
+
else:
|
|
219
|
+
# we need to create a new version
|
|
220
|
+
stem_uid = transform.uid[:12]
|
|
221
|
+
transform = None
|
|
206
222
|
revises = None
|
|
207
223
|
if stem_uid is not None:
|
|
208
224
|
revises = (
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
lamin_cli/__init__.py,sha256=
|
|
1
|
+
lamin_cli/__init__.py,sha256=LBeGwsZuICY7sdEYZSugLgtHOU3Wh7heajX7B22wO3I,40
|
|
2
2
|
lamin_cli/__main__.py,sha256=1hYODyzurDvq198STsIZ2slp_t_xq_c7QS0oyts33PA,15528
|
|
3
3
|
lamin_cli/_cache.py,sha256=oplwE8AcS_9PYptQUZxff2qTIdNFS81clGPkJNWk098,800
|
|
4
4
|
lamin_cli/_load.py,sha256=QqiFxGYmvFz2RjhvwKO5r1fmPWMZ5Ai4y1pJytdYKak,8301
|
|
5
5
|
lamin_cli/_migration.py,sha256=xQi6mwnpBzY5wcv1-TJhveD7a3XJIlpiYx6Z3AJ1NF0,1063
|
|
6
|
-
lamin_cli/_save.py,sha256=
|
|
6
|
+
lamin_cli/_save.py,sha256=W4sNGXGFWy9ilFozVYbmxROCD8kkD0jDBB51cTLgZWA,10769
|
|
7
7
|
lamin_cli/_settings.py,sha256=O2tecCf5EIZu98ima4DTJujo4KuywckOLgw8c-Ke3dY,1142
|
|
8
8
|
lamin_cli/compute/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
9
9
|
lamin_cli/compute/modal.py,sha256=QnR7GyyvWWWkLnou95HxS9xxSQfw1k-SiefM_qRVnU0,6010
|
|
10
|
-
lamin_cli-1.5.
|
|
11
|
-
lamin_cli-1.5.
|
|
12
|
-
lamin_cli-1.5.
|
|
13
|
-
lamin_cli-1.5.
|
|
14
|
-
lamin_cli-1.5.
|
|
10
|
+
lamin_cli-1.5.3.dist-info/entry_points.txt,sha256=Qms85i9cZPlu-U7RnVZhFsF7vJ9gaLZUFkCjcGcXTpg,49
|
|
11
|
+
lamin_cli-1.5.3.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
12
|
+
lamin_cli-1.5.3.dist-info/WHEEL,sha256=ssQ84EZ5gH1pCOujd3iW7HClo_O_aDaClUbX4B8bjKY,100
|
|
13
|
+
lamin_cli-1.5.3.dist-info/METADATA,sha256=nKdmSG7KwhZG3c1l_G8FkROI9xFdy_zdwmg6leWo7_Q,337
|
|
14
|
+
lamin_cli-1.5.3.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|