Skip to content

Wire DataflowConfiguration.max_num_workers into pipeline options - #73922

Open
garvit-arora wants to merge 3 commits into
apache:mainfrom
garvit-arora:fix/72982-dataflow-max-num-workers
Open

garvit-arora wants to merge 3 commits into
apache:mainfrom
garvit-arora:fix/72982-dataflow-max-num-workers

Conversation

@garvit-arora

Copy link
Copy Markdown

Summary

  • Pass DataflowConfiguration.max_num_workers into Beam Dataflow pipeline options
  • Extend existing Dataflow runner test to assert the option is forwarded

Relates-to: #72982

Test plan

  • Updated BeamRunJavaPipelineOperator Dataflow runner unit test
  • Run providers/apache/beam unit tests in Breeze

Pass max_num_workers through to Beam Dataflow pipeline options so the documented parameter takes effect.

Relates-to: apache#72982

Generated-by: Cursor
pipeline_options["project"] = self.dataflow_config.project_id
pipeline_options["region"] = self.dataflow_config.location
if self.dataflow_config.max_num_workers is not None:
pipeline_options["max_num_workers"] = self.dataflow_config.max_num_workers

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Java operator passes keys as-is, so this reaches Java as --max_num_workers, but Java reads --maxNumWorkers and would likely reject unknown flags. Would maxNumWorkers work here, like impersonateServiceAccount? convert_camel_to_snake would still give Python and Go max_num_workers.

Java Beam reads --maxNumWorkers; snake_case max_num_workers is rejected as an unknown flag. Generated-by: Cursor
@garvit-arora

Copy link
Copy Markdown
Author

Pushed \50bd6056\ to address @yuseok89's review: Java Beam expects --maxNumWorkers, not --max_num_workers. Test expectation updated accordingly.

Clarify that operator pipeline_options maxNumWorkers wins over dataflow_config.max_num_workers, and add a Dataflow runner regression test.

Generated-by: Cursor
@garvit-arora

Copy link
Copy Markdown
Author

Pushed 4c2f013 addressing bingqin2 pointers: documented max_num_workers override precedence in DataflowConfiguration, and added a Dataflow runner test asserting pipeline_options maxNumWorkers wins over dataflow_config.max_num_workers.

@yuseok89 yuseok89 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While this waits for a maintainer review, LGTM from the option wiring side.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants