sibi-dst 2025.9.12__py3-none-any.whl → 2025.9.13__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.
@@ -1,10 +1,11 @@
1
1
  from __future__ import annotations
2
2
 
3
3
  import asyncio
4
+ import logging
4
5
  from typing import List, Any, Dict
5
6
 
6
7
  import dask
7
- #dask.config.set({"distributed.worker.daemon": False})
8
+ # dask.config.set({"distributed.worker.daemon": False})
8
9
  import dask.dataframe as dd
9
10
 
10
11
  def _to_int_safe(x) -> int:
@@ -63,7 +64,7 @@ class UniqueValuesExtractor:
63
64
  pairs = await asyncio.gather(*(one(c) for c in columns))
64
65
  return dict(pairs)
65
66
 
66
- from contextlib import suppress
67
+ from contextlib import suppress, asynccontextmanager
67
68
  from dask.distributed import Client, LocalCluster, get_client
68
69
  import os
69
70
 
@@ -93,6 +94,12 @@ class DaskClientMixin:
93
94
  self.dask_client = dask_client
94
95
  self.own_dask_client = False
95
96
  self.logger = logger
97
+ # Apply log filters globally
98
+ logging.getLogger("distributed.shuffle._scheduler_plugin").setLevel(
99
+ logging.ERROR
100
+ )
101
+ logging.getLogger("distributed.scheduler").setLevel(logging.WARNING)
102
+ logging.getLogger("distributed.worker").setLevel(logging.WARNING)
96
103
 
97
104
  if self.dask_client is None:
98
105
  with suppress(ValueError, RuntimeError):
@@ -143,6 +150,15 @@ class DaskClientMixin:
143
150
  if self.logger:
144
151
  self.logger.warning(f"Error while closing Dask client: {e}")
145
152
 
153
+ @asynccontextmanager
154
+ async def shared_dask_session(**kwargs):
155
+ mixin = DaskClientMixin()
156
+ mixin._init_dask_client(**kwargs)
157
+ try:
158
+ yield mixin.dask_client
159
+ finally:
160
+ mixin._close_dask_client()
161
+
146
162
  # from contextlib import suppress
147
163
  # from dask.distributed import Client, get_client
148
164
  #
@@ -181,4 +197,4 @@ class DaskClientMixin:
181
197
  # self.logger.info("Closed local Dask client.")
182
198
  # except Exception as e:
183
199
  # if self.logger:
184
- # self.logger.warning(f"Error while closing Dask client: {e}")
200
+ # self.logger.warning(f"Error while closing Dask client: {e}")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: sibi-dst
3
- Version: 2025.9.12
3
+ Version: 2025.9.13
4
4
  Summary: A data science toolkit for scalable data processing and analysis.
5
5
  Requires-Python: >=3.11
6
6
  Description-Content-Type: text/markdown
@@ -42,7 +42,7 @@ sibi_dst/utils/base.py,sha256=sFngliI7Ku8bZMz0YdVhppuaPNZ0dvqRwCsPe9XdF1A,16256
42
42
  sibi_dst/utils/business_days.py,sha256=DPZExTXTt7n3IbAaEuVacm-vZgbR_Ug2bJTPBUaoP3g,6694
43
43
  sibi_dst/utils/clickhouse_writer.py,sha256=8W_dTEOKQp4pXANznVSxRqFA2H5oD8UJifiBAONpXWY,17001
44
44
  sibi_dst/utils/credentials.py,sha256=cHJPPsmVyijqbUQIq7WWPe-lIallA-mI5RAy3YUuRME,1724
45
- sibi_dst/utils/dask_utils.py,sha256=UA8Bp0Qm7n8WSyjFmxNSrWdJ5TG_v6NCrmgLxPbnXlA,6692
45
+ sibi_dst/utils/dask_utils.py,sha256=FT85GPvHxaR7BDhxgeQT4mgQ_lFmNT5CVmiyhRv9Fns,7251
46
46
  sibi_dst/utils/data_from_http_source.py,sha256=AcpKNsqTgN2ClNwuhgUpuNCx62r5_DdsAiKY8vcHEBA,1867
47
47
  sibi_dst/utils/data_utils.py,sha256=7bLidEjppieNoozDFb6OuRY0W995cxg4tiGAlkGfePI,7768
48
48
  sibi_dst/utils/data_wrapper.py,sha256=9HTuDXgvfhmFAOyNG_GEOaHuojxE3639yyzOoBt7Unc,18000
@@ -94,7 +94,7 @@ 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.12.dist-info/METADATA,sha256=6WESOFkRannoMbUj_V-dDpti2qQ5XIxUgHSTfaqKAHA,2413
98
- sibi_dst-2025.9.12.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
99
- sibi_dst-2025.9.12.dist-info/top_level.txt,sha256=g3Cj4R-rciuNyJgcxuxNgw5nhN0n4TCB0ujcTEjZNiU,9
100
- sibi_dst-2025.9.12.dist-info/RECORD,,
97
+ sibi_dst-2025.9.13.dist-info/METADATA,sha256=v8QE7j-yP0-1s6i4UcOhHIjsDpvSJGtBvzSkLy3f-v8,2413
98
+ sibi_dst-2025.9.13.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
99
+ sibi_dst-2025.9.13.dist-info/top_level.txt,sha256=g3Cj4R-rciuNyJgcxuxNgw5nhN0n4TCB0ujcTEjZNiU,9
100
+ sibi_dst-2025.9.13.dist-info/RECORD,,