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


##########
runners/google-cloud-dataflow-java/src/main/java/org/apache/beam/runners/dataflow/DataflowRunner.java:
##########
@@ -1245,7 +1245,7 @@ public DataflowPipelineJob run(Pipeline pipeline) {
     // to Runner v2.
     if (DataflowRunner.isMultiLanguagePipeline(pipeline) || 
includesTransformUpgrades(pipeline)) {
       List<String> experiments = firstNonNull(options.getExperiments(), 
Collections.emptyList());
-      if (!experiments.contains("use_runner_v2")) {
+      if (!useUnifiedWorker(options)) {

Review Comment:
   ![medium](https://www.gstatic.com/codereviewagent/medium-priority.svg)
   
   The `experiments` variable initialized on line 1247 is no longer used in 
this block after the change to `useUnifiedWorker(options)`. It should be 
removed to avoid unnecessary variable initialization and improve code 
cleanliness.



##########
runners/google-cloud-dataflow-java/src/main/java/org/apache/beam/runners/dataflow/DataflowRunner.java:
##########
@@ -1256,7 +1256,9 @@ public DataflowPipelineJob run(Pipeline pipeline) {
     if (useUnifiedWorker(options)) {
       if (hasExperiment(options, "disable_runner_v2")
           || hasExperiment(options, "disable_runner_v2_until_2023")
-          || hasExperiment(options, "disable_prime_runner_v2")) {
+          || hasExperiment(options, "disable_prime_runner_v2")
+          || hasExperiment(options, "disable_portable_runner")
+          || hasExperiment(options, "enable_streaming_java_runner")) {

Review Comment:
   ![medium](https://www.gstatic.com/codereviewagent/medium-priority.svg)
   
   The error message in the `IllegalArgumentException` (line 1263) is now 
incomplete. It should be updated to include the newly added experiments: 
`enable_portable_runner` in the list of enabling flags, and 
`disable_portable_runner`, `enable_streaming_java_runner` in the list of 
disabling flags, to accurately reflect the cause of the conflict.



-- 
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