Fix asset watcher triggers deleted on every dag-parsing loop#64625
Closed
vatsrahul1001 wants to merge 1 commit intomainfrom
Closed
Fix asset watcher triggers deleted on every dag-parsing loop#64625vatsrahul1001 wants to merge 1 commit intomainfrom
vatsrahul1001 wants to merge 1 commit intomainfrom
Conversation
uranusjr
reviewed
Apr 2, 2026
Contributor
uranusjr
reviewed
Apr 2, 2026
12d8ca2 to
55960a6
Compare
kaxil
reviewed
Apr 2, 2026
55960a6 to
6ac4d7a
Compare
6ac4d7a to
3f10aad
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Summary
Fix asset watcher triggers being deleted and recreated on every dag-parsing loop.
encode_triggerwraps kwargs withBaseSerialization.serialize()(e.g.,tuple()becomes{"__type": "tuple", "__var": []}), which is correct for JSON-serializable DAG definitions.However,
add_asset_trigger_referencesneeds raw Python kwargs becauseTrigger._decrypt_kwargsreturns native Python objects from the DB. This mismatch caused
BaseEventTrigger.hash()toproduce different hashes for the same logical trigger, resulting in an infinite delete/recreate
cycle every parsing loop.
Replace
encode_triggerwith_get_raw_trigger_kwargsthat unwraps any BaseSerialization-encodedvalues back to native Python objects, ensuring hash consistency between DAG-defined and DB-stored
triggers.
encode_triggerremains in use where it belongs — DAG serialization for JSON storage.Claude
{pr_number}.significant.rst, in airflow-core/newsfragments. You can add this file in a follow-up commit after the PR is created so you know the PR number.