diff --git a/acacore/database/column.py b/acacore/database/column.py index 0ab5b5a..eb397c5 100644 --- a/acacore/database/column.py +++ b/acacore/database/column.py @@ -68,9 +68,7 @@ def _schema_to_column(name: str, schema: dict, defs: Optional[dict[str, dict]] = else: raise TypeError(f"Cannot recognize type from schema {schema!r}") elif schema_any_of: - if not schema_any_of[0]: - sql_type, to_entry, from_entry = "text", lambda x: dumps(x, default=str), lambda x: loads(x) - elif len(schema_any_of) > 2: + if not schema_any_of[0] or len(schema_any_of) > 2: sql_type, to_entry, from_entry = "text", lambda x: dumps(x, default=str), lambda x: loads(x) else: return _schema_to_column(name, {**schema_any_of[0], **schema}, defs) diff --git a/acacore/models/file.py b/acacore/models/file.py index a23ccf2..eb2fee5 100644 --- a/acacore/models/file.py +++ b/acacore/models/file.py @@ -7,18 +7,19 @@ from typing import Optional from typing import Union -from pydantic import Field from pydantic import UUID4 +from pydantic import Field from typing_extensions import TypedDict from acacore.models.reference_files import CustomSignature from acacore.siegfried.siegfried import Siegfried from acacore.siegfried.siegfried import SiegfriedFile from acacore.utils.functions import file_checksum +from acacore.utils.functions import get_bof +from acacore.utils.functions import get_eof + from .base import ACABase from .identification import Identification -from ..utils.functions import get_bof -from ..utils.functions import get_eof class ActionConvert(TypedDict):