Skip to content

Commit

Permalink
test(dag): remove unnecessary dataset alias deletion check in test ca…
Browse files Browse the repository at this point in the history
…se test_bulk_write_to_db_dataset_aliases
  • Loading branch information
Lee-W committed Jul 30, 2024
1 parent 0d83daa commit b1ee453
Showing 1 changed file with 0 additions and 19 deletions.
19 changes: 0 additions & 19 deletions tests/models/test_dag.py
Original file line number Diff line number Diff line change
Expand Up @@ -1367,25 +1367,6 @@ def test_bulk_write_to_db_dataset_aliases(self):
assert da3_orm.name == "da3"
assert len(stored_dataset_aliases) == 3

# TODO: add dataset alias clean up logic and add these tests back
# now that we have verified that a new dag has its dataset alias references recorded properly,
# we need to verify that *changes* are recorded properly.
# so if any references are *removed*, they should also be deleted from the DB
# so let's remove some references and see what happens
# dag1 = DAG(dag_id=dag_id1, start_date=DEFAULT_DATE, schedule=None)
# EmptyOperator(task_id=task_id, dag=dag1, outlets=[da3])
# dag2 = DAG(dag_id=dag_id2, start_date=DEFAULT_DATE, schedule=None)
# EmptyOperator(task_id=task_id, dag=dag2, outlets=[da1])
# DAG.bulk_write_to_db([dag1, dag2], session=session)
# session.commit()
# session.expunge_all()
# stored_dataset_aliases = {x.name: x for x in session.query(DatasetAliasModel).all()}
# da1_orm = stored_dataset_aliases[da1.name]
# da3_orm = stored_dataset_aliases[da3.name]
# assert da1_orm.name == "da1"
# assert da3_orm.name == "da3"
# assert len(stored_dataset_aliases) == 2

def test_sync_to_db(self):
dag = DAG(
"dag",
Expand Down

0 comments on commit b1ee453

Please sign in to comment.