lostluck commented on code in PR #25203:
URL: https://github.com/apache/beam/pull/25203#discussion_r1102041421
##########
sdks/go/pkg/beam/core/funcx/output.go:
##########
@@ -84,6 +84,9 @@ func unfoldEmit(t reflect.Type) ([]reflect.Type, bool, error)
{
if ok, err := isInParam(t.In(i)); !ok {
return nil, false, errors.Wrap(err,
errIllegalParametersInEmit)
}
+ if t.In(i).Kind() == reflect.Interface || (t.In(i).Kind() ==
reflect.Pointer && t.In(i).Elem().Kind() == reflect.Interface) {
Review Comment:
Yes. Exactly. Deny "interface{}" but allow `beam.T` et al.
The "universal" types should only be referring to `beam.T` etc. Not
arbitrary interfaces. Basically, it's important to distinguish between them
(`beam.T` is not `beam.U`) so that for example, if a function is dropping a key
or a value in a DoFn, we know which one is being used downstream./
Users can use beam.T and similar to escape the type system, but then they
deserve any runtime type errors they get at pipeline execution time. The
strictness of knowing what types are used where is to help users avoid
expensive execution time issues.
--
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]