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


##########
ts-sdk/src/coordinator/arg-binding.ts:
##########
@@ -156,6 +165,35 @@ function checkBindable(binding: TaskArgBinding): void {
   );
 }
 
+/**
+ * Fields that 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.
+ */
+const UNSUPPORTED_FIELDS = [
+  "map_index",
+  "element_index",
+  "apply_map",
+  "kwarg",
+  "fallback",
+] as const;
+
+/** Refuse a binding carrying a field that ignoring would bind to the wrong 
value. */
+function checkSupportedFields(binding: XComArgBinding | LiteralArgBinding): 
void {
+  const fields: Partial<Record<(typeof UNSUPPORTED_FIELDS)[number], unknown>> 
= binding;
+  for (const field of UNSUPPORTED_FIELDS) {
+    const value = fields[field];
+    if (value == null || value === false) continue;

Review Comment:
   Same gap as in the Go check: no test sends a binding with `map_index: null, 
element_index: null, apply_map: false, kwarg: null, fallback: null`, which is 
what the supervisor sends for every binding. If this line becomes `if (!(field 
in binding)) continue;`, all vitest tests still pass, but every stub task with 
arguments would fail. Please add a test that binds an `xcom` and a `literal` 
with those fields present.
   



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