[
https://issues.apache.org/jira/browse/BEAM-13366?focusedWorklogId=691723&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-691723
]
ASF GitHub Bot logged work on BEAM-13366:
-----------------------------------------
Author: ASF GitHub Bot
Created on: 07/Dec/21 12:54
Start Date: 07/Dec/21 12:54
Worklog Time Spent: 10m
Work Description: ilya-kozyrev commented on a change in pull request
#16127:
URL: https://github.com/apache/beam/pull/16127#discussion_r763963644
##########
File path: playground/backend/internal/utils/preparators_utils.go
##########
@@ -36,3 +37,18 @@ func GetPreparators(sdk pb.Sdk, filepath string)
(*[]preparators.Preparator, err
}
return prep, nil
}
+
+// SpacesToEqualsOption prepares pipelineOptions by replacing spaces to equals.
+// Initially, the string is converted to an array of options and their values.
+// Then, a space is added to the odd indexed words, except for the first, and
an equal is added to each even word.
+func SpacesToEqualsOption(pipelineOptions string) string {
+ preparedOptions := strings.Split(pipelineOptions, " ")
Review comment:
btw, why we can't use strings.Replace()?
##########
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:
Could we rename this function to `ReplaceSpacesWithEquals` ?
--
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]
Issue Time Tracking
-------------------
Worklog Id: (was: 691723)
Time Spent: 40m (was: 0.5h)
> Add support Pipeline Options for Backend
> ----------------------------------------
>
> Key: BEAM-13366
> URL: https://issues.apache.org/jira/browse/BEAM-13366
> Project: Beam
> Issue Type: Sub-task
> Components: beam-playground
> Reporter: Ilya Kozyrev
> Assignee: Pavel Avilov
> Priority: P2
> Labels: beam-playground-backend, beam-playground-sprint-5
> Time Spent: 40m
> Remaining Estimate: 0h
>
> # Run code can take pipeline options in request
> # Executors can put options in Run command
> # Update gRPC client in ci/cd
--
This message was sent by Atlassian Jira
(v8.20.1#820001)