Lee-W commented on code in PR #50182:
URL: https://github.com/apache/airflow/pull/50182#discussion_r2131368876
##########
airflow-core/tests/unit/jobs/test_scheduler_job.py:
##########
@@ -3995,6 +4001,82 @@ def dict_from_obj(obj):
assert created_run.creating_job_id == scheduler_job.id
+ @pytest.mark.need_serialized_dag
+ def test_create_dag_runs_asset_alias_with_asset_event_attached(self,
session, dag_maker):
+ """
+ Test DAG Run trigger on AssetAlias includes the corresponding
AssetEvent in `consumed_asset_events`.
Review Comment:
```suggestion
Test Dag Run trigger on AssetAlias includes the corresponding
AssetEvent in `consumed_asset_events`.
```
nit
##########
airflow-core/tests/unit/jobs/test_scheduler_job.py:
##########
@@ -3995,6 +4001,82 @@ def dict_from_obj(obj):
assert created_run.creating_job_id == scheduler_job.id
+ @pytest.mark.need_serialized_dag
+ def test_create_dag_runs_asset_alias_with_asset_event_attached(self,
session, dag_maker):
+ """
+ Test DAG Run trigger on AssetAlias includes the corresponding
AssetEvent in `consumed_asset_events`.
+ """
+
+ # Simulate an Asset created at runtime, and it is not an active asset
+ asset1 = Asset(uri="test://asset1", name="test_asset",
group="test_group")
+ # Create an AssetAlias, and the Asset will be attached to this
AssetAlias
+ asset_alias = AssetAlias(name="test_asset_alias_with_asset_event",
group="test_group")
+
+ # Add it to the DB so the event can be created from this Asset
+ asm = AssetModel(name=asset1.name, uri=asset1.uri, group=asset1.group)
+ session.add(asm)
+
+ asam = AssetAliasModel(name=asset_alias.name, group=asset_alias.group)
+
+ # Simulate a Producer DAG attach an asset event at runtime to an
AssetAlias
Review Comment:
```suggestion
# Simulate a Producer dag attach an asset event at runtime to an
AssetAlias
```
--
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]