Skip to content

Commit

Permalink
database:column - simplify if branching
Browse files Browse the repository at this point in the history
  • Loading branch information
MatteoCampinoti94 committed Nov 2, 2023
1 parent 70f28f4 commit 1007f50
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions acacore/database/column.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,7 @@ def _schema_to_column(name: str, schema: dict, defs: Optional[dict[str, dict]] =

if schema.get("enum"):
to_entry, from_entry = lambda e: e.value, str
elif schema_type == "object":
sql_type = "text"
to_entry, from_entry = lambda o: dumps(dump_object(o), default=str), lambda o: loads(o)
elif schema_type == "array":
elif schema_type in ("object", "array"):
sql_type = "text"
to_entry, from_entry = lambda o: dumps(dump_object(o), default=str), lambda o: loads(o)
elif type_name in _sql_schema_type_converters:
Expand Down

0 comments on commit 1007f50

Please sign in to comment.