containerio 2.3.1__tar.gz → 2.3.2__tar.gz

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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: containerio
3
- Version: 2.3.1
3
+ Version: 2.3.2
4
4
  Summary: Azure Blob Storage handler with unified local/cloud interface
5
5
  Author: Alliance SwissPass
6
6
  Requires-Dist: polars>=1.30.0
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "containerio"
3
- version = "2.3.1"
3
+ version = "2.3.2"
4
4
  description = "Azure Blob Storage handler with unified local/cloud interface"
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.11"
@@ -684,12 +684,8 @@ class StorageHandler:
684
684
  pl.DataFrame: The content of the JSON file as a Polars
685
685
  DataFrame.
686
686
  """
687
- if self.local:
688
- file_path = self.base_path / blob_name
689
- return pl.read_json(source=file_path, **kwargs)
690
- else:
691
- data = self._read_blob_as_bytes(blob_name)
692
- return pl.read_json(source=BytesIO(data), **kwargs)
687
+ data = self.read_blob_as_bytes(blob_name=blob_name)
688
+ return pl.read_json(source=BytesIO(data), **kwargs)
693
689
 
694
690
  def read_csv_blob(self, blob_name: str, **kwargs: Dict) -> pl.DataFrame:
695
691
  """Reads a CSV file from storage into a Polars DataFrame.
@@ -900,17 +896,9 @@ class StorageHandler:
900
896
  Returns:
901
897
  None
902
898
  """
903
- if self.local:
904
- file_path = self.base_path / blob_name
905
- file_path.parent.mkdir(parents=True, exist_ok=True)
906
- df.write_json(file=file_path, **kwargs)
907
- else:
908
- # Write the DataFrame to an in-memory stream
909
- buffer = BytesIO()
910
- df.write_json(file=buffer, **kwargs)
911
- buffer.seek(0)
912
- # Upload the bytes to Azure Blob Storage
913
- self._write_blob_as_bytes(blob_name, buffer.getvalue())
899
+ buffer = BytesIO()
900
+ df.write_json(file=buffer, **kwargs)
901
+ self.write_blob_as_bytes(blob_name=blob_name, data=buffer.getvalue())
914
902
 
915
903
  def write_csv_blob(self, blob_name: str, df: pl.DataFrame, **kwargs: Dict) -> None:
916
904
  """Writes a Polars DataFrame to a CSV file in storage.
File without changes