feat: mypy for all type check (#10921)
This commit is contained in:
parent
c91e8b1737
commit
56e15d09a9
584 changed files with 3975 additions and 2826 deletions
|
|
@ -1,9 +1,9 @@
|
|||
import logging
|
||||
from collections.abc import Generator
|
||||
|
||||
import boto3
|
||||
from botocore.client import Config
|
||||
from botocore.exceptions import ClientError
|
||||
import boto3 # type: ignore
|
||||
from botocore.client import Config # type: ignore
|
||||
from botocore.exceptions import ClientError # type: ignore
|
||||
|
||||
from configs import dify_config
|
||||
from extensions.storage.base_storage import BaseStorage
|
||||
|
|
@ -53,7 +53,7 @@ class AwsS3Storage(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")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue