Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Go SDK] Add fake impulse for inputs in Xlang Transform #23383

Merged
merged 4 commits into from
Oct 4, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions sdks/go/pkg/beam/core/runtime/xlangx/expand.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ func Expand(edge *graph.MultiEdge, ext *graph.ExternalTransform) error {
extTransform = transforms[extTransformID]
}

// Python external transform needs the producer of input PCollection in expansion request.
graphx.AddFakeImpulses(p)

// Scoping the ExternalTransform with respect to it's unique namespace, thus
// avoiding future collisions
addNamespace(extTransform, p.GetComponents(), ext.Namespace)
Expand All @@ -76,6 +79,9 @@ func Expand(edge *graph.MultiEdge, ext *graph.ExternalTransform) error {
return err
}

// Remove fake impulses added earlier.
graphx.RemoveFakeImpulses(res.GetComponents(), res.GetTransform())

exp := &graph.ExpandedTransform{
Components: res.GetComponents(),
Transform: res.GetTransform(),
Expand Down