gemini-code-assist[bot] commented on code in PR #38375:
URL: https://github.com/apache/beam/pull/38375#discussion_r3192450784


##########
sdks/python/apache_beam/runners/dataflow/dataflow_runner.py:
##########
@@ -591,6 +591,7 @@ def _add_runner_v2_missing_options(options):
   debug_options.add_experiment('use_unified_worker')
   debug_options.add_experiment('use_runner_v2')
   debug_options.add_experiment('use_portable_job_submission')
+  debug_options.add_experiment('enable_portable_runner')

Review Comment:
   ![medium](https://www.gstatic.com/codereviewagent/medium-priority.svg)
   
   The PR description states that `enable_portable_runner` is a valid option 
for enabling Runner V2. However, this flag is currently only added to the 
experiments list within `_add_runner_v2_missing_options`, which is typically 
called after the decision to use Runner V2 has already been made. To fully 
support this flag as a trigger for Runner V2, it should also be included in the 
detection logic (e.g., in `_is_runner_v2_enabled` or the logic that calls 
`_add_runner_v2_missing_options`).



##########
sdks/python/apache_beam/runners/dataflow/dataflow_runner.py:
##########
@@ -662,6 +663,8 @@ def _is_runner_v2_disabled(options):
   """Returns true if runner v2 is disabled."""
   debug_options = options.view_as(DebugOptions)
   return (
+      debug_options.lookup_experiment('disable_portable_runner') or
+      debug_options.lookup_experiment('enable_streaming_java_runner') or

Review Comment:
   ![medium](https://www.gstatic.com/codereviewagent/medium-priority.svg)
   
   The PR description mentions that specifying `disable_portable_runner` or 
`enable_streaming_java_runner` should cause the job to be rejected. Currently, 
these flags are only added to `_is_runner_v2_disabled`, which prevents Runner 
V2 flags from being added but allows the job to potentially fall back to the 
legacy runner. If a hard rejection is intended as described, please add an 
explicit validation check that raises an exception when these experiments are 
present.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to