Adding sensor decorator
Added the @task.sensor decorator to convert a Python function to an instance of the BaseSensorOperator. Example usage of the decorator is:
@task.sensor(poke_interval=60, timeout=3600, mode="poke")
def f() -> PokeReturnValue:
# implement the condition
condition_met = ...
operator_return_value = ...
return PokeReturnValue(is_done=condition_met, xcom_value=operator_return_value)
closes: #20323
^ Add meaningful description above
Read the Pull Request Guidelines for more information. In case of fundamental code change, 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 UPDATING.md.
LGTM. But we need one other approve to merge it.
The PR most likely needs to run full matrix of tests because it modifies parts of the core of Airflow. However, committers might decide to merge it quickly and take the risk. If they don't merge it quickly - please rebase it to the latest main at your convenience, or amend the last commit of the PR, and push it with --force-with-lease.
Is it still in time for 2.3?
I'd say yes - but leave it up to @jedcunningham @ephraimbuddy to decide.
@ashb @jedcunningham @ephraimbuddy -> shall we add it to 2.3 ? It's a pretty requested feature and seems ready (but I leave it up to you to decide :).
Fine with me cc: @jedcunningham
No objections here 👍
Someone will need to check how this interacts with task mapping first please
I think this one is a bit risky to add for 2.3.0 so let's iterate and merge after we branch off.
Eagerly waiting for this to be merged and released!
@potiuk Is it OK to merge this PR?
@mingshi-wang - docs build is failing (that's something that you should fix first) and rebasing the change would also be useful while you do it.
Also we are waiting for @jedcunningham 's re-review - just re-requested it.
@mingshi-wang any updates? Eagerly waiting for this to be merged and released!
Rebased it to see if the Helm cheart failures were carried from another error.
Rebased it to see if the Helm cheart failures were carried from another error.
Hey @potiuk The Helm local executor still fails. Could you help me understand what could be the cause of the failure? I cannot find any useful message. Thanks!
I think this was accidental failure - simply a problem with lack of space on the machine running it I rebased it and let's see if it happens again. It might also be that we need to optimise some log handling (it looks like logs were filling the disk space. It also could be that (sometimes it happens) that the change causes some recursive behaviour that simply fills up all available disk while running (by producing continuous stream of logs) - in this case that will be a bug to be fixed by you.
(BTW. The useful message about lack of disk space was in a "cancelled" K8S executor (cancelled because of running too long while trying to work with missing space). The local one was cancelled by K8s failing (we have "fast fail" in this case). Simply GitHub UI shows such "cancelled" jobs less prominently than those that are "failing".
I think our Public runners are not big enough to handle "full tests" with k8s :( . So I removed "full tests needed" label and closed/reopened it to run a smaller set of tests
I think our Public runners are not big enough to handle "full tests" with k8s :( . So I removed "full tests needed" label and closed/reopened it to run a smaller set of tests
Thanks for your help!
HI @jedcunningham I have addressed your comments. Can you take a look again? Thanks!
Hi @potiuk will you be ok to merge this PR? I see all tests passed.
We are waiting for @jedcunningham to confirm that he is OK with it - can't merge it without it.
HI @jedcunningham can you please take a look again? Thanks!
We are waiting for @jedcunningham to confirm that he is OK with it - can't merge it without it.
Hi @potiuk, Jed seems unavailable. Is it possible to get another reviewer?
Hi @jedcunningham - do you have a chance to take a look?
Hi @uranusjr @potiuk I think I need some help merging this PR. @jedcunningham is not available to approve this PR. Would you provide some help wrapping up this PR? Thanks!
I dismissed Jed's review - can you please rebase it @mingshi-wang (there is a conflict) - sorry for long delay - I've been on holidays :).
I dismissed Jed's review - can you please rebase it @mingshi-wang (there is a conflict) - sorry for long delay - I've been on holidays :).
I rebased the PR. Could you help merge it?
Just one more check @uranusjr @jedcunningham ?
@mingshi-wang - I'd love to merge it - can you please address the last comments of @uranusjr ?
@mingshi-wang - I'd love to merge it - can you please address the last comments of @uranusjr ?
Sure will do.