Skip to content

Commit 13fcf75

Browse files
committed
fix: use string annotations for S3Client type hints
Remove future annotations import and use quoted string annotations for S3Client to avoid import issues. Changes: o Remove __future__ annotations import o Use "S3Client" string annotations in type hints Signed-off-by: Derek Higgins <[email protected]>
1 parent a7c7c72 commit 13fcf75

File tree

1 file changed

+3
-5
lines changed
  • src/llama_stack/providers/remote/files/s3

1 file changed

+3
-5
lines changed

src/llama_stack/providers/remote/files/s3/files.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
# This source code is licensed under the terms described in the LICENSE file in
55
# the root directory of this source tree.
66

7-
from __future__ import annotations
8-
97
import uuid
108
from datetime import UTC, datetime
119
from typing import TYPE_CHECKING, Annotated, Any, cast
@@ -39,7 +37,7 @@
3937
# TODO: provider data for S3 credentials
4038

4139

42-
def _create_s3_client(config: S3FilesImplConfig) -> S3Client:
40+
def _create_s3_client(config: S3FilesImplConfig) -> "S3Client":
4341
try:
4442
s3_config = {
4543
"region_name": config.region,
@@ -66,7 +64,7 @@ def _create_s3_client(config: S3FilesImplConfig) -> S3Client:
6664
raise RuntimeError(f"Failed to initialize S3 client: {e}") from e
6765

6866

69-
async def _create_bucket_if_not_exists(client: S3Client, config: S3FilesImplConfig) -> None:
67+
async def _create_bucket_if_not_exists(client: "S3Client", config: S3FilesImplConfig) -> None:
7068
try:
7169
client.head_bucket(Bucket=config.bucket_name)
7270
except ClientError as e:
@@ -192,7 +190,7 @@ async def shutdown(self) -> None:
192190
pass
193191

194192
@property
195-
def client(self) -> S3Client:
193+
def client(self) -> "S3Client":
196194
assert self._client is not None, "Provider not initialized"
197195
return self._client
198196

0 commit comments

Comments
 (0)