From e65b4a314074f4b7a0d442763ce8e2b0bfb9f574 Mon Sep 17 00:00:00 2001 From: Vladislav Chunikhin <102509589+vchunikhin@users.noreply.github.com> Date: Tue, 17 May 2022 12:05:58 +0300 Subject: [PATCH] Merge pull request #17678 from [BEAM-14460] [Playground] WIP. Fix error during getting the graph for java SDK. --- playground/backend/internal/preparers/java_preparers.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/playground/backend/internal/preparers/java_preparers.go b/playground/backend/internal/preparers/java_preparers.go index 5556e631506..37ae10b7865 100644 --- a/playground/backend/internal/preparers/java_preparers.go +++ b/playground/backend/internal/preparers/java_preparers.go @@ -34,7 +34,6 @@ const ( newLinePattern = "\n" javaPublicClassNamePattern = "public class (.*?) [{|implements(.*)]" pipelineNamePattern = `Pipeline\s([A-z|0-9_]*)\s=\sPipeline\.create` - findImportsPattern = `import.*\;` graphSavePattern = "String dotString = org.apache.beam.runners.core.construction.renderer.PipelineDotRenderer.toDotString(%s);\n" + " try (java.io.PrintWriter out = new java.io.PrintWriter(\"Graph.dot\")) {\n " + " out.println(dotString);\n " + @@ -107,7 +106,7 @@ func (builder *JavaPreparersBuilder) WithGraphHandler() *JavaPreparersBuilder { func addCodeToSaveGraph(args ...interface{}) error { filePath := args[0].(string) pipelineObjectName, _ := findPipelineObjectName(filePath) - graphSaveCode := fmt.Sprintf(graphSavePattern, pipelineObjectName, utils.GraphFileName) + graphSaveCode := fmt.Sprintf(graphSavePattern, pipelineObjectName, pipelineObjectName) if pipelineObjectName != utils.EmptyLine { err := replace(filePath, fmt.Sprintf("%s.run", pipelineObjectName), graphSaveCode)