sibi-dst 2025.9.7__py3-none-any.whl → 2025.9.8__py3-none-any.whl

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.
@@ -90,10 +90,14 @@ class ClickHouseWriter(ManagedResource):
90
90
 
91
91
  # one client per thread to avoid session contention
92
92
  self._tlocal = threading.local()
93
+ ow = self.overwrite
94
+ if ow:
95
+ self._command(f"DROP TABLE IF EXISTS {self._ident(self.table)}")
96
+ self.logger.info(f"Dropped table {self.table} (overwrite=True)")
93
97
 
94
98
  # ------------- public -------------
95
99
 
96
- def save_to_clickhouse(self, df: dd.DataFrame, *, overwrite: Optional[bool] = None) -> None:
100
+ def save_to_clickhouse(self, df: dd.DataFrame) -> None:
97
101
  """
98
102
  Persist a Dask DataFrame into ClickHouse.
99
103
 
@@ -118,15 +122,10 @@ class ClickHouseWriter(ManagedResource):
118
122
  )
119
123
 
120
124
  # (re)create table
121
- ow = self.overwrite if overwrite is None else bool(overwrite)
122
125
  dtypes = df._meta_nonempty.dtypes # metadata-only types (no compute)
123
126
  schema_sql = self._generate_clickhouse_schema(dtypes)
124
127
  engine_sql = self._default_engine_sql() if not self.engine else self.engine
125
128
 
126
- if ow:
127
- self._command(f"DROP TABLE IF EXISTS {self._ident(self.table)}")
128
- self.logger.info(f"Dropped table {self.table} (overwrite=True)")
129
-
130
129
  create_sql = f"CREATE TABLE IF NOT EXISTS {self._ident(self.table)} ({schema_sql}) {engine_sql}"
131
130
  self._command(create_sql)
132
131
  self.logger.info(f"Ensured table {self.table} exists")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: sibi-dst
3
- Version: 2025.9.7
3
+ Version: 2025.9.8
4
4
  Summary: Data Science Toolkit
5
5
  Author: Luis Valverde
6
6
  Author-email: lvalverdeb@gmail.com
@@ -48,7 +48,7 @@ sibi_dst/utils/boilerplate/base_parquet_reader.py,sha256=3kN9_bbxyX-WuJLMBWejeAp
48
48
  sibi_dst/utils/boilerplate/base_pipeline.py,sha256=R9_mMEn8gCtfTS7c3DyzWMf_oQjCSL_O7CR8z_t3nmc,6323
49
49
  sibi_dst/utils/boilerplate/hybrid_data_loader.py,sha256=Tazn7QL3FmWKVMXxzkvxPrG_2ucsPHvSotIW9dBLoNc,6018
50
50
  sibi_dst/utils/business_days.py,sha256=dP0Xj4FhTBIvZZrZYLOHZl5zOpDAgWkD4p_1a7BOT7I,8461
51
- sibi_dst/utils/clickhouse_writer.py,sha256=AOv0bYFzAI0u4dEkEBoUqtHekwPMISdNT5-ywCtDe4I,17049
51
+ sibi_dst/utils/clickhouse_writer.py,sha256=IQJ_rgd7VuF-g-aPbo9TfqZi0EB_3evCFTzcCNHSmpw,16969
52
52
  sibi_dst/utils/credentials.py,sha256=cHJPPsmVyijqbUQIq7WWPe-lIallA-mI5RAy3YUuRME,1724
53
53
  sibi_dst/utils/dask_utils.py,sha256=QhFcmpH4fXAy6b3DugIX5JvH4h-P3M3hXKnBYTLRkq0,1991
54
54
  sibi_dst/utils/data_from_http_source.py,sha256=AcpKNsqTgN2ClNwuhgUpuNCx62r5_DdsAiKY8vcHEBA,1867
@@ -94,6 +94,6 @@ sibi_dst/v2/df_helper/core/_params_config.py,sha256=DYx2drDz3uF-lSPzizPkchhy-kxR
94
94
  sibi_dst/v2/df_helper/core/_query_config.py,sha256=Y8LVSyaKuVkrPluRDkQoOwuXHQxner1pFWG3HPfnDHM,441
95
95
  sibi_dst/v2/utils/__init__.py,sha256=6H4cvhqTiFufnFPETBF0f8beVVMpfJfvUs6Ne0TQZNY,58
96
96
  sibi_dst/v2/utils/log_utils.py,sha256=rfk5VsLAt-FKpv6aPTC1FToIPiyrnHAFFBAkHme24po,4123
97
- sibi_dst-2025.9.7.dist-info/METADATA,sha256=oQWEtZDzZysq1YKGV8h5siw_DNhiuZvojgcmlx9BM8k,2710
98
- sibi_dst-2025.9.7.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
99
- sibi_dst-2025.9.7.dist-info/RECORD,,
97
+ sibi_dst-2025.9.8.dist-info/METADATA,sha256=rQ9QLcSm_bvFK2KOgi1ZmIgVZMwixMWvXT9SNmBU6fg,2710
98
+ sibi_dst-2025.9.8.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
99
+ sibi_dst-2025.9.8.dist-info/RECORD,,