Skip to content

Commit

Permalink
Fix table as boolean
Browse files Browse the repository at this point in the history
  • Loading branch information
steinitzu committed Oct 4, 2024
1 parent e5bdb5c commit f9c0c75
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions dlt/sources/sql_database/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,9 +194,10 @@ def sql_table(
skip_nested_on_minimal = backend == "sqlalchemy"
# Table object is only created when reflecting, we don't want empty tables in metadata
# as it breaks foreign key resolution
table_obj: Optional[Table] = metadata.tables.get(table) or (
Table(table, metadata, autoload_with=engine) if not defer_table_reflect else None
)
table_obj = metadata.tables.get(table)
if table_obj is None and not defer_table_reflect:
table_obj = Table(table, metadata, autoload_with=engine)

if table_obj is not None:
if not defer_table_reflect:
default_table_adapter(table_obj, included_columns)
Expand Down

0 comments on commit f9c0c75

Please sign in to comment.