lostluck commented on code in PR #25203:
URL: https://github.com/apache/beam/pull/25203#discussion_r1089568225
##########
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) {
+ panic("Type interface{} isn't a supported PCollection
type")
Review Comment:
If there's an error return, one should return an error instead of panicking.
Panicking is generally a last resort thing, and rarely when one can return an
error instead.
--
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]