thds.adls 4.1.20250826000918__py3-none-any.whl → 4.2.20250827225749__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/source_tree.py CHANGED
@@ -14,6 +14,7 @@ class BlobMeta:
14
14
  path: str
15
15
  size: int
16
16
  hash: ty.Optional[hashing.Hash]
17
+ metadata: dict[str, str]
17
18
 
18
19
 
19
20
  def to_blob_meta(blob_props: BlobProperties) -> BlobMeta:
@@ -21,9 +22,16 @@ def to_blob_meta(blob_props: BlobProperties) -> BlobMeta:
21
22
  blob_props.name,
22
23
  blob_props.size,
23
24
  next(iter(hashes.extract_hashes_from_props(blob_props).values()), None),
25
+ blob_props.metadata or {},
24
26
  )
25
27
 
26
28
 
29
+ def yield_blob_meta(container_client: ContainerClient, root_dir: str) -> ty.Iterator[BlobMeta]:
30
+ for blob_props in container_client.list_blobs(name_starts_with=root_dir, include=["metadata"]):
31
+ # `list_blobs` does not include metadata by default, so we need to explicitly specify including it
32
+ yield to_blob_meta(blob_props)
33
+
34
+
27
35
  # https://learn.microsoft.com/en-us/python/api/azure-storage-blob/azure.storage.blob.containerclient?view=azure-python#azure-storage-blob-containerclient-list-blobs
28
36
  # https://learn.microsoft.com/en-us/python/api/azure-storage-blob/azure.storage.blob.blobproperties?view=azure-python
29
37
  # https://learn.microsoft.com/en-us/python/api/azure-storage-blob/azure.storage.blob.contentsettings?view=azure-python
@@ -32,12 +40,11 @@ def list_blob_meta(
32
40
  ) -> ty.List[BlobMeta]:
33
41
  """Gets the path (relative to the SA/container root), size, and _a_ hash (if available) of all blobs in a directory."""
34
42
  return [
35
- to_blob_meta(blob_props)
36
- for blob_props in container_client.list_blobs(name_starts_with=root_dir, include=["metadata"])
37
- # `list_blobs` does not include metadata by default, so we need to explicitly specify including it
38
- if blob_props.size > 0
43
+ blob_meta
44
+ for blob_meta in yield_blob_meta(container_client, root_dir)
45
+ if blob_meta.size > 0
39
46
  # container client lists directories as blobs with size 0
40
- and blob_props.name.endswith(match_suffix)
47
+ and blob_meta.path.endswith(match_suffix)
41
48
  ]
42
49
 
43
50
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: thds.adls
3
- Version: 4.1.20250826000918
3
+ Version: 4.2.20250827225749
4
4
  Summary: ADLS tools
5
5
  Author-email: Trilliant Health <info@trillianthealth.com>
6
6
  License: MIT
@@ -24,7 +24,7 @@ thds/adls/ro_cache.py,sha256=P-UVFZhqnE5wojqYmRVWZcqjl-pM1xVMm9VAm3nXlnA,4769
24
24
  thds/adls/sas_tokens.py,sha256=mArbB_GYohevOmArw_1gKqVUWpv6kG8Hsbvdrhbtnbg,1957
25
25
  thds/adls/shared_credential.py,sha256=-x42aXoIM001KW59oS8PpuXQd4-F2vg-1gB6OMHlpk4,4602
26
26
  thds/adls/source.py,sha256=8HVMYuxDn1XYGwFFSBowMlvQ6r2Jm2CQlpu4h85JvsE,2559
27
- thds/adls/source_tree.py,sha256=exBi7jNrOyj9nH5rzxZmZOqhRW9WXnmZLdLt4weoXYc,2292
27
+ thds/adls/source_tree.py,sha256=FFcSJpbb7w5y6v1kzRQl0cUjjuSb34V8J2iHrrm9zDA,2542
28
28
  thds/adls/upload.py,sha256=MRHK9Am-x5FKBPh1SXLTbPC1r0Xk0bGWNU8CcNuUMLo,6602
29
29
  thds/adls/uri.py,sha256=9MXuW_KfpPvzBc4ERxuTJ3vvi_6yr7e1kMAW9mx2zXM,1414
30
30
  thds/adls/azcopy/__init__.py,sha256=qn2dmT92EHcrtaQ8uwRoUgvtF6Fu3NQbhZItOBdIBmY,45
@@ -36,8 +36,8 @@ thds/adls/azcopy/upload.py,sha256=RQLDJzS6qsMM12t5bykWJWBXs0UrmImrEFnPMxX2UlM,27
36
36
  thds/adls/tools/download.py,sha256=CW2cWbCRdUqisVVVoqqvqk5Ved7pPGTkwnZj3uV0jy4,1587
37
37
  thds/adls/tools/ls.py,sha256=OgEaIfTK359twlZIj-A0AW_nv81Z6zi0b9Tw6OJJfWA,1083
38
38
  thds/adls/tools/upload.py,sha256=5WyWkpuVp2PETZ3O3ODlq8LXszSHU73ZMnIDZXPJdC8,442
39
- thds_adls-4.1.20250826000918.dist-info/METADATA,sha256=GOp-aWA5D3Qi34V6N42xtUyOXXtrUExx1NxKJlOUvrc,587
40
- thds_adls-4.1.20250826000918.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
41
- thds_adls-4.1.20250826000918.dist-info/entry_points.txt,sha256=uTqreT1AIwqJboMfLv5w6sviM8mNbAkln765gIjzoA4,152
42
- thds_adls-4.1.20250826000918.dist-info/top_level.txt,sha256=LTZaE5SkWJwv9bwOlMbIhiS-JWQEEIcjVYnJrt-CriY,5
43
- thds_adls-4.1.20250826000918.dist-info/RECORD,,
39
+ thds_adls-4.2.20250827225749.dist-info/METADATA,sha256=sRSt8S6xJPAVYqh9z4XCnVoGI9HB8WOhmuDZuhXiQrI,587
40
+ thds_adls-4.2.20250827225749.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
41
+ thds_adls-4.2.20250827225749.dist-info/entry_points.txt,sha256=rtVF0A2MMTYUsBScF6b3AlOuk2Vm02QK7Tc2bDcDpk0,200
42
+ thds_adls-4.2.20250827225749.dist-info/top_level.txt,sha256=LTZaE5SkWJwv9bwOlMbIhiS-JWQEEIcjVYnJrt-CriY,5
43
+ thds_adls-4.2.20250827225749.dist-info/RECORD,,
@@ -1,4 +1,5 @@
1
1
  [console_scripts]
2
2
  adls-download-uri = thds.adls.tools.download:main
3
+ adls-ls-fast-uri = thds.adls.tools.ls_fast:main
3
4
  adls-ls-uri = thds.adls.tools.ls:main
4
5
  adls-upload-uri = thds.adls.tools.upload:main