Update return schema of query interface (#492)

* Update return model of query interface

* Update tree data return type hints

* Update code generation and task return types

* Fix inconsistency between ORM query result and schema
This commit is contained in:
Wu Clan
2025-01-18 23:33:37 +08:00
committed by GitHub
parent cf693cdce6
commit 7553ccf14d
55 changed files with 257 additions and 234 deletions
+2 -2
View File
@@ -30,7 +30,7 @@ def select_columns_serialize(row: R) -> dict:
return result
def select_list_serialize(row: Sequence[R]) -> list:
def select_list_serialize(row: Sequence[R]) -> list[dict[str, Any]]:
"""
Serialize SQLAlchemy select list
@@ -59,7 +59,7 @@ def select_as_dict(row: R, use_alias: bool = False) -> dict:
del result['_sa_instance_state']
else:
result = {}
mapper = class_mapper(row.__class__)
mapper = class_mapper(row.__class__) # type: ignore
for prop in mapper.iterate_properties:
if isinstance(prop, (ColumnProperty, SynonymProperty)):
key = prop.key