thds.adls 3.2.20250618170437__py3-none-any.whl → 3.2.20250619163726__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.

@@ -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.source import Source
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
- 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)))
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
+ )
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: thds.adls
3
- Version: 3.2.20250618170437
3
+ Version: 3.2.20250619163726
4
4
  Summary: ADLS tools
5
5
  Author-email: Trilliant Health <info@trillianthealth.com>
6
6
  License: MIT
@@ -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=CEqg-Q9FB_fvgCsN0C_dn9CJqnEpnF0lA7gCdd9s6gg,2721
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.20250618170437.dist-info/METADATA,sha256=i--JI-eUu1VWHfzviAbRFNS1QIP5B_Pf6cSqrvc9CZE,543
37
- thds_adls-3.2.20250618170437.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
38
- thds_adls-3.2.20250618170437.dist-info/entry_points.txt,sha256=uTqreT1AIwqJboMfLv5w6sviM8mNbAkln765gIjzoA4,152
39
- thds_adls-3.2.20250618170437.dist-info/top_level.txt,sha256=LTZaE5SkWJwv9bwOlMbIhiS-JWQEEIcjVYnJrt-CriY,5
40
- thds_adls-3.2.20250618170437.dist-info/RECORD,,
36
+ thds_adls-3.2.20250619163726.dist-info/METADATA,sha256=K3TXY0ZARYNns5GPuU654B_WgLualdB2anDgsy1NyIM,543
37
+ thds_adls-3.2.20250619163726.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
38
+ thds_adls-3.2.20250619163726.dist-info/entry_points.txt,sha256=uTqreT1AIwqJboMfLv5w6sviM8mNbAkln765gIjzoA4,152
39
+ thds_adls-3.2.20250619163726.dist-info/top_level.txt,sha256=LTZaE5SkWJwv9bwOlMbIhiS-JWQEEIcjVYnJrt-CriY,5
40
+ thds_adls-3.2.20250619163726.dist-info/RECORD,,