thds.adls 3.2.20250618235513__py3-none-any.whl → 3.2.20250619170701__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 +23 -10
- {thds_adls-3.2.20250618235513.dist-info → thds_adls-3.2.20250619170701.dist-info}/METADATA +1 -1
- {thds_adls-3.2.20250618235513.dist-info → thds_adls-3.2.20250619170701.dist-info}/RECORD +6 -6
- {thds_adls-3.2.20250618235513.dist-info → thds_adls-3.2.20250619170701.dist-info}/WHEEL +0 -0
- {thds_adls-3.2.20250618235513.dist-info → thds_adls-3.2.20250619170701.dist-info}/entry_points.txt +0 -0
- {thds_adls-3.2.20250618235513.dist-info → thds_adls-3.2.20250619170701.dist-info}/top_level.txt +0 -0
thds/adls/cached_up_down.py
CHANGED
|
@@ -2,8 +2,9 @@ import typing as ty
|
|
|
2
2
|
from pathlib import Path
|
|
3
3
|
|
|
4
4
|
from thds.adls import source
|
|
5
|
-
from thds.core
|
|
5
|
+
from thds.core import parallel
|
|
6
6
|
from thds.core.source.tree import SourceTree
|
|
7
|
+
from thds.core.thunks import thunking
|
|
7
8
|
|
|
8
9
|
from .download import download_or_use_verified
|
|
9
10
|
from .fqn import AdlsFqn
|
|
@@ -53,18 +54,30 @@ def download_directory(fqn: AdlsFqn) -> Path:
|
|
|
53
54
|
return cached_dir_root
|
|
54
55
|
|
|
55
56
|
|
|
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
|
+
|
|
56
65
|
def upload_directory_through_cache(dest: UriIsh, src_path: Path) -> SourceTree:
|
|
57
66
|
if not src_path.is_dir():
|
|
58
67
|
raise ValueError(f"If you want to upload a file, use {upload_through_cache.__name__} instead")
|
|
59
68
|
|
|
60
69
|
dest = parse_any(dest)
|
|
61
70
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
+
upload_thunks = [
|
|
72
|
+
thunking(upload_through_cache)(dest / str(file_path.relative_to(src_path)), file_path)
|
|
73
|
+
for file_path in _yield_all_file_paths(src_path)
|
|
74
|
+
]
|
|
75
|
+
|
|
76
|
+
return SourceTree(
|
|
77
|
+
sources=list(
|
|
78
|
+
map(
|
|
79
|
+
source.from_adls,
|
|
80
|
+
parallel.yield_results(upload_thunks, named="upload_directory_through_cache"),
|
|
81
|
+
)
|
|
82
|
+
)
|
|
83
|
+
)
|
|
@@ -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=3rdTuD_qKodFEo7vsl2mN5QMHSjDCGf3UaRKta6BTaI,2955
|
|
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.20250619170701.dist-info/METADATA,sha256=Ij-9J-Q0YxxL0bpzxe-Yvq_EbILEFzAiqWshTUpjvXo,543
|
|
37
|
+
thds_adls-3.2.20250619170701.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
38
|
+
thds_adls-3.2.20250619170701.dist-info/entry_points.txt,sha256=uTqreT1AIwqJboMfLv5w6sviM8mNbAkln765gIjzoA4,152
|
|
39
|
+
thds_adls-3.2.20250619170701.dist-info/top_level.txt,sha256=LTZaE5SkWJwv9bwOlMbIhiS-JWQEEIcjVYnJrt-CriY,5
|
|
40
|
+
thds_adls-3.2.20250619170701.dist-info/RECORD,,
|
|
File without changes
|
{thds_adls-3.2.20250618235513.dist-info → thds_adls-3.2.20250619170701.dist-info}/entry_points.txt
RENAMED
|
File without changes
|
{thds_adls-3.2.20250618235513.dist-info → thds_adls-3.2.20250619170701.dist-info}/top_level.txt
RENAMED
|
File without changes
|