AydarZaynutdinov commented on a change in pull request #16611:
URL: https://github.com/apache/beam/pull/16611#discussion_r802746575
##########
File path: playground/backend/internal/utils/cache_utils.go
##########
@@ -32,3 +33,14 @@ func SetToCache(ctx context.Context, cacheService
cache.Cache, key uuid.UUID, su
}
return err
}
+
+// ReadAndSetToCacheGraph read graph from file and writes it to the cache.
+func ReadAndSetToCacheGraph(ctx context.Context, cacheService cache.Cache,
pipelineId uuid.UUID, graphPath string) error {
Review comment:
Maybe rename this method to `SaveGraph`?
##########
File path: playground/backend/internal/preparers/python_preparers.go
##########
@@ -47,7 +61,17 @@ func (builder *PreparersBuilder) PythonPreparers()
*PythonPreparersBuilder {
func (builder *PythonPreparersBuilder) WithLogHandler()
*PythonPreparersBuilder {
addLogHandler := Preparer{
Prepare: addCodeToFile,
- Args: []interface{}{builder.filePath, addLogHandlerCode},
+ Args: []interface{}{builder.filePath, saveLogs},
+ }
+ builder.AddPreparer(addLogHandler)
+ return builder
+}
+
+//WithGraphHandler adds code to save the graph
+func (builder *PythonPreparersBuilder) WithGraphHandler()
*PythonPreparersBuilder {
+ addLogHandler := Preparer{
+ Prepare: addCodeToFile,
+ Args: []interface{}{builder.filePath, saveGraph},
}
builder.AddPreparer(addLogHandler)
Review comment:
```suggestion
addGraphHandler := Preparer{
Prepare: addCodeToFile,
Args: []interface{}{builder.filePath, saveGraph},
}
builder.AddPreparer(addGraphHandler)
```
##########
File path: playground/backend/internal/preparers/preparers_utils/utils.go
##########
@@ -0,0 +1,158 @@
+// Licensed to the Apache Software Foundation (ASF) under one or more
Review comment:
Lets move it to `internal/utils/preparers_utils.go` file.
--
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]