latch-postgres 0.1.20__py3-none-any.whl → 0.1.21__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,7 +1,7 @@
1
1
  import asyncio
2
2
  import functools
3
3
  import random
4
- from collections.abc import AsyncGenerator, Awaitable, Callable, Iterable
4
+ from collections.abc import AsyncGenerator, Awaitable, Callable, Coroutine, Iterable
5
5
  from contextlib import asynccontextmanager
6
6
  from dataclasses import dataclass
7
7
  from datetime import timedelta
@@ -52,6 +52,8 @@ from typing_extensions import Self
52
52
 
53
53
  from latch_postgres.retries import CABackoff
54
54
 
55
+ YT = TypeVar("YT")
56
+ ST = TypeVar("ST")
55
57
  T = TypeVar("T")
56
58
 
57
59
  tracer = get_tracer(__name__)
@@ -455,10 +457,10 @@ def pg_error_to_dict(x: PGError, *, short: bool = False):
455
457
 
456
458
 
457
459
  def with_conn_retry(
458
- f: Callable[Concatenate[LatchAsyncConnection[Any], P], Awaitable[T]],
460
+ f: Callable[Concatenate[LatchAsyncConnection[Any], P], Coroutine[YT, ST, T]],
459
461
  pool: AsyncConnectionPool,
460
462
  db_config: PostgresConnectionConfig,
461
- ) -> Callable[P, Awaitable[T]]:
463
+ ) -> Callable[P, Coroutine[YT, ST, T]]:
462
464
  @functools.wraps(f)
463
465
  async def inner(*args: P.args, **kwargs: P.kwargs):
464
466
  with tracer.start_as_current_span("database session") as s:
@@ -585,8 +587,8 @@ def with_conn_retry(
585
587
  def get_with_conn_retry(
586
588
  pool: AsyncConnectionPool, db_config: PostgresConnectionConfig
587
589
  ) -> Callable[
588
- [Callable[Concatenate[LatchAsyncConnection[Any], P], Awaitable[T]]],
589
- Callable[P, Awaitable[T]],
590
+ [Callable[Concatenate[LatchAsyncConnection[Any], P], Coroutine[YT, ST, T]]],
591
+ Callable[P, Coroutine[YT, ST, T]],
590
592
  ]:
591
593
  return functools.partial(with_conn_retry, pool=pool, db_config=db_config)
592
594
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: latch-postgres
3
- Version: 0.1.20
3
+ Version: 0.1.21
4
4
  Summary: Postges wrapper for latch python backend services
5
5
  Author-email: maximsmol <max@latch.bio>
6
6
  License: CC0-1.0
@@ -0,0 +1,8 @@
1
+ latch_postgres/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
+ latch_postgres/postgres.py,sha256=-TpNtSGe-EKy-hKOhajkriqbYkKvYV3LegDqx3towJ8,24522
3
+ latch_postgres/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
+ latch_postgres/retries.py,sha256=r5yH00fd_6EJNYFXAq3dAljJBphScpoeST-_oMvyj8Q,1308
5
+ latch_postgres-0.1.21.dist-info/METADATA,sha256=12J7_YVLtpW3MbfvEYAxbP2VAK36ZSjHD7a5vTli-jY,607
6
+ latch_postgres-0.1.21.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
7
+ latch_postgres-0.1.21.dist-info/licenses/LICENSE,sha256=wh3JZu6ITG7ceN-1g404ekupj5JXAw4pnQ_Qr4sJfew,7052
8
+ latch_postgres-0.1.21.dist-info/RECORD,,
@@ -1,8 +0,0 @@
1
- latch_postgres/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
- latch_postgres/postgres.py,sha256=EtrOpQN7VO1_dFFY_Gpivrv9p47mS-YGWh_NCYoy2L4,24441
3
- latch_postgres/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
- latch_postgres/retries.py,sha256=r5yH00fd_6EJNYFXAq3dAljJBphScpoeST-_oMvyj8Q,1308
5
- latch_postgres-0.1.20.dist-info/METADATA,sha256=B3RxN3paL3WpYQV6XLpThnVmgKZUD5a4Jd0perGWag4,607
6
- latch_postgres-0.1.20.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
7
- latch_postgres-0.1.20.dist-info/licenses/LICENSE,sha256=wh3JZu6ITG7ceN-1g404ekupj5JXAw4pnQ_Qr4sJfew,7052
8
- latch_postgres-0.1.20.dist-info/RECORD,,