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


##########
go-sdk/airflow/dag.go:
##########
@@ -183,57 +197,55 @@ func (d *DagRef) Task(fn any, opts ...TaskOption) 
*TaskRef {
                                continue
                        }
                        panic(fmt.Sprintf(
-                               "airflow.DagRef.Task: task %q of Dag %q: %v", 
findTaskName(fn, opts), d.dagID, err,
+                               "%s: task %q of Dag %q: %v", method, 
findTaskName(fn, opts), d.dagID, err,
                        ))
                }
        }
 
        taskID := cfg.spec.TaskID
        if taskID == "" && isTrigger {
                panic(fmt.Sprintf(
-                       "airflow.DagRef.Task: Dag %q: a task from 
airflow.TriggerDagRun with DagID %q has no "+
+                       "%s: Dag %q: a task from airflow.TriggerDagRun with 
DagID %q has no "+
                                "Go function to take a task_id from; set one 
with airflow.TaskSpec{TaskID: ...}",
-                       d.dagID, trigger.spec.DagID,
+                       method, d.dagID, trigger.spec.DagID,
                ))
        }
        if taskID == "" {
                var ok bool
                if taskID, ok = taskIDFromFuncName(funcName(fn)); !ok {
                        panic(fmt.Sprintf(
-                               "airflow.DagRef.Task: Dag %q: %s has no name to 
use as the task_id; "+
+                               "%s: Dag %q: %s has no name to use as the 
task_id; "+
                                        "set one with airflow.TaskSpec{TaskID: 
...}",
-                               d.dagID, funcName(fn),
+                               method, d.dagID, funcName(fn),
                        ))
                }
        }
        if triggerErr != nil {
-               panic(fmt.Sprintf(
-                       "airflow.DagRef.Task: task %q of Dag %q: %v", taskID, 
d.dagID, triggerErr,
-               ))
+               panic(fmt.Sprintf("%s: task %q of Dag %q: %v", method, taskID, 
d.dagID, triggerErr))
        }
        if err := checkTaskSpec(cfg.spec); err != nil {
                panic(fmt.Sprintf("airflow.DagRef.Task: task %q of Dag %q: %v", 
taskID, d.dagID, err))

Review Comment:
   Updated it. Thanks.



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