Google: Add retry-safe batch_id_prefix to DataprocCreateBatchOperator#69855
Open
amirmor1 wants to merge 2 commits into
Open
Google: Add retry-safe batch_id_prefix to DataprocCreateBatchOperator#69855amirmor1 wants to merge 2 commits into
amirmor1 wants to merge 2 commits into
Conversation
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.
Add an opt-in
batch_id_prefixtoDataprocCreateBatchOperatorso task retries can submit a new Dataproc batch with a unique ID instead of reusing a staticbatch_id.Why
When a task retries with the same
batch_id, Dataproc can returnALREADY_EXISTSand attach to the old batch. This change provides a built-in retry-safe path without changing existing explicitbatch_idbehavior.What changes
batch_id_prefixparameter<batch_id_prefix>-<unique_suffix>per task attemptbatch_idandbatch_id_prefixmutually exclusivebatch_idbehavior unchangedbatch_idTest plan
uv run ruff format providers/google/src/airflow/providers/google/cloud/operators/dataproc.py providers/google/tests/unit/google/cloud/operators/test_dataproc.pyuv run ruff check --fix providers/google/src/airflow/providers/google/cloud/operators/dataproc.py providers/google/tests/unit/google/cloud/operators/test_dataproc.pyuv run --project providers/google pytest providers/google/tests/unit/google/cloud/operators/test_dataproc.py::TestDataprocCreateBatchOperator::test_execute providers/google/tests/unit/google/cloud/operators/test_dataproc.py::TestDataprocCreateBatchOperator::test_execute_with_batch_id_prefix providers/google/tests/unit/google/cloud/operators/test_dataproc.py::TestDataprocCreateBatchOperator::test_build_unique_batch_id_from_prefix_preserves_prefix_verbatim providers/google/tests/unit/google/cloud/operators/test_dataproc.py::TestDataprocCreateBatchOperator::test_batch_id_and_batch_id_prefix_are_mutually_exclusive -xvs