You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by GitBox <gi...@apache.org> on 2021/12/06 10:38:14 UTC

[GitHub] [beam] KhaninArtur commented on a change in pull request #16127: [BEAM-13366] [Playground] Add support Pipeline Options for Backend

KhaninArtur commented on a change in pull request #16127:
URL: https://github.com/apache/beam/pull/16127#discussion_r762854599



##########
File path: playground/backend/internal/utils/preparators_utils.go
##########
@@ -36,3 +37,16 @@ func GetPreparators(sdk pb.Sdk, filepath string) (*[]preparators.Preparator, err
 	}
 	return prep, nil
 }
+
+//SpacesToEqualsOption prepares pipelineOptions by replacing spaces to equals

Review comment:
       ```suggestion
   // SpacesToEqualsOption prepares pipelineOptions by replacing spaces to equals
   ```

##########
File path: playground/backend/internal/utils/preparators_utils.go
##########
@@ -36,3 +37,16 @@ func GetPreparators(sdk pb.Sdk, filepath string) (*[]preparators.Preparator, err
 	}
 	return prep, nil
 }
+
+//SpacesToEqualsOption prepares pipelineOptions by replacing spaces to equals
+func SpacesToEqualsOption(pipelineOptions string) string {
+	preparedOptions := strings.Split(pipelineOptions, " ")
+	for index, str := range preparedOptions {
+		if index%2 == 0 && index != 0 {
+			preparedOptions[index] = fmt.Sprintf(" %s", str)
+		} else if index%2 != 0 {
+			preparedOptions[index] = fmt.Sprintf("=%s", str)
+		}
+	}

Review comment:
       This logic is a bit implicit, let's add a comment that explains what is happening here




-- 
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: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org