Skip to content

Commit 8aa296b

Browse files
thomasballingerConvex, Inc
authored and
Convex, Inc
committed
Updates to convex-py
GitOrigin-RevId: 28d94e27307f4e732eae26686e0c2ffed8aac08c
1 parent cc3414a commit 8aa296b

6 files changed

+5
-170
lines changed

advanced_rust_wrapper_example.py

Lines changed: 0 additions & 51 deletions
This file was deleted.

error_handling_example.py

Lines changed: 0 additions & 34 deletions
This file was deleted.

python/_convex/_convex.pyi

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,8 @@ class PyQuerySubscription:
2828

2929
class PyQuerySetSubscription:
3030
def exists(self) -> bool: ...
31-
# TODO Why is this optional?
32-
def next(self) -> Optional[Dict[Any, Any]]: ...
33-
# TODO Why is this optional?
34-
def anext(self) -> Awaitable[Optional[Dict[Any, Any]]]: ...
31+
def next(self) -> Dict[Any, Any]: ...
32+
def anext(self) -> Awaitable[Dict[Any, Any]]: ...
3533

3634
class PyConvexClient:
3735
def __new__(cls, deployment_url: str) -> "PyConvexClient": ...

python/convex/__init__.py

Lines changed: 3 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -123,15 +123,6 @@ def __next__(self) -> ConvexValue:
123123
raise ConvexError(result["message"], result["data"])
124124
return result["value"]
125125

126-
def __aiter__(self) -> QuerySubscription:
127-
return self
128-
129-
async def __anext__(self) -> ConvexValue:
130-
result = await self.safe_inner_sub().anext()
131-
if result["type"] == "convexerror":
132-
raise ConvexError(result["message"], result["data"])
133-
return result["value"]
134-
135126
def unsubscribe(self) -> None:
136127
"""Unsubscribe from the query and drop this subscription from the active query set.
137128
@@ -174,17 +165,6 @@ def __next__(self) -> Optional[Dict[SubscriberId, ConvexValue]]:
174165
result[k] = result[k]
175166
return result
176167

177-
def __aiter__(self) -> QuerySetSubscription:
178-
return self
179-
180-
async def __anext__(self) -> Optional[Dict[SubscriberId, ConvexValue]]:
181-
result = await self.safe_inner_sub().anext()
182-
if not result:
183-
return result
184-
for k in result:
185-
result[k] = result[k]
186-
return result
187-
188168

189169
class ConvexClient:
190170
"""WebSocket-based Convex Client.
@@ -193,9 +173,9 @@ class ConvexClient:
193173
queries/mutations/actions and manage query subscriptions.
194174
"""
195175

196-
# This client wraps PyConvexClient, implementing
197-
# - implements additional type convertions (e.g. tuples to arrays)
198-
# - makes arguments dicts optional
176+
# This client wraps PyConvexClient by
177+
# - implementing additional type convertions (e.g. tuples to arrays)
178+
# - making arguments dicts optional
199179

200180
def __init__(self, deployment_url: str):
201181
"""Construct a WebSocket-based client given the URL of a Convex deployment."""

rust_wrapper_example.py

Lines changed: 0 additions & 6 deletions
This file was deleted.

subscription_example.py

Lines changed: 0 additions & 52 deletions
This file was deleted.

0 commit comments

Comments
 (0)