dycw-utilities 0.162.0__py3-none-any.whl → 0.162.2__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,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: dycw-utilities
3
- Version: 0.162.0
3
+ Version: 0.162.2
4
4
  Author-email: Derek Wan <d.wan@icloud.com>
5
5
  License-File: LICENSE
6
6
  Requires-Python: >=3.12
@@ -12,13 +12,13 @@ Provides-Extra: logging
12
12
  Requires-Dist: coloredlogs<15.1,>=15.0.1; extra == 'logging'
13
13
  Provides-Extra: test
14
14
  Requires-Dist: dycw-pytest-only<2.2,>=2.1.1; extra == 'test'
15
- Requires-Dist: hypothesis<6.139,>=6.138.0; extra == 'test'
15
+ Requires-Dist: hypothesis<6.139,>=6.138.2; extra == 'test'
16
16
  Requires-Dist: pytest-asyncio<1.2,>=1.1.0; extra == 'test'
17
17
  Requires-Dist: pytest-cov<6.3,>=6.2.1; extra == 'test'
18
18
  Requires-Dist: pytest-instafail<0.6,>=0.5.0; extra == 'test'
19
- Requires-Dist: pytest-lazy-fixtures<1.2,>=1.1.4; extra == 'test'
19
+ Requires-Dist: pytest-lazy-fixtures<1.4,>=1.3.3; extra == 'test'
20
20
  Requires-Dist: pytest-randomly<3.17,>=3.16.0; extra == 'test'
21
- Requires-Dist: pytest-regressions<2.9,>=2.8.1; extra == 'test'
21
+ Requires-Dist: pytest-regressions<2.9,>=2.8.2; extra == 'test'
22
22
  Requires-Dist: pytest-repeat<0.10,>=0.9.4; extra == 'test'
23
23
  Requires-Dist: pytest-rerunfailures<16,>=15.1; extra == 'test'
24
24
  Requires-Dist: pytest-rng<1.1,>=1.0.0; extra == 'test'
@@ -1,4 +1,4 @@
1
- utilities/__init__.py,sha256=fzBkmVoVjZhXoXvWqy-KtoEh9n5zeC-vNNQErOa0OIw,60
1
+ utilities/__init__.py,sha256=1BMqyPquxXnh8RKd9q0l_5OhFj85DjpVjSCebVKh1gQ,60
2
2
  utilities/aeventkit.py,sha256=ddoleSwW9zdc2tjX5Ge0pMKtYwV_JMxhHYOxnWX2AGM,12609
3
3
  utilities/altair.py,sha256=92E2lCdyHY4Zb-vCw6rEJIsWdKipuu-Tu2ab1ufUfAk,9079
4
4
  utilities/asyncio.py,sha256=PUedzQ5deqlSECQ33sam9cRzI9TnygHz3FdOqWJWPTM,15288
@@ -57,14 +57,14 @@ utilities/pytest.py,sha256=M-Om6b3hpF9W_bEB7UFY2IzBCubSxzVQleGrgRXHtxY,7741
57
57
  utilities/pytest_regressions.py,sha256=ocjHTtfOeiGfQAKIei8pKNd61sxN9dawrJJ9gPt2wzA,4097
58
58
  utilities/random.py,sha256=hZlH4gnAtoaofWswuJYjcygejrY8db4CzP-z_adO2Mo,4165
59
59
  utilities/re.py,sha256=S4h-DLL6ScMPqjboZ_uQ1BVTJajrqV06r_81D--_HCE,4573
60
- utilities/redis.py,sha256=pqzl5A08vaRS4Gfjxob3LWWH9c-vwlsKbvVMTjWMSh8,28364
60
+ utilities/redis.py,sha256=pgdiHynm3unF8w7DxF2GVVvKNbxIBWJ-3VOvmGKKItQ,28526
61
61
  utilities/reprlib.py,sha256=ssYTcBW-TeRh3fhCJv57sopTZHF5FrPyyUg9yp5XBlo,3953
62
62
  utilities/scipy.py,sha256=wZJM7fEgBAkLSYYvSmsg5ac-QuwAI0BGqHVetw1_Hb0,947
63
63
  utilities/sentinel.py,sha256=A_p5jX2K0Yc5XBfoYHyBLqHsEWzE1ByOdDuzzA2pZnE,1434
64
64
  utilities/shelve.py,sha256=4OzjQI6kGuUbJciqf535rwnao-_IBv66gsT6tRGiUt0,759
65
65
  utilities/slack_sdk.py,sha256=76-DYtcGiUhEvl-voMamc5OjfF7Y7nCq54Bys1arqzw,2233
66
66
  utilities/socket.py,sha256=K77vfREvzoVTrpYKo6MZakol0EYu2q1sWJnnZqL0So0,118
67
- utilities/sqlalchemy.py,sha256=qBB6N2wVjplvI4xFgbzzNmsW5zLvnXszmxyV9AsrmbA,36367
67
+ utilities/sqlalchemy.py,sha256=xAVU92MTphMx2xAdYZpQX5xGnAACI5UvJIPG95infjE,36395
68
68
  utilities/sqlalchemy_polars.py,sha256=JCGhB37raSR7fqeWV5dTsciRTMVzIdVT9YSqKT0piT0,13370
69
69
  utilities/statsmodels.py,sha256=koyiBHvpMcSiBfh99wFUfSggLNx7cuAw3rwyfAhoKpQ,3410
70
70
  utilities/string.py,sha256=shmBK87zZwzGyixuNuXCiUbqzfeZ9xlrFwz6JTaRvDk,582
@@ -87,8 +87,8 @@ utilities/zoneinfo.py,sha256=tdIScrTB2-B-LH0ukb1HUXKooLknOfJNwHk10MuMYvA,3619
87
87
  utilities/pytest_plugins/__init__.py,sha256=U4S_2y3zgLZVfMenHRaJFBW8yqh2mUBuI291LGQVOJ8,35
88
88
  utilities/pytest_plugins/pytest_randomly.py,sha256=B1qYVlExGOxTywq2r1SMi5o7btHLk2PNdY_b1p98dkE,409
89
89
  utilities/pytest_plugins/pytest_regressions.py,sha256=9v8kAXDM2ycIXJBimoiF4EgrwbUvxTycFWJiGR_GHhM,1466
90
- dycw_utilities-0.162.0.dist-info/METADATA,sha256=Iqiz_VX7dYaR0YF7F-5LcfybxcWDxxvZHfDBXULiARQ,1643
91
- dycw_utilities-0.162.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
92
- dycw_utilities-0.162.0.dist-info/entry_points.txt,sha256=BOD_SoDxwsfJYOLxhrSXhHP_T7iw-HXI9f2WVkzYxvQ,135
93
- dycw_utilities-0.162.0.dist-info/licenses/LICENSE,sha256=gppZp16M6nSVpBbUBrNL6JuYfvKwZiKgV7XoKKsHzqo,1066
94
- dycw_utilities-0.162.0.dist-info/RECORD,,
90
+ dycw_utilities-0.162.2.dist-info/METADATA,sha256=TL_z4m1KzcD0rapLtZJihbKMla6KtQoE5fvulbKJkyE,1643
91
+ dycw_utilities-0.162.2.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
92
+ dycw_utilities-0.162.2.dist-info/entry_points.txt,sha256=BOD_SoDxwsfJYOLxhrSXhHP_T7iw-HXI9f2WVkzYxvQ,135
93
+ dycw_utilities-0.162.2.dist-info/licenses/LICENSE,sha256=gppZp16M6nSVpBbUBrNL6JuYfvKwZiKgV7XoKKsHzqo,1066
94
+ dycw_utilities-0.162.2.dist-info/RECORD,,
utilities/__init__.py CHANGED
@@ -1,3 +1,3 @@
1
1
  from __future__ import annotations
2
2
 
3
- __version__ = "0.162.0"
3
+ __version__ = "0.162.2"
utilities/redis.py CHANGED
@@ -188,7 +188,7 @@ def redis_hash_map_key[K, V](
188
188
  value_serializer: Callable[[V], bytes] | None = None,
189
189
  value_deserializer: Callable[[bytes], V] | None = None,
190
190
  timeout: Delta | None = None,
191
- error: type[Exception] = TimeoutError,
191
+ error: MaybeType[BaseException] = TimeoutError,
192
192
  ttl: Delta | None = None,
193
193
  ) -> RedisHashMapKey[K, V]: ...
194
194
  @overload
@@ -203,7 +203,7 @@ def redis_hash_map_key[K, V1, V2](
203
203
  value_serializer: Callable[[V1 | V2], bytes] | None = None,
204
204
  value_deserializer: Callable[[bytes], V1 | V2] | None = None,
205
205
  timeout: Delta | None = None,
206
- error: type[Exception] = TimeoutError,
206
+ error: MaybeType[BaseException] = TimeoutError,
207
207
  ttl: Delta | None = None,
208
208
  ) -> RedisHashMapKey[K, V1 | V2]: ...
209
209
  @overload
@@ -218,7 +218,7 @@ def redis_hash_map_key[K, V1, V2, V3](
218
218
  value_serializer: Callable[[V1 | V2 | V3], bytes] | None = None,
219
219
  value_deserializer: Callable[[bytes], V1 | V2 | V3] | None = None,
220
220
  timeout: Delta | None = None,
221
- error: type[Exception] = TimeoutError,
221
+ error: MaybeType[BaseException] = TimeoutError,
222
222
  ttl: Delta | None = None,
223
223
  ) -> RedisHashMapKey[K, V1 | V2 | V3]: ...
224
224
  @overload
@@ -233,7 +233,7 @@ def redis_hash_map_key[K1, K2, V](
233
233
  value_serializer: Callable[[V], bytes] | None = None,
234
234
  value_deserializer: Callable[[bytes], V] | None = None,
235
235
  timeout: Delta | None = None,
236
- error: type[Exception] = TimeoutError,
236
+ error: MaybeType[BaseException] = TimeoutError,
237
237
  ttl: Delta | None = None,
238
238
  ) -> RedisHashMapKey[K1 | K2, V]: ...
239
239
  @overload
@@ -248,7 +248,7 @@ def redis_hash_map_key[K1, K2, V1, V2](
248
248
  value_serializer: Callable[[V1 | V2], bytes] | None = None,
249
249
  value_deserializer: Callable[[bytes], V1 | V2] | None = None,
250
250
  timeout: Delta | None = None,
251
- error: type[Exception] = TimeoutError,
251
+ error: MaybeType[BaseException] = TimeoutError,
252
252
  ttl: Delta | None = None,
253
253
  ) -> RedisHashMapKey[K1 | K2, V1 | V2]: ...
254
254
  @overload
@@ -263,7 +263,7 @@ def redis_hash_map_key[K1, K2, V1, V2, V3](
263
263
  value_serializer: Callable[[V1 | V2 | V3], bytes] | None = None,
264
264
  value_deserializer: Callable[[bytes], V1 | V2 | V3] | None = None,
265
265
  timeout: Delta | None = None,
266
- error: type[Exception] = TimeoutError,
266
+ error: MaybeType[BaseException] = TimeoutError,
267
267
  ttl: Delta | None = None,
268
268
  ) -> RedisHashMapKey[K1 | K2, V1 | V2 | V3]: ...
269
269
  @overload
@@ -278,7 +278,7 @@ def redis_hash_map_key[K1, K2, K3, V](
278
278
  value_serializer: Callable[[V], bytes] | None = None,
279
279
  value_deserializer: Callable[[bytes], V] | None = None,
280
280
  timeout: Delta | None = None,
281
- error: type[Exception] = TimeoutError,
281
+ error: MaybeType[BaseException] = TimeoutError,
282
282
  ttl: Delta | None = None,
283
283
  ) -> RedisHashMapKey[K1 | K2 | K3, V]: ...
284
284
  @overload
@@ -293,7 +293,7 @@ def redis_hash_map_key[K1, K2, K3, V1, V2](
293
293
  value_serializer: Callable[[V1 | V2], bytes] | None = None,
294
294
  value_deserializer: Callable[[bytes], V1 | V2] | None = None,
295
295
  timeout: Delta | None = None,
296
- error: type[Exception] = TimeoutError,
296
+ error: MaybeType[BaseException] = TimeoutError,
297
297
  ttl: Delta | None = None,
298
298
  ) -> RedisHashMapKey[K1 | K2 | K3, V1 | V2]: ...
299
299
  @overload
@@ -308,7 +308,7 @@ def redis_hash_map_key[K1, K2, K3, V1, V2, V3](
308
308
  value_serializer: Callable[[V1 | V2 | V3], bytes] | None = None,
309
309
  value_deserializer: Callable[[bytes], V1 | V2 | V3] | None = None,
310
310
  timeout: Delta | None = None,
311
- error: type[Exception] = TimeoutError,
311
+ error: MaybeType[BaseException] = TimeoutError,
312
312
  ttl: Delta | None = None,
313
313
  ) -> RedisHashMapKey[K1 | K2 | K3, V1 | V2 | V3]: ...
314
314
  @overload
@@ -323,7 +323,7 @@ def redis_hash_map_key[K, K1, K2, K3, V, V1, V2, V3](
323
323
  value_serializer: Callable[[V1 | V2 | V3], bytes] | None = None,
324
324
  value_deserializer: Callable[[bytes], V1 | V2 | V3] | None = None,
325
325
  timeout: Delta | None = None,
326
- error: type[Exception] = TimeoutError,
326
+ error: MaybeType[BaseException] = TimeoutError,
327
327
  ttl: Delta | None = None,
328
328
  ) -> RedisHashMapKey[K, V]: ...
329
329
  def redis_hash_map_key[K, V](
@@ -338,7 +338,7 @@ def redis_hash_map_key[K, V](
338
338
  value_deserializer: Callable[[bytes], Any] | None = None,
339
339
  timeout: Delta | None = None,
340
340
  ttl: Delta | None = None,
341
- error: type[Exception] = TimeoutError,
341
+ error: MaybeType[BaseException] = TimeoutError,
342
342
  ) -> RedisHashMapKey[K, V]:
343
343
  """Create a redis key."""
344
344
  return RedisHashMapKey( # skipif-ci-and-not-linux
@@ -426,7 +426,7 @@ def redis_key[T](
426
426
  serializer: Callable[[T], bytes] | None = None,
427
427
  deserializer: Callable[[bytes], T] | None = None,
428
428
  timeout: Delta | None = None,
429
- error: type[Exception] = TimeoutError,
429
+ error: MaybeType[BaseException] = TimeoutError,
430
430
  ttl: Delta | None = None,
431
431
  ) -> RedisKey[T]: ...
432
432
  @overload
@@ -438,7 +438,7 @@ def redis_key[T1, T2](
438
438
  serializer: Callable[[T1 | T2], bytes] | None = None,
439
439
  deserializer: Callable[[bytes], T1 | T2] | None = None,
440
440
  timeout: Delta | None = None,
441
- error: type[Exception] = TimeoutError,
441
+ error: MaybeType[BaseException] = TimeoutError,
442
442
  ttl: Delta | None = None,
443
443
  ) -> RedisKey[T1 | T2]: ...
444
444
  @overload
@@ -450,7 +450,7 @@ def redis_key[T1, T2, T3](
450
450
  serializer: Callable[[T1 | T2 | T3], bytes] | None = None,
451
451
  deserializer: Callable[[bytes], T1 | T2 | T3] | None = None,
452
452
  timeout: Delta | None = None,
453
- error: type[Exception] = TimeoutError,
453
+ error: MaybeType[BaseException] = TimeoutError,
454
454
  ttl: Delta | None = None,
455
455
  ) -> RedisKey[T1 | T2 | T3]: ...
456
456
  @overload
@@ -462,7 +462,7 @@ def redis_key[T1, T2, T3, T4](
462
462
  serializer: Callable[[T1 | T2 | T3 | T4], bytes] | None = None,
463
463
  deserializer: Callable[[bytes], T1 | T2 | T3 | T4] | None = None,
464
464
  timeout: Delta | None = None,
465
- error: type[Exception] = TimeoutError,
465
+ error: MaybeType[BaseException] = TimeoutError,
466
466
  ttl: Delta | None = None,
467
467
  ) -> RedisKey[T1 | T2 | T3 | T4]: ...
468
468
  @overload
@@ -474,7 +474,7 @@ def redis_key[T1, T2, T3, T4, T5](
474
474
  serializer: Callable[[T1 | T2 | T3 | T4 | T5], bytes] | None = None,
475
475
  deserializer: Callable[[bytes], T1 | T2 | T3 | T4 | T5] | None = None,
476
476
  timeout: Delta | None = None,
477
- error: type[Exception] = TimeoutError,
477
+ error: MaybeType[BaseException] = TimeoutError,
478
478
  ttl: Delta | None = None,
479
479
  ) -> RedisKey[T1 | T2 | T3 | T4 | T5]: ...
480
480
  @overload
@@ -486,7 +486,7 @@ def redis_key[T, T1, T2, T3, T4, T5](
486
486
  serializer: Callable[[T1 | T2 | T3 | T4 | T5], bytes] | None = None,
487
487
  deserializer: Callable[[bytes], T1 | T2 | T3 | T4 | T5] | None = None,
488
488
  timeout: Delta | None = None,
489
- error: type[Exception] = TimeoutError,
489
+ error: MaybeType[BaseException] = TimeoutError,
490
490
  ttl: Delta | None = None,
491
491
  ) -> RedisKey[T]: ...
492
492
  def redis_key[T](
@@ -497,7 +497,7 @@ def redis_key[T](
497
497
  serializer: Callable[[Any], bytes] | None = None,
498
498
  deserializer: Callable[[bytes], Any] | None = None,
499
499
  timeout: Delta | None = None,
500
- error: type[Exception] = TimeoutError,
500
+ error: MaybeType[BaseException] = TimeoutError,
501
501
  ttl: Delta | None = None,
502
502
  ) -> RedisKey[T]:
503
503
  """Create a redis key."""
utilities/sqlalchemy.py CHANGED
@@ -148,7 +148,7 @@ async def check_engine(
148
148
  /,
149
149
  *,
150
150
  timeout: Delta | None = None,
151
- error: MaybeType[Exception] = TimeoutError,
151
+ error: MaybeType[BaseException] = TimeoutError,
152
152
  num_tables: int | tuple[int, float] | None = None,
153
153
  ) -> None:
154
154
  """Check that an engine can connect.
@@ -341,7 +341,7 @@ async def ensure_tables_created(
341
341
  /,
342
342
  *tables_or_orms: TableOrORMInstOrClass,
343
343
  timeout: Delta | None = None,
344
- error: MaybeType[Exception] = TimeoutError,
344
+ error: MaybeType[BaseException] = TimeoutError,
345
345
  ) -> None:
346
346
  """Ensure a table/set of tables is/are created."""
347
347
  tables = set(map(get_table, tables_or_orms))
@@ -370,7 +370,7 @@ async def ensure_tables_dropped(
370
370
  engine: AsyncEngine,
371
371
  *tables_or_orms: TableOrORMInstOrClass,
372
372
  timeout: Delta | None = None,
373
- error: MaybeType[Exception] = TimeoutError,
373
+ error: MaybeType[BaseException] = TimeoutError,
374
374
  ) -> None:
375
375
  """Ensure a table/set of tables is/are dropped."""
376
376
  tables = set(map(get_table, tables_or_orms))
@@ -604,9 +604,9 @@ async def insert_items(
604
604
  chunk_size_frac: float = CHUNK_SIZE_FRAC,
605
605
  assume_tables_exist: bool = False,
606
606
  timeout_create: Delta | None = None,
607
- error_create: MaybeType[Exception] = TimeoutError,
607
+ error_create: MaybeType[BaseException] = TimeoutError,
608
608
  timeout_insert: Delta | None = None,
609
- error_insert: MaybeType[Exception] = TimeoutError,
609
+ error_insert: MaybeType[BaseException] = TimeoutError,
610
610
  ) -> None:
611
611
  """Insert a set of items into a database.
612
612
 
@@ -849,9 +849,9 @@ async def migrate_data(
849
849
  chunk_size_frac: float = CHUNK_SIZE_FRAC,
850
850
  assume_tables_exist: bool = False,
851
851
  timeout_create: Delta | None = None,
852
- error_create: MaybeType[Exception] = TimeoutError,
852
+ error_create: MaybeType[BaseException] = TimeoutError,
853
853
  timeout_insert: Delta | None = None,
854
- error_insert: MaybeType[Exception] = TimeoutError,
854
+ error_insert: MaybeType[BaseException] = TimeoutError,
855
855
  ) -> None:
856
856
  """Migrate the contents of a table from one database to another."""
857
857
  table_from = get_table(table_or_orm_from)