shivaam commented on issue #69288:
URL: https://github.com/apache/airflow/issues/69288#issuecomment-5099257764
> Do you have any thoughts on the equivalent for the TS world, where a user
could explicitly reference the source argument name?
For the Python `@task.stub` → TypeScript-handler direction, I think the
`name` already carried by each `arg_binding` can become the property name in a
single `input` object.
For example:
```py
@task.stub(queue="typescript")
def transform(region_code: str, threshold: float): ...
transform(
region_code=extract(),
threshold=0.75,
)
```
Assuming `extract()` pushes `"us-east-1"`, the TypeScript runtime would
resolve the XCom and literal bindings, then invoke the handler as:
```ts
async ({
input: {
region_code: region,
threshold,
},
ctx,
client,
}) => {
// region === "us-east-1"
// threshold === 0.75
}
```
Here, `region_code` is the source argument name and `region` is only a local
TypeScript alias. Keeping task arguments under `input` also avoids collisions
with SDK-provided fields such as `ctx` and `client` (`ctx.signal` remains
available for cancellation).
The runtime could validate each resolved value against its `value_schema`
when provided before constructing `input`.
--
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]