File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1414import pandas as pd
1515import polars as pl
1616import tomli
17- from azure .core .exceptions import ResourceExistsError
1817from azure .identity import ManagedIdentityCredential
1918from 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 ,
You can’t perform that action at this time.
0 commit comments