Skip to content

Commit f3d67d7

Browse files
authored
Merge branch 'main' into feature/dynamic-refresh
2 parents 9ab122c + 81b9e92 commit f3d67d7

5 files changed

Lines changed: 646 additions & 526 deletions

File tree

examples/classify_single_example.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
import os
77
import sys
88
import uuid
9-
from pathlib import Path
109

10+
import anyio
1111
from dotenv import load_dotenv
1212

1313
from common_utils.image_generation import create_test_image
@@ -48,9 +48,9 @@ async def classify_single_image_example(
4848

4949
async with AthenaClient(channel, options) as client:
5050
# Load image data
51-
if image_path and Path(image_path).exists():
51+
if image_path and await anyio.Path(image_path).exists():
5252
logger.info("Loading image from: %s", image_path)
53-
image_bytes = Path(image_path).read_bytes()
53+
image_bytes = await anyio.Path(image_path).read_bytes()
5454
else:
5555
# Create a simple test image if no path provided
5656
logger.info("Creating synthetic test image")

src/resolver_athena_client/client/athena_client.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
from collections.abc import AsyncGenerator, AsyncIterable, AsyncIterator
88

99
import grpc
10+
from typing_extensions import Self
1011

1112
from resolver_athena_client.client.athena_options import AthenaOptions
1213
from resolver_athena_client.client.exceptions import AthenaError
@@ -465,7 +466,7 @@ def _raise_athena_error(self, message: str) -> None:
465466
"""Raise an AthenaError with the given message."""
466467
raise AthenaError(message)
467468

468-
async def __aenter__(self) -> "AthenaClient":
469+
async def __aenter__(self) -> Self:
469470
"""Context manager entry point."""
470471
return self
471472

src/resolver_athena_client/client/deployment_selector.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
from types import TracebackType
55

66
import grpc
7+
from typing_extensions import Self
78

89
from resolver_athena_client.generated.athena.models_pb2 import (
910
ListDeploymentsResponse,
@@ -70,7 +71,7 @@ async def list_deployments(self) -> ListDeploymentsResponse:
7071

7172
return response
7273

73-
async def __aenter__(self) -> "DeploymentSelector":
74+
async def __aenter__(self) -> Self:
7475
"""Enter the async context manager.
7576
7677
Returns

0 commit comments

Comments
 (0)