[ 
https://issues.apache.org/jira/browse/BEAM-13712?focusedWorklogId=723701&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-723701
 ]

ASF GitHub Bot logged work on BEAM-13712:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 09/Feb/22 14:53
            Start Date: 09/Feb/22 14:53
    Worklog Time Spent: 10m 
      Work Description: 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]


Issue Time Tracking
-------------------

    Worklog Id:     (was: 723701)
    Time Spent: 2h 10m  (was: 2h)

> [Playground]Support graph on Python
> -----------------------------------
>
>                 Key: BEAM-13712
>                 URL: https://issues.apache.org/jira/browse/BEAM-13712
>             Project: Beam
>          Issue Type: Sub-task
>          Components: beam-playground
>            Reporter: Daria Malkova
>            Assignee: Daria Malkova
>            Priority: P3
>              Labels: beam-playground-backend, beam-playground-sprint-7
>          Time Spent: 2h 10m
>  Remaining Estimate: 0h
>




--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to