Skip to content

Commit

Permalink
Merge pull request #60 from astronomer/old_sqlalchemy
Browse files Browse the repository at this point in the history
DAG History Migration - Compatability for sqlalchemy 1.4 and 2.0
  • Loading branch information
fritz-astronomer authored Oct 17, 2023
2 parents e27215f + de68415 commit dd9d85f
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions astronomer_starship/starship/services/local_airflow_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,8 @@ def receive_dag(session: Session, data: list = None):
except NoSuchTableError:
table = Table(table_name, metadata_obj, autoload_with=engine)

with engine.connect() as connection:
connection.execute(insert(table).on_conflict_do_nothing(), data_list)
connection.commit()
with engine.begin() as txn:
txn.execute(insert(table).on_conflict_do_nothing(), data_list)


@provide_session
Expand Down

0 comments on commit dd9d85f

Please sign in to comment.