Skip to content

Commit

Permalink
fix column-property (#250)
Browse files Browse the repository at this point in the history
  • Loading branch information
zhPavel committed Mar 5, 2024
1 parent 14dd5ba commit f242839
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/changelog/fragments/250.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix introspection of sqlalchemy models with column_property (all ColumnElement is ignored excepting Column itself)
4 changes: 4 additions & 0 deletions src/adaptix/_internal/model_tools/introspection/sqlalchemy.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,9 @@ def _get_input_shape(
fields = []
params = []
for column in columns:
if not isinstance(column, sqlalchemy.Column):
continue

fields.append(
InputField(
id=column.key,
Expand Down Expand Up @@ -197,6 +200,7 @@ def _get_output_shape(
accessor=create_attr_accessor(column.name, is_required=True),
)
for column in columns
if isinstance(column, sqlalchemy.Column)
]
for relationship in relationships:
if relationship.collection_class is not None:
Expand Down

0 comments on commit f242839

Please sign in to comment.