Skip to content

Commit

Permalink
Fix sqlalchemy 2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
steinitzu committed Oct 2, 2024
1 parent b8a3845 commit 1757044
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions dlt/destinations/impl/sqlalchemy/merge_job.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def gen_merge_sql(
if len(table_chain) == 1 and not cls.requires_temp_table_for_delete():
delete_statement = root_table_obj.delete().where(
sa.exists(
sa.select([sa.literal(1)])
sa.select(sa.literal(1))
.where(key_clause)
.select_from(staging_root_table_obj)
)
Expand All @@ -81,9 +81,9 @@ def gen_merge_sql(
# Insert data into the "temporary" table
insert_statement = delete_temp_table.insert().from_select(
[row_key_col],
sa.select([row_key_col]).where(
sa.select(row_key_col).where(
sa.exists(
sa.select([sa.literal(1)])
sa.select(sa.literal(1))
.where(key_clause)
.select_from(staging_root_table_obj)
)
Expand Down Expand Up @@ -370,7 +370,7 @@ def gen_scd2_sql(
update_statement = (
root_table_obj.update()
.values({to: sa.text(boundary_literal)})
.where(root_table_obj.c[hash_].notin_(sa.select([staging_root_table_obj.c[hash_]])))
.where(root_table_obj.c[hash_].notin_(sa.select(staging_root_table_obj.c[hash_])))
)

if active_record_timestamp is None:
Expand Down Expand Up @@ -407,7 +407,7 @@ def gen_scd2_sql(
*[c for c in staging_root_table_obj.columns if c.name not in [from_, to]],
).where(
staging_root_table_obj.c[hash_].notin_(
sa.select([root_table_obj.c[hash_]]).where(root_is_active_clause)
sa.select(root_table_obj.c[hash_]).where(root_is_active_clause)
)
),
)
Expand Down

0 comments on commit 1757044

Please sign in to comment.