FrankYang0529 commented on code in PR #73895:
URL: https://github.com/apache/airflow/pull/73895#discussion_r4143779561


##########
go-sdk/airflow/dag.go:
##########
@@ -163,19 +177,32 @@ func (d *DagRef) Task(fn any, opts ...TaskOption) 
*TaskRef {
                        ))
                }
        }
-       if _, exists := d.taskIDs[taskID]; exists {
+       if _, exists := d.tasksByID[taskID]; exists {
                panic(fmt.Sprintf(
                        "airflow.DagRef.Task: Dag %q already has a task %q; "+
                                "set another task_id with 
airflow.TaskSpec{TaskID: ...}",
                        d.dagID, taskID,
                ))
        }
-       if d.taskIDs == nil {
-               d.taskIDs = make(map[string]struct{})
+       fnType := reflect.TypeOf(fn)
+       upstreams := d.checkInputs(taskID, fnType, cfg.inputs)
+       var resultType reflect.Type
+       if fnType.NumOut() == 2 {

Review Comment:
   `Task` already panics for that. `newTaskFunction`, which `Task` calls first, 
rejects a function with three return values. I added a comment for that.



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