Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions examples/classify_single_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
import os
import sys
import uuid
from pathlib import Path

import anyio
from dotenv import load_dotenv

from common_utils.image_generation import create_test_image
Expand Down Expand Up @@ -48,9 +48,9 @@ async def classify_single_image_example(

async with AthenaClient(channel, options) as client:
# Load image data
if image_path and Path(image_path).exists():
if image_path and await anyio.Path(image_path).exists():
logger.info("Loading image from: %s", image_path)
image_bytes = Path(image_path).read_bytes()
image_bytes = await anyio.Path(image_path).read_bytes()
else:
# Create a simple test image if no path provided
logger.info("Creating synthetic test image")
Expand Down
3 changes: 2 additions & 1 deletion src/resolver_athena_client/client/athena_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from collections.abc import AsyncGenerator, AsyncIterable, AsyncIterator

import grpc
from typing_extensions import Self

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

async def __aenter__(self) -> "AthenaClient":
async def __aenter__(self) -> Self:
"""Context manager entry point."""
return self

Expand Down
3 changes: 2 additions & 1 deletion src/resolver_athena_client/client/deployment_selector.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from types import TracebackType

import grpc
from typing_extensions import Self

from resolver_athena_client.generated.athena.models_pb2 import (
ListDeploymentsResponse,
Expand Down Expand Up @@ -70,7 +71,7 @@ async def list_deployments(self) -> ListDeploymentsResponse:

return response

async def __aenter__(self) -> "DeploymentSelector":
async def __aenter__(self) -> Self:
"""Enter the async context manager.

Returns
Expand Down
Loading