Skip to content

Commit 238012e

Browse files
committed
Fix patching
1 parent 4c07b45 commit 238012e

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

src/truefoundry_sdk/_wrapped_clients.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,17 +28,18 @@
2828
from pydantic import BaseModel
2929

3030
T = TypeVar("T", bound=BaseModel)
31+
R = TypeVar("R", bound=BaseModel)
3132

3233

33-
class HasListMethod(Protocol[T]):
34-
def list(self, *, fqn: str, limit: Optional[int] = None, **kwargs: Any) -> SyncPager[T]: ...
34+
class HasListMethod(Protocol[T, R]):
35+
def list(self, *, fqn: str, limit: Optional[int] = None, **kwargs: Any) -> SyncPager[T, R]: ...
3536

3637

37-
class HasAsyncListMethod(Protocol[T]):
38-
async def list(self, *, fqn: str, limit: Optional[int] = None, **kwargs) -> AsyncPager[T]: ...
38+
class HasAsyncListMethod(Protocol[T, R]):
39+
async def list(self, *, fqn: str, limit: Optional[int] = None, **kwargs) -> AsyncPager[T, R]: ...
3940

4041

41-
def _get_by_fqn(client: HasListMethod[T], *, fqn: str, request_options: Optional[RequestOptions] = None) -> T:
42+
def _get_by_fqn(client: HasListMethod[T, R], *, fqn: str, request_options: Optional[RequestOptions] = None) -> T:
4243
result = None
4344
for item in client.list(fqn=fqn, limit=1, request_options=request_options):
4445
result = item
@@ -54,7 +55,7 @@ def _get_by_fqn(client: HasListMethod[T], *, fqn: str, request_options: Optional
5455

5556

5657
async def _aget_by_fqn(
57-
client: HasAsyncListMethod[T], *, fqn: str, request_options: Optional[RequestOptions] = None
58+
client: HasAsyncListMethod[T, R], *, fqn: str, request_options: Optional[RequestOptions] = None
5859
) -> T:
5960
result = None
6061
pager = await client.list(fqn=fqn, limit=1, request_options=request_options)

0 commit comments

Comments
 (0)