mirror of
https://github.com/langgenius/dify.git
synced 2026-03-07 16:45:58 +08:00
feat: mypy for all type check (#10921)
This commit is contained in:
@ -1,7 +1,7 @@
|
||||
from collections.abc import Generator
|
||||
|
||||
import boto3
|
||||
from botocore.exceptions import ClientError
|
||||
import boto3 # type: ignore
|
||||
from botocore.exceptions import ClientError # type: ignore
|
||||
|
||||
from configs import dify_config
|
||||
from extensions.storage.base_storage import BaseStorage
|
||||
@ -27,7 +27,7 @@ class OracleOCIStorage(BaseStorage):
|
||||
|
||||
def load_once(self, filename: str) -> bytes:
|
||||
try:
|
||||
data = self.client.get_object(Bucket=self.bucket_name, Key=filename)["Body"].read()
|
||||
data: bytes = self.client.get_object(Bucket=self.bucket_name, Key=filename)["Body"].read()
|
||||
except ClientError as ex:
|
||||
if ex.response["Error"]["Code"] == "NoSuchKey":
|
||||
raise FileNotFoundError("File not found")
|
||||
|
||||
Reference in New Issue
Block a user