Skip to content

Commit 68dfa9e

Browse files
committed
remove copilot ledger code
1 parent 65cd9d6 commit 68dfa9e

1 file changed

Lines changed: 9 additions & 25 deletions

File tree

cfa/dataops/catalog.py

Lines changed: 9 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
import pandas as pd
1515
import polars as pl
1616
import tomli
17-
from azure.core.exceptions import ResourceExistsError
1817
from azure.identity import ManagedIdentityCredential
1918
from cfa.cloudops.blob_helpers import (
2019
read_blob_stream,
@@ -546,30 +545,15 @@ def ledger_entry(self, action: str) -> None:
546545
}
547546
log_data = (json.dumps(log_entry) + "\n").encode("utf-8")
548547
ledger_path = f"{self.ledger_location['prefix']}/{get_date()}.jsonl"
549-
try:
550-
write_blob_stream(
551-
data=log_data,
552-
blob_url=ledger_path,
553-
account_name=self.ledger_location["account"],
554-
container_name=self.ledger_location["container"],
555-
append_blob=True,
556-
overwrite=False,
557-
)
558-
except ResourceExistsError as e:
559-
# Azure Append Blobs have a 50,000 block limit; rotate to a new
560-
# timestamped file when the daily file is full.
561-
if "BlockCountExceedsLimit" in str(e):
562-
rotated_path = f"{self.ledger_location['prefix']}/{get_date()}_{get_timestamp()}.jsonl"
563-
write_blob_stream(
564-
data=log_data,
565-
blob_url=rotated_path,
566-
account_name=self.ledger_location["account"],
567-
container_name=self.ledger_location["container"],
568-
append_blob=True,
569-
overwrite=False,
570-
)
571-
else:
572-
raise
548+
549+
write_blob_stream(
550+
data=log_data,
551+
blob_url=ledger_path,
552+
account_name=self.ledger_location["account"],
553+
container_name=self.ledger_location["container"],
554+
append_blob=True,
555+
overwrite=False,
556+
)
573557

574558
def save_dataframe(
575559
self,

0 commit comments

Comments
 (0)