Skip to content

Commit

Permalink
database:column;models:file - format
Browse files Browse the repository at this point in the history
  • Loading branch information
MatteoCampinoti94 committed Oct 30, 2023
1 parent bff2ec9 commit 928f573
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
4 changes: 1 addition & 3 deletions acacore/database/column.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
7 changes: 4 additions & 3 deletions acacore/models/file.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit 928f573

Please sign in to comment.