phanikumv commented on code in PR #76967:
URL: https://github.com/apache/airflow/pull/76967#discussion_r4679178690


##########
go-sdk/pkg/execution/task_runner.go:
##########
@@ -211,6 +220,35 @@ func convertArgBindings(specsPtr *genmodels.ArgBindings) 
([]binding.Arg, error)
        return args, nil
 }
 
+func errMappedTaskNotImplemented(i int, name, what string) error {
+       return fmt.Errorf(
+               "arg_bindings[%d] (%q): %s needs mapped task support, which 
this version of the Go SDK "+
+                       "does not implement; version 1.1.0 will add it",
+               i,
+               name,
+               what,
+       )
+}
+
+// unsupportedBindingFields resolve an argument per map index, which this SDK 
does not do yet.
+// A literal never carries map_index or element_index, so one list serves both 
kinds.
+var unsupportedBindingFields = []string{
+       "map_index",
+       "element_index",
+       "apply_map",
+       "kwarg",
+       "fallback",
+}
+
+func findUnsupportedBindingField(m map[string]any) string {
+       for _, field := range unsupportedBindingFields {
+               if v := m[field]; v != nil && v != false {

Review Comment:
   No existing test covers this. The null/false skip on this line is what keeps 
every ordinary stub task working. The supervisor sends `StartupDetails` with a 
plain `model_dump()` (`send_msg(msg, request_id=0)` → `_serialize_response` in 
`supervisor.py`), so every binding reaches the runtime with `map_index: null, 
element_index: null, apply_map: false, kwarg: null, fallback: null` written out.
   
   If this check refuses any key that is present, `go test ./pkg/execution/` 
still passes, but every stub task with arguments would fail. Could you add a 
case that sends an `xcom` and a `literal` binding with all five fields set to 
null/false, and asserts that the task runs? The test is needed with the 
allowlist approach too.
   



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