-
Notifications
You must be signed in to change notification settings - Fork 14.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add default_deferrable config #31712
Add default_deferrable config #31712
Conversation
d7d0c7d
to
72b0b2e
Compare
CC @syedahsn |
2da9cd3
to
c2bb2e7
Compare
Why is this needed? I think most operators have |
Because these operators already have their default value as Take GlueCrawlerOperator as an example, if users call the op through op = GlueCrawlerOperator(
config,
"default",
None,
5,
True,
True
) this might not work. |
I noticed the CI failure might not be related to this PR, and other PRs have similar errors. Wondering is this something I need to fix in this PR? Thanks
|
i've seen this too. i think main is broken |
Fixed in #31766 - it was caused by a (security) fix - backwards incompatible in Python 3.8.17 and 3.9.17 released last night. Very rare case to hit. |
You can rebase. |
c2bb2e7
to
b65f66e
Compare
…ialization to False
This reverts commit c38c84921ef240abe073fd38251a4aef570fcabf.
…r docstring" This reverts commit 128ef7fe3bbabbc75769339c00d7842486c08146.
…lse captialization to False" This reverts commit adaf5ca52eda4f8a7303dabd150c6a97839a53a9.
…to False for waiter and hooks" This reverts commit bdac07b635b96ad1d6ebd2113512fb953d622a80.
This reverts commit 0129a0e9606c5e85bf6939386ce910b636b721e9.
…deferrable attribute in BaseDeferrableOperator is the same as DEFAULT_DEFERRABLE" This reverts commit bb6ca2105659cd6a5107e2913599655f491e6de8.
…eDeferrableOperator with empty execute method implementation" This reverts commit a2d358f9bd20d3c010d1fa8efdcb7d2bfd546e42.
…o baseoperator" This reverts commit 3f8c72e27496bb87abb3fa7a6715c63fd3acb2ea.
…ferrableOperator" This reverts commit 9f85338a4eb49289e896f5844fd0d67897dafbd5.
…r for TriggerDagRunOperator" This reverts commit 838fa28e7888937169d938143ee57fbafa41abf8.
…erator as the default value of deferabl" This reverts commit a17afa02e5b6fd9bf4046be4188e229e12c72060.
…or class for operator with deferrable attribute and load this value from config" This reverts commit 26404c231d55efe4466090a29a37a6e85316d690.
…e", fallback=False)" as the default deferrable value
03415b8
to
b9f870e
Compare
Conflict resolved |
What's changed
deferrable
attribute to base operatorDEFAULT_DEFERRABLE
for toggling deferrable mode globallydeferrable
attribute in existing operators toDEFAULT_DEFERRABLE
Why
Many operators [1][2] can run in deferrable mode by setting
deferrable
attribute to true. Therefore, we suggest adding this attribute to the base operator. Additionally, we want to enable users to easily activate the deferrable mode for all tasks. To achieve this, we introduce theDEFAULT_DEFERRABLE
configuration, which can be loaded fromoperators.default_deferrable
in airflow.cfg or set through the environment variableAIRFLOW__OPERATORS__DEFAULT_DERFERRABLE
. The default value is set to false to maintain the original behavior.Backward compatibility
For users not using the latest airflow (which have
DEFAULT_DEFERRABLE
inairflow.models.abstractoperator
), the following code is used.Another solution I'm thinking of is
[1] List of operators with deferrable attribute
[2] List of pull requests that introduce deferrable mode to existing operators
BeamRunPythonPipelineOperator
#31471deferrable
param inEmrContainerSensor
#30945BatchSensor
#30279cc @dstandish
^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragment file, named
{pr_number}.significant.rst
or{issue_number}.significant.rst
, in newsfragments.