Skip to content

Commit

Permalink
fix bug in schema inference of sql_alchemy backed sources
Browse files Browse the repository at this point in the history
  • Loading branch information
sh-rp committed Sep 4, 2024
1 parent d014667 commit 451b9e2
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion dlt/sources/sql_database/schema_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@ def sqla_col_to_column_schema(
"nullable": sql_col.nullable,
}
if reflection_level == "minimal":
# TODO: when we have a complex column, it should not be added to the schema as it will be
# normalized into subtables
if isinstance(sql_col.type, sqltypes.JSON):
return None
return col

sql_t = sql_col.type
Expand Down Expand Up @@ -131,7 +135,6 @@ def sqla_col_to_column_schema(
" the normalizer. In case of `pyarrow` and `pandas` backend, data types are detected"
" from numpy ndarrays. In case of other backends, the behavior is backend-specific."
)

return {key: value for key, value in col.items() if value is not None} # type: ignore[return-value]


Expand Down

0 comments on commit 451b9e2

Please sign in to comment.