You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "namanjain24-sudo (via GitHub)" <gi...@apache.org> on 2026/09/18 18:43:49 UTC
[PR] Allow DataflowJobStatusSensor to wait on a job name [airflow]
namanjain24-sudo opened a new pull request, #73356:
URL: https://github.com/apache/airflow/pull/73356
`DataflowJobStatusSensor` and `DataflowJobStatusTrigger` can only watch a job by id. When the job is launched outside the Dag, as in #72875 where it is started from a Cloud Run job, the id is never available downstream. This adds a `job_name` parameter to both, mutually exclusive with `job_id`.
How a name is resolved:
- Dataflow job names are not unique over time, so the new `DataflowHook.get_latest_job_by_name` and its async counterpart match the name exactly and return the most recent job with that name, as the issue proposes. This is deliberately not the prefix match that `DataflowStopJobOperator.job_name_prefix` does.
- The match happens client side, the same way `_fetch_jobs_by_prefix_name` in this hook already works. Newer API clients do accept a `name` argument on `jobs.list`, but the minimum versions this provider supports do not: `google-api-python-client` 2.0.2's bundled discovery document and `ListJobsRequest` in `google-cloud-dataflow-client` 0.8.6 have no such field. Switching to the server-side filter would need both floors raised, and I can do that here or as a follow-up if preferred.
- `jobs.list` only promises the summary view, which documents a start time but not a create time. So the ordering key is `createTime`, then `startTime`, then the job that is not in a terminal state (only one active job per name can exist in a project and region). Ordering by `createTime` alone made the sync path return whichever job the API listed first, and made the async path raise `TypeError` comparing two unset timestamps. Both cases have tests.
- While no job with the name exists yet, the sensor keeps poking and the trigger keeps polling, so the Dag can start waiting before the job is created. A finished job from an earlier run with the same name also counts, so the docs suggest making reused names unique per run, e.g. `daily-etl-{{ ds_nodash }}`.
Compatibility: `job_name` is appended last in the trigger signature, so existing positional calls keep working, and a serialized trigger from before this change (no `job_name` key) still deserializes. Log messages and the terminal-state error now report the id of the job that was actually resolved.
Tests:
- 24 new tests across the hook, sensor and trigger. With the three source files reverted to main, every one of them fails or errors.
- The Dataflow hook, sensor, trigger and operator tests (284 passed) and the Google sensors and triggers suites (607 passed, 6 skipped) pass locally on current main. mypy is clean on the three changed modules, and the templated-fields check passes.
closes: #72875
---
##### Was generative AI tooling used to co-author this PR?
- [X] Yes (please specify the tool below)
Generated-by: a Gen-AI coding assistant, following [the guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions). I reviewed the change and ran the checks above.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Allow DataflowJobStatusSensor to wait on a job name [airflow]
Posted by "potiuk (via GitHub)" <gi...@apache.org>.
potiuk closed pull request #73356: Allow DataflowJobStatusSensor to wait on a job name
URL: https://github.com/apache/airflow/pull/73356
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Allow DataflowJobStatusSensor to wait on a job name [airflow]
Posted by "potiuk (via GitHub)" <gi...@apache.org>.
potiuk commented on PR #73356:
URL: https://github.com/apache/airflow/pull/73356#issuecomment-5839397127
Hello @namanjain24-sudo - thank you for your contributions to Apache Airflow!
The Airflow community has introduced a limit of **5 open pull requests at a time** for contributors without write access to the repository. You currently have 7 open pull requests, so - as a one-time step of introducing the limit - we closed the ones where maintainers have not engaged yet:
* #73129 - Lower cross-provider dependencies in provider lowest-deps tests
* #73172 - Skip executor validation when a worker parses a Dag
* #73213 - Pass the scheduler's session to set_state when processing executor events
* #73356 - Allow DataflowJobStatusSensor to wait on a job name
* #73375 - Reset a mapped task's state store when its expansion is recomputed
* #73395 - Fail a task whose execute is interrupted by SIGTERM
These pull requests stay open because maintainers are already engaged in them - they count towards your limit:
* #73104 - Stop rebuilding the FAB app on every users and roles API call
This is **not** a judgement of you or of your changes. We never told contributors before that opening many pull requests at once was a problem, so there is nothing to feel bad about - and nothing is lost: your branches, commits and the review history stay where they are.
What we ask you to do is to make your **first prioritization decision**: choose which of the pull requests above matter most to you, and reopen them (up to 5 open at a time, including the ones still open) with the "Reopen pull request" button or `gh pr reopen <PR_NUMBER> --repo apache/airflow`. Reopen the ones you are ready to follow through - keep them rebased, respond to review comments and fix failing checks.
While your pull requests are waiting for review, the most valuable thing you can do is help in other ways - reviewing other contributors' pull requests, helping with issues, and taking part in the discussions on the devlist and Slack.
Why we introduced the limit, what it means for you and how to reopen or restore a pull request is explained in https://github.com/apache/airflow/blob/main/contributing-docs/32_open_pull_request_limit.rst.
---
Drafted-by: Claude Code (Opus 5); reviewed by @potiuk before posting
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org