jason810496 commented on code in PR #77587:
URL: https://github.com/apache/airflow/pull/77587#discussion_r4694792078


##########
ts-sdk/src/sdk/operator.ts:
##########
@@ -54,7 +55,7 @@ export interface OperatorContext {
   readonly client: CoordinatorClient;
   readonly logs: LogChannel;
   /** Bind the task's declared inputs, applying the `withArgNames` renames of 
`argNames`. */

Review Comment:
   Could the doc say why the args are wrapped? Otherwise a later refactor might 
unwrap them and bring the warning back.
   
   ```suggestion
     /**
      * Bind the task's declared inputs, applying the `withArgNames` renames of 
`argNames`.
      * The args come wrapped so awaiting the result does not probe them for 
`then`.
      */
   ```



##########
ts-sdk/src/hitl/operator.ts:
##########
@@ -66,7 +66,7 @@ async function executeHITL(task: HITLTask<never>, op: 
OperatorContext): Promise<
   const { details, ctx, client, logs } = op;
   // The inputs are read here only, for the text: the resumed run must not 
depend on upstream
   // XComs still being there.
-  const args = await op.resolveArgs(task.argNames);
+  const { args } = await op.resolveArgs(task.argNames);

Review Comment:
   Thanks for the fix! The trap still warns on other probes, like a handler 
returning `args` or `JSON.stringify(args)`. Could we skip `then` and `toJSON` 
misses in the `get` trap in arg-binding.ts instead? Something like:
   
   ```ts
   const PROTOCOL_PROBES = new Set(["then", "toJSON"]);
   // ...
         const name = resolve(property);
         if (name !== undefined) return values.get(name);
         if (PROTOCOL_PROBES.has(property)) return undefined;
   ```



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