@@ -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 ,
0 commit comments