mohamedawnallah commented on code in PR #37673:
URL: https://github.com/apache/beam/pull/37673#discussion_r2852054188


##########
sdks/go/pkg/beam/runners/dot/dot.go:
##########
@@ -42,14 +43,65 @@ func Execute(ctx context.Context, p *beam.Pipeline) 
(beam.PipelineResult, error)
                return nil, errors.New("must supply dot_file argument")
        }
 
-       edges, nodes, err := p.Build()
+       edges, _, err := p.Build()
        if err != nil {
                return nil, errors.New("can't get data to render")
        }
 
-       var buf bytes.Buffer
-       if err := dotlib.Render(edges, nodes, &buf); err != nil {
+       pipeline, err := graphx.Marshal(edges, &graphx.Options{})
+       if err != nil {
                return nil, err
        }
+
+       var buf bytes.Buffer
+       buf.WriteString("digraph G {\n")
+
+       components := pipeline.GetComponents()
+       if components == nil {
+               return nil, errors.New("pipeline has no components")

Review Comment:
   A private sentimental error can be a good option here, something along those 
lines at the top of the file:
   ```go
   var errNoComponents = errors.New("pipeline has no components")
   ```
   That can be helpful as well when asserting on that error in the tests



-- 
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]

Reply via email to