Fix TriggerDagRunOperator with deferrable parameter - #30406
Merged
Conversation
pankajastro
reviewed
Apr 1, 2023
josh-fell
approved these changes
Apr 4, 2023
josh-fell
left a comment
Contributor
There was a problem hiding this comment.
Looks good to me. A small question on potentially modifying the unit tests slightly to match the desired exception message.
hussein-awala
approved these changes
Apr 4, 2023
pankajastro
approved these changes
Apr 5, 2023
dylanbstorey
requested review from
ashb,
jedcunningham and
potiuk
as code owners
April 5, 2023 12:53
TriggerDagRunOperator with deferrable parameter
Contributor
Author
hussein-awala
left a comment
Member
There was a problem hiding this comment.
This solution is based on the result of self.serialize(), I wonder if we can add a test for this method (without mocking it) to make sure that when someone change it, a test for trigger dagrun blocks him until update the code which use it. WDYT?
wookiist
pushed a commit
to wookiist/airflow
that referenced
this pull request
Apr 19, 2023
* readding after borked it * pre-commit * finally fixing after the github issue last week * push fix * feedback from hussein
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.

Fixes a bug in the
TriggerDagRunOperatorwhen operating wheredeferrable=True.The cause of the bug was a misunderstanding in which execution date was being brought through with the context + a bad mocked value in the original tests.
The suggested remedy (here) is to have the Trigger instance return a serialized version of itself and then use that to validate the exit status of the external dag.
Functional test below
