chore(lint): make ruff happy
This commit is contained in:
@@ -3,9 +3,17 @@ from __future__ import annotations
|
||||
from enum import Enum
|
||||
from typing import Annotated, Any
|
||||
|
||||
from pydantic import AliasChoices, Field, HttpUrl, ValidationInfo, field_validator, BeforeValidator
|
||||
from pydantic import (
|
||||
AliasChoices,
|
||||
BeforeValidator,
|
||||
Field,
|
||||
HttpUrl,
|
||||
ValidationInfo,
|
||||
field_validator,
|
||||
)
|
||||
from pydantic_settings import BaseSettings, NoDecode, SettingsConfigDict
|
||||
|
||||
|
||||
def _parse_list(v):
|
||||
if v is None or v == "" or str(v).strip() in ("[]", "{}"):
|
||||
return []
|
||||
@@ -14,6 +22,7 @@ def _parse_list(v):
|
||||
s = str(v).strip()
|
||||
try:
|
||||
import json
|
||||
|
||||
parsed = json.loads(s)
|
||||
if isinstance(parsed, list):
|
||||
return parsed
|
||||
@@ -21,6 +30,7 @@ def _parse_list(v):
|
||||
pass
|
||||
return [x.strip() for x in s.split(",") if x.strip()]
|
||||
|
||||
|
||||
class AWSS3StorageSettings(BaseSettings):
|
||||
s3_access_key_id: str
|
||||
s3_secret_access_key: str
|
||||
|
||||
Reference in New Issue
Block a user