[
https://issues.apache.org/jira/browse/BEAM-7068?focusedWorklogId=228711&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-228711
]
ASF GitHub Bot logged work on BEAM-7068:
----------------------------------------
Author: ASF GitHub Bot
Created on: 16/Apr/19 22:04
Start Date: 16/Apr/19 22:04
Worklog Time Spent: 10m
Work Description: lostluck commented on pull request #8298: [BEAM-7068]
Improving error messages when binding functions in Go SDK
URL: https://github.com/apache/beam/pull/8298#discussion_r276009369
##########
File path: sdks/go/pkg/beam/core/graph/bind.go
##########
@@ -290,22 +292,22 @@ func tryBindInbound(t typex.FullType, args
[]funcx.FnParam, isMain bool) (typex.
return other, kind, nil
}
-func inboundArity(t typex.FullType, isMain bool) int {
+func inboundArity(t typex.FullType, isMain bool) (int, error) {
if t.Class() == typex.Composite {
switch t.Type() {
case typex.KVType:
if isMain {
- return 2
+ return 2, nil
}
// A KV side input must be a single iterator/map.
- return 1
+ return 1, nil
case typex.CoGBKType:
- return len(t.Components())
+ return len(t.Components()), nil
default:
- panic("Unexpected inbound type")
+ return 0, fmt.Errorf("unexpected inbound type: %v",
t.Type())
Review comment:
Consider:
unexpected composite inbound type
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 228711)
Time Spent: 0.5h (was: 20m)
> Improve error messages when binding functions
> ---------------------------------------------
>
> Key: BEAM-7068
> URL: https://issues.apache.org/jira/browse/BEAM-7068
> Project: Beam
> Issue Type: Sub-task
> Components: sdk-go
> Reporter: Daniel Oliveira
> Assignee: Daniel Oliveira
> Priority: Minor
> Time Spent: 0.5h
> Remaining Estimate: 0h
>
> This bug covers error messages around the file core/graph/bind.go which binds
> the inputs and outputs of functions to make sure all the types match up
> properly. When DoFns are created with the wrong number of inputs/outputs or
> wrong input/output types, this is where errors will usually originate from.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)