thds.adls 3.2.20250619170701__py3-none-any.whl → 3.2.20250619225017__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.
Potentially problematic release.
This version of thds.adls might be problematic. Click here for more details.
- thds/adls/cached_up_down.py +10 -23
- {thds_adls-3.2.20250619170701.dist-info → thds_adls-3.2.20250619225017.dist-info}/METADATA +1 -1
- {thds_adls-3.2.20250619170701.dist-info → thds_adls-3.2.20250619225017.dist-info}/RECORD +6 -6
- {thds_adls-3.2.20250619170701.dist-info → thds_adls-3.2.20250619225017.dist-info}/WHEEL +0 -0
- {thds_adls-3.2.20250619170701.dist-info → thds_adls-3.2.20250619225017.dist-info}/entry_points.txt +0 -0
- {thds_adls-3.2.20250619170701.dist-info → thds_adls-3.2.20250619225017.dist-info}/top_level.txt +0 -0
thds/adls/cached_up_down.py
CHANGED
|
@@ -2,9 +2,8 @@ import typing as ty
|
|
|
2
2
|
from pathlib import Path
|
|
3
3
|
|
|
4
4
|
from thds.adls import source
|
|
5
|
-
from thds.core import
|
|
5
|
+
from thds.core.source import Source
|
|
6
6
|
from thds.core.source.tree import SourceTree
|
|
7
|
-
from thds.core.thunks import thunking
|
|
8
7
|
|
|
9
8
|
from .download import download_or_use_verified
|
|
10
9
|
from .fqn import AdlsFqn
|
|
@@ -54,30 +53,18 @@ def download_directory(fqn: AdlsFqn) -> Path:
|
|
|
54
53
|
return cached_dir_root
|
|
55
54
|
|
|
56
55
|
|
|
57
|
-
def _yield_all_file_paths(dir_path: Path) -> ty.Iterator[Path]:
|
|
58
|
-
for item in dir_path.iterdir():
|
|
59
|
-
if item.is_dir(): # recur
|
|
60
|
-
yield from _yield_all_file_paths(item)
|
|
61
|
-
elif item.is_file(): # yield
|
|
62
|
-
yield item
|
|
63
|
-
|
|
64
|
-
|
|
65
56
|
def upload_directory_through_cache(dest: UriIsh, src_path: Path) -> SourceTree:
|
|
66
57
|
if not src_path.is_dir():
|
|
67
58
|
raise ValueError(f"If you want to upload a file, use {upload_through_cache.__name__} instead")
|
|
68
59
|
|
|
69
60
|
dest = parse_any(dest)
|
|
70
61
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
parallel.yield_results(upload_thunks, named="upload_directory_through_cache"),
|
|
81
|
-
)
|
|
82
|
-
)
|
|
83
|
-
)
|
|
62
|
+
def _upload_directory(dir_path: Path) -> ty.Iterable[Source]:
|
|
63
|
+
for item in dir_path.iterdir():
|
|
64
|
+
if item.is_dir(): # recur
|
|
65
|
+
yield from _upload_directory(item)
|
|
66
|
+
elif item.is_file(): # upload
|
|
67
|
+
file_dest = dest / str(item.relative_to(src_path))
|
|
68
|
+
yield source.from_adls(upload_through_cache(file_dest, item))
|
|
69
|
+
|
|
70
|
+
return SourceTree(sources=list(_upload_directory(src_path)))
|
|
@@ -2,7 +2,7 @@ thds/adls/__init__.py,sha256=er14MoCC9PlJMxWVS4G1hAeMJItaJj4EAsrTZlvlb0M,797
|
|
|
2
2
|
thds/adls/_progress.py,sha256=ZzCHn_G7nHakioNFxdvoJZRr-jN6ymsp5JXf-iReROM,6580
|
|
3
3
|
thds/adls/_upload.py,sha256=XyP6tDM7s-A3G0SPSVlXRT4IZYsPqpOE4TeqtxP5i-I,4375
|
|
4
4
|
thds/adls/abfss.py,sha256=ZRJOLjDuXmS4bIbQAQpQxWWWeu74N9NKEKCNfXQek80,726
|
|
5
|
-
thds/adls/cached_up_down.py,sha256=
|
|
5
|
+
thds/adls/cached_up_down.py,sha256=CEqg-Q9FB_fvgCsN0C_dn9CJqnEpnF0lA7gCdd9s6gg,2721
|
|
6
6
|
thds/adls/conf.py,sha256=q1SPrgb46NpobVzwt_Oyv71-BvsIbZLq9nRWS3LZjz0,1990
|
|
7
7
|
thds/adls/copy.py,sha256=jUWbGvTpb4B3yRGS0nhGSbDzqRPzUqYgH0z1lFRJB3k,6365
|
|
8
8
|
thds/adls/dbfs.py,sha256=pPAjbIZRKJsaXKQljDMUgqS_zy1yKeEZHGMueXbuv3g,2219
|
|
@@ -33,8 +33,8 @@ thds/adls/resource/up_down.py,sha256=eTQMbeqM6edfVz18uHXRiOe0oEzOAaW1TBvym6lctNM
|
|
|
33
33
|
thds/adls/tools/download.py,sha256=vvBO8lSDl9oPugv75qpCkoemT9pOM9BV6yeExlkyG08,1594
|
|
34
34
|
thds/adls/tools/ls.py,sha256=OgEaIfTK359twlZIj-A0AW_nv81Z6zi0b9Tw6OJJfWA,1083
|
|
35
35
|
thds/adls/tools/upload.py,sha256=eMk4pdug1aCMPDDWpIE3Zoq77i5APp9Uuh-sVCCDNJE,493
|
|
36
|
-
thds_adls-3.2.
|
|
37
|
-
thds_adls-3.2.
|
|
38
|
-
thds_adls-3.2.
|
|
39
|
-
thds_adls-3.2.
|
|
40
|
-
thds_adls-3.2.
|
|
36
|
+
thds_adls-3.2.20250619225017.dist-info/METADATA,sha256=w_12MtQMscX1OtL0FVEMPEjqMZUELJdJxomM6ZbS-Mw,543
|
|
37
|
+
thds_adls-3.2.20250619225017.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
38
|
+
thds_adls-3.2.20250619225017.dist-info/entry_points.txt,sha256=uTqreT1AIwqJboMfLv5w6sviM8mNbAkln765gIjzoA4,152
|
|
39
|
+
thds_adls-3.2.20250619225017.dist-info/top_level.txt,sha256=LTZaE5SkWJwv9bwOlMbIhiS-JWQEEIcjVYnJrt-CriY,5
|
|
40
|
+
thds_adls-3.2.20250619225017.dist-info/RECORD,,
|
|
File without changes
|
{thds_adls-3.2.20250619170701.dist-info → thds_adls-3.2.20250619225017.dist-info}/entry_points.txt
RENAMED
|
File without changes
|
{thds_adls-3.2.20250619170701.dist-info → thds_adls-3.2.20250619225017.dist-info}/top_level.txt
RENAMED
|
File without changes
|