dycw-utilities 0.133.2__py3-none-any.whl → 0.133.6__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.
- {dycw_utilities-0.133.2.dist-info → dycw_utilities-0.133.6.dist-info}/METADATA +2 -1
- {dycw_utilities-0.133.2.dist-info → dycw_utilities-0.133.6.dist-info}/RECORD +8 -8
- utilities/__init__.py +1 -1
- utilities/sqlalchemy.py +5 -3
- utilities/sqlalchemy_polars.py +1 -1
- utilities/types.py +4 -0
- {dycw_utilities-0.133.2.dist-info → dycw_utilities-0.133.6.dist-info}/WHEEL +0 -0
- {dycw_utilities-0.133.2.dist-info → dycw_utilities-0.133.6.dist-info}/licenses/LICENSE +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: dycw-utilities
|
3
|
-
Version: 0.133.
|
3
|
+
Version: 0.133.6
|
4
4
|
Author-email: Derek Wan <d.wan@icloud.com>
|
5
5
|
License-File: LICENSE
|
6
6
|
Requires-Python: >=3.12
|
@@ -17,6 +17,7 @@ Requires-Dist: pytest-asyncio<1.1,>=1.0.0; extra == 'test'
|
|
17
17
|
Requires-Dist: pytest-cov<6.2,>=6.1.1; extra == 'test'
|
18
18
|
Requires-Dist: pytest-instafail<0.6,>=0.5.0; extra == 'test'
|
19
19
|
Requires-Dist: pytest-lazy-fixtures<1.2,>=1.1.4; extra == 'test'
|
20
|
+
Requires-Dist: pytest-randomly<3.17,>=3.16.0; extra == 'test'
|
20
21
|
Requires-Dist: pytest-regressions<2.9,>=2.8.0; extra == 'test'
|
21
22
|
Requires-Dist: pytest-rerunfailures<16,>=15.1; extra == 'test'
|
22
23
|
Requires-Dist: pytest-rng<1.1,>=1.0.0; extra == 'test'
|
@@ -1,4 +1,4 @@
|
|
1
|
-
utilities/__init__.py,sha256=
|
1
|
+
utilities/__init__.py,sha256=zEbfqlJXaAM2jeU-uk4y12_DIVcHjGVmBbiIiG_zz0Q,60
|
2
2
|
utilities/aiolimiter.py,sha256=mD0wEiqMgwpty4XTbawFpnkkmJS6R4JRsVXFUaoitSU,628
|
3
3
|
utilities/altair.py,sha256=HeZBVUocjkrTNwwKrClppsIqgNFF-ykv05HfZSoHYno,9104
|
4
4
|
utilities/arq.py,sha256=objwVQZEmpX8XEtSdLB_Md_HY8VDEnT-_4Y_ujRy4NM,6498
|
@@ -68,8 +68,8 @@ utilities/sentinel.py,sha256=3jIwgpMekWgDAxPDA_hXMP2St43cPhciKN3LWiZ7kv0,1248
|
|
68
68
|
utilities/shelve.py,sha256=HZsMwK4tcIfg3sh0gApx4-yjQnrY4o3V3ZRimvRhoW0,738
|
69
69
|
utilities/slack_sdk.py,sha256=SsRMJD2HuPUjAFg-2JxOQ9IhKViu4f66cN5kt-C2a7M,4245
|
70
70
|
utilities/socket.py,sha256=K77vfREvzoVTrpYKo6MZakol0EYu2q1sWJnnZqL0So0,118
|
71
|
-
utilities/sqlalchemy.py,sha256=
|
72
|
-
utilities/sqlalchemy_polars.py,sha256=
|
71
|
+
utilities/sqlalchemy.py,sha256=A4_31D58RECTshpYQWRJ6Rr3s5gm8YeySp-5Z4R7lRQ,38065
|
72
|
+
utilities/sqlalchemy_polars.py,sha256=5TwuUPORZ1Nz3qbI6L6pzeThtEv8Ws4aQW8cm3MG-v0,14293
|
73
73
|
utilities/statsmodels.py,sha256=koyiBHvpMcSiBfh99wFUfSggLNx7cuAw3rwyfAhoKpQ,3410
|
74
74
|
utilities/streamlit.py,sha256=U9PJBaKP1IdSykKhPZhIzSPTZsmLsnwbEPZWzNhJPKk,2955
|
75
75
|
utilities/string.py,sha256=XmU-s04qIV_tODnKl2pQiwmHaxzgOqRKU-RyzdrfvSE,620
|
@@ -79,7 +79,7 @@ utilities/threading.py,sha256=GvBOp4CyhHfN90wGXZuA2VKe9fGzMaEa7oCl4f3nnPU,1009
|
|
79
79
|
utilities/timer.py,sha256=oYqRQ-G-DMOOHB6a4yP5-PJDVimLnbNkMnkOj_jUmFg,2474
|
80
80
|
utilities/traceback.py,sha256=i-790AQbTrDA8MiYyOcYPFpm48I558VR_kL_7x4ypfY,8503
|
81
81
|
utilities/typed_settings.py,sha256=io3bhnglxO5FRNuTz1vpgbbGgvyj6VGJ5pytPRUeJo4,3769
|
82
|
-
utilities/types.py,sha256
|
82
|
+
utilities/types.py,sha256=-ql33onw3mp3nS6ZBXyE-g1uYEdGhoTJQcYOfatSNGI,19360
|
83
83
|
utilities/typing.py,sha256=kVWK6ciV8T0MKxnFQcMSEr_XlRisspH5aBTTosMUh30,13872
|
84
84
|
utilities/tzdata.py,sha256=fgNVj66yUbCSI_-vrRVzSD3gtf-L_8IEJEPjP_Jel5Y,266
|
85
85
|
utilities/tzlocal.py,sha256=KyCXEgCTjqGFx-389JdTuhMRUaT06U1RCMdWoED-qro,728
|
@@ -89,7 +89,7 @@ utilities/warnings.py,sha256=un1LvHv70PU-LLv8RxPVmugTzDJkkGXRMZTE2-fTQHw,1771
|
|
89
89
|
utilities/whenever.py,sha256=A-yoOqBqrcVD1yDINDsTFDw7dq9-zgUGn_f8CxVUQJs,23332
|
90
90
|
utilities/zipfile.py,sha256=24lQc9ATcJxHXBPc_tBDiJk48pWyRrlxO2fIsFxU0A8,699
|
91
91
|
utilities/zoneinfo.py,sha256=oEH-nL3t4h9uawyZqWDtNtDAl6M-CLpLYGI_nI6DulM,1971
|
92
|
-
dycw_utilities-0.133.
|
93
|
-
dycw_utilities-0.133.
|
94
|
-
dycw_utilities-0.133.
|
95
|
-
dycw_utilities-0.133.
|
92
|
+
dycw_utilities-0.133.6.dist-info/METADATA,sha256=2kzp_mBpkFfRF9tQRbGoeEZN13gmZG4UpUS3DqB7RfE,1584
|
93
|
+
dycw_utilities-0.133.6.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
94
|
+
dycw_utilities-0.133.6.dist-info/licenses/LICENSE,sha256=gppZp16M6nSVpBbUBrNL6JuYfvKwZiKgV7XoKKsHzqo,1066
|
95
|
+
dycw_utilities-0.133.6.dist-info/RECORD,,
|
utilities/__init__.py
CHANGED
utilities/sqlalchemy.py
CHANGED
@@ -298,11 +298,13 @@ def get_chunk_size(
|
|
298
298
|
/,
|
299
299
|
*,
|
300
300
|
chunk_size_frac: float = CHUNK_SIZE_FRAC,
|
301
|
-
|
301
|
+
max_length: int = 1,
|
302
302
|
) -> int:
|
303
303
|
"""Get the maximum chunk size for an engine."""
|
304
304
|
max_params = _get_dialect_max_params(engine_or_conn)
|
305
|
-
|
305
|
+
scaling = max(max_length, 1)
|
306
|
+
size = floor(chunk_size_frac * max_params / scaling)
|
307
|
+
return max(size, 1)
|
306
308
|
|
307
309
|
|
308
310
|
##
|
@@ -1098,7 +1100,7 @@ def _prepare_insert_or_upsert_items(
|
|
1098
1100
|
}
|
1099
1101
|
max_length = max(lengths, default=1)
|
1100
1102
|
chunk_size = get_chunk_size(
|
1101
|
-
engine, chunk_size_frac=chunk_size_frac,
|
1103
|
+
engine, chunk_size_frac=chunk_size_frac, max_length=max_length
|
1102
1104
|
)
|
1103
1105
|
|
1104
1106
|
def yield_pairs() -> Iterator[tuple[Insert, None]]:
|
utilities/sqlalchemy_polars.py
CHANGED
@@ -433,7 +433,7 @@ def _select_to_dataframe_yield_selects_with_in_clauses(
|
|
433
433
|
in_col, in_values = in_clauses
|
434
434
|
if in_clauses_chunk_size is None:
|
435
435
|
chunk_size = get_chunk_size(
|
436
|
-
engine, chunk_size_frac=chunk_size_frac,
|
436
|
+
engine, chunk_size_frac=chunk_size_frac, max_length=max_length
|
437
437
|
)
|
438
438
|
else:
|
439
439
|
chunk_size = in_clauses_chunk_size
|
utilities/types.py
CHANGED
@@ -82,6 +82,9 @@ TCallable2 = TypeVar("TCallable2", bound=Callable[..., Any])
|
|
82
82
|
TCallableCoroutine1 = TypeVar(
|
83
83
|
"TCallableCoroutine1", bound=Callable[..., Coroutine1[Any]]
|
84
84
|
)
|
85
|
+
TCallableCoroutine1None = TypeVar(
|
86
|
+
"TCallableCoroutine1None", bound=Callable[..., Coroutine1[None]]
|
87
|
+
)
|
85
88
|
TCallableMaybeCoroutine1None = TypeVar(
|
86
89
|
"TCallableMaybeCoroutine1None", bound=Callable[..., MaybeCoroutine1[None]]
|
87
90
|
)
|
@@ -352,6 +355,7 @@ __all__ = [
|
|
352
355
|
"TCallable1",
|
353
356
|
"TCallable2",
|
354
357
|
"TCallableCoroutine1",
|
358
|
+
"TCallableCoroutine1None",
|
355
359
|
"TCallableMaybeCoroutine1None",
|
356
360
|
"TDataclass",
|
357
361
|
"TEnum",
|
File without changes
|
File without changes
|