kaxil commented on code in PR #64626:
URL: https://github.com/apache/airflow/pull/64626#discussion_r3029854656
##########
airflow-core/tests/unit/dag_processing/test_collection.py:
##########
@@ -182,6 +182,94 @@ def test_add_asset_trigger_references(
asset_model = session.scalars(select(AssetModel)).one()
assert len(asset_model.triggers) == expected_num_triggers
+ @pytest.mark.usefixtures("testing_dag_bundle")
+ def test_add_asset_trigger_references_hash_consistency(self, dag_maker,
session):
+ """Trigger hash from the DAG-parsed path must equal the hash computed
+ from the DB-stored Trigger row. A mismatch causes the scheduler to
+ recreate trigger rows on every heartbeat.
+ """
+ from airflow.models.trigger import Trigger
+ from airflow.serialization.encoders import encode_trigger
+ from airflow.triggers.base import BaseEventTrigger
Review Comment:
Why inline imports?
--
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]