dstandish commented on code in PR #24908:
URL: https://github.com/apache/airflow/pull/24908#discussion_r917271875
##########
tests/models/test_taskinstance.py:
##########
@@ -1499,10 +1499,25 @@ def test_outlet_datasets(self, create_task_instance):
ti._run_raw_task()
ti.refresh_from_db()
assert ti.state == State.SUCCESS
+
+ # check that one queue record created for each dag that depends on
dataset 1
assert session.query(DatasetDagRunQueue.target_dag_id).filter(
DatasetTaskRef.dag_id == dag1.dag_id, DatasetTaskRef.task_id ==
'upstream_task_1'
).all() == [('dag3',), ('dag4',), ('dag5',)]
+ # check that one event record created for dataset1 and this TI
+ assert session.query(Dataset.uri).join(DatasetEvent.dataset).filter(
+ DatasetEvent.source_task_instance == ti
+ ).one() == ('s3://dag1/output_1.txt',)
+
+ # check that no other dataset events recorded
+ assert (
+ session.query(Dataset.uri)
+ .join(DatasetEvent.dataset)
+ .filter(DatasetEvent.source_task_instance == ti)
+ .count()
+ ) == 1
Review Comment:
excellent -- thank you
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]