-
Notifications
You must be signed in to change notification settings - Fork 14.4k
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
feat: sensor to check status of Dataform action #43055
feat: sensor to check status of Dataform action #43055
Conversation
Congratulations on your first Pull Request and welcome to the Apache Airflow community! If you have any issues or are unsure about any anything please check our Contributors' Guide (https://github.com/apache/airflow/blob/main/contributing-docs/README.rst)
|
daafa10
to
3257f33
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Welcome to Apache Airflow and thanks for your contribution!
Looks good overall - could you please add unit tests?
3257f33
to
d66355e
Compare
Adds a new sensor to check the status of a WorkflowInvocationAction in Google Cloud Dataform. Heavily based on theDataformWorkflowInvocationStateSensor which already exists. Useful for checking the status of a specific target within a Dataform workflow invocation and taking action based on the status.
d66355e
to
5abd6b2
Compare
Hey @shahar1! Thanks for having me here. I rebased the branch to add unit tests and update it to the latest. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM :) Well done!
Awesome work, congrats on your first merged pull request! You are invited to check our Issue Tracker for additional contributions. |
Test was failing here: https://github.com/apache/airflow/actions/runs/11482958870/job/31957874656?pr=43291 ``` =========================== short test summary info ============================ FAILED tests/always/test_project_structure.py::TestProjectStructure::test_providers_modules_should_have_tests - AssertionError: Detect added tests in providers module - please remove the tests from OVERLOOKED_TESTS list above assert equals failed set() set([ 'providers/tests/google/cloud /sensors/test_dataform.py', ]) = 1 failed, 12165 passed, 9445 skipped, 2 xfailed, 5 warnings in 571.47s (0:09:31) = ``` This was because the test was added in apache#43055
Test was failing here: https://github.com/apache/airflow/actions/runs/11482958870/job/31957874656?pr=43291 ``` =========================== short test summary info ============================ FAILED tests/always/test_project_structure.py::TestProjectStructure::test_providers_modules_should_have_tests - AssertionError: Detect added tests in providers module - please remove the tests from OVERLOOKED_TESTS list above assert equals failed set() set([ 'providers/tests/google/cloud /sensors/test_dataform.py', ]) = 1 failed, 12165 passed, 9445 skipped, 2 xfailed, 5 warnings in 571.47s (0:09:31) = ``` This was because the test was added in apache#43055
Test was failing here: https://github.com/apache/airflow/actions/runs/11482958870/job/31957874656?pr=43291 ``` =========================== short test summary info ============================ FAILED tests/always/test_project_structure.py::TestProjectStructure::test_providers_modules_should_have_tests - AssertionError: Detect added tests in providers module - please remove the tests from OVERLOOKED_TESTS list above assert equals failed set() set([ 'providers/tests/google/cloud /sensors/test_dataform.py', ]) = 1 failed, 12165 passed, 9445 skipped, 2 xfailed, 5 warnings in 571.47s (0:09:31) = ``` This was because the test was added in #43055
Adds a new sensor to check the status of a WorkflowInvocationAction in Google Cloud Dataform. Heavily based on theDataformWorkflowInvocationStateSensor which already exists. Useful for checking the status of a specific target within a Dataform workflow invocation and taking action based on the status.
Test was failing here: https://github.com/apache/airflow/actions/runs/11482958870/job/31957874656?pr=43291 ``` =========================== short test summary info ============================ FAILED tests/always/test_project_structure.py::TestProjectStructure::test_providers_modules_should_have_tests - AssertionError: Detect added tests in providers module - please remove the tests from OVERLOOKED_TESTS list above assert equals failed set() set([ 'providers/tests/google/cloud /sensors/test_dataform.py', ]) = 1 failed, 12165 passed, 9445 skipped, 2 xfailed, 5 warnings in 571.47s (0:09:31) = ``` This was because the test was added in apache#43055
Adds a new sensor to check the status of a WorkflowInvocationAction in Google Cloud Dataform. Heavily based on theDataformWorkflowInvocationStateSensor which already exists. Useful for checking the status of a specific target within a Dataform workflow invocation and taking action based on the status.
Test was failing here: https://github.com/apache/airflow/actions/runs/11482958870/job/31957874656?pr=43291 ``` =========================== short test summary info ============================ FAILED tests/always/test_project_structure.py::TestProjectStructure::test_providers_modules_should_have_tests - AssertionError: Detect added tests in providers module - please remove the tests from OVERLOOKED_TESTS list above assert equals failed set() set([ 'providers/tests/google/cloud /sensors/test_dataform.py', ]) = 1 failed, 12165 passed, 9445 skipped, 2 xfailed, 5 warnings in 571.47s (0:09:31) = ``` This was because the test was added in apache#43055
Adds a new sensor to check the status of a WorkflowInvocationAction in Google Cloud Dataform. Heavily based on theDataformWorkflowInvocationStateSensor which already exists. Useful for checking the status of a specific target within a Dataform workflow invocation and taking action based on the status.
Test was failing here: https://github.com/apache/airflow/actions/runs/11482958870/job/31957874656?pr=43291 ``` =========================== short test summary info ============================ FAILED tests/always/test_project_structure.py::TestProjectStructure::test_providers_modules_should_have_tests - AssertionError: Detect added tests in providers module - please remove the tests from OVERLOOKED_TESTS list above assert equals failed set() set([ 'providers/tests/google/cloud /sensors/test_dataform.py', ]) = 1 failed, 12165 passed, 9445 skipped, 2 xfailed, 5 warnings in 571.47s (0:09:31) = ``` This was because the test was added in apache#43055
Summary
Adds a new sensor to the Google Cloud provider that waits on the status of a target in a workflow invocation.
Why might this be useful?
Right now I use Airflow to trigger a Dataform workflow on a schedule. I use the
async=True
argument on theDataformCreateWorkflowInvocationOperator
and theDataformWorkflowInvocationStateSensor
to wait until the workflow is complete before running subsequent steps. This approach is simple but comes with some tradeoffs due to its lack of granularity.The sensor added in this PR addresses the trade offs listed above by providing a more granular sensor. Instead of waiting for the workflow to complete, it waits for a target within the workflow to complete.