Skip to content

Commit 2f3c60d

Browse files
Merge pull request #89 from CDCgov/rr-88-access-ledger
Rr 88 access ledger
2 parents 7be1f91 + 68dfa9e commit 2f3c60d

3 files changed

Lines changed: 19 additions & 11 deletions

File tree

cfa/dataops/catalog.py

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ def write_blob(
217217
container_name=self.container,
218218
append_blob=append,
219219
)
220-
self.ledger_entry(action="write")
220+
# self.ledger_entry(action="write")
221221
# print(f"file written to: {full_path}")
222222

223223
def read_blobs(
@@ -242,7 +242,7 @@ def read_blobs(
242242
)
243243
for i in blobs
244244
]
245-
self.ledger_entry(action="read")
245+
# self.ledger_entry(action="read")
246246
return blob_bytes
247247

248248
def read_csv(self, suffix: str) -> pd.DataFrame:
@@ -252,7 +252,7 @@ def read_csv(self, suffix: str) -> pd.DataFrame:
252252
container_name=self.container,
253253
)
254254
df = pd.read_csv(blob)
255-
self.ledger_entry(action="read")
255+
# self.ledger_entry(action="read")
256256
return df
257257

258258
def get_versions(self) -> list:
@@ -372,8 +372,8 @@ def download_version_to_local(
372372
with open(local_file_path, "wb") as f:
373373
f.write(file_bytes)
374374
written = True
375-
if written:
376-
self.ledger_entry(action="read")
375+
# if written:
376+
# self.ledger_entry(action="read")
377377
return written
378378

379379
@overload
@@ -446,7 +446,7 @@ def get_dataframe(
446446
credential=ManagedIdentityCredential()
447447
),
448448
)
449-
self.ledger_entry(action="read")
449+
# self.ledger_entry(action="read")
450450
return df
451451
elif file_ext == "csv":
452452
path = str(PurePosixPath(name).parent / f"*.{file_ext}")
@@ -459,7 +459,7 @@ def get_dataframe(
459459
credential=ManagedIdentityCredential()
460460
),
461461
)
462-
self.ledger_entry(action="read")
462+
##self.ledger_entry(action="read")
463463
return df
464464
elif file_ext == "ndjson" or file_ext == "jsonl":
465465
path = str(PurePosixPath(name).parent / f"*.{file_ext}")
@@ -472,7 +472,7 @@ def get_dataframe(
472472
credential=ManagedIdentityCredential()
473473
),
474474
)
475-
self.ledger_entry(action="read")
475+
##self.ledger_entry(action="read")
476476
return df
477477
else:
478478
raise ValueError(f"Lazy loading not supported for {file_ext} files.")
@@ -544,9 +544,11 @@ def ledger_entry(self, action: str) -> None:
544544
"action": action,
545545
}
546546
log_data = (json.dumps(log_entry) + "\n").encode("utf-8")
547-
write_blob_stream( # TODO: make this a streaming write to a single file (one per day parsed from get_timestamp())
547+
ledger_path = f"{self.ledger_location['prefix']}/{get_date()}.jsonl"
548+
549+
write_blob_stream(
548550
data=log_data,
549-
blob_url=f"{self.ledger_location['prefix']}/{get_date()}.jsonl",
551+
blob_url=ledger_path,
550552
account_name=self.ledger_location["account"],
551553
container_name=self.ledger_location["container"],
552554
append_blob=True,

changelog.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ and this project adheres to [Calendar Versioning](https://calver.org/).
77
The versioning pattern is `YYYY.MM.DD.micro(a/b/{none if release})
88

99
---
10+
## [2026.05.12.0]
11+
12+
### Fixed
13+
14+
- removed the ledger reads and write temporarily
15+
1016
## [2026.04.27.0]
1117

1218
### Fixed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "cfa.dataops"
3-
version = "2026.04.27.0"
3+
version = "2026.05.12.0"
44
description = "Data cataloging, ETL, modeling, verification, and validation for CFA"
55
authors = [
66
{ name = "Phil Rogers", email = "ap66@cdc.gov" },

0 commit comments

Comments
 (0)