jason810496 commented on code in PR #72019:
URL: https://github.com/apache/airflow/pull/72019#discussion_r4011679751
##########
java-sdk/adr/0002-native-dag-interface.md:
##########
@@ -94,18 +138,57 @@ public final class EtlPipeline_Dag {
public void execute(Context context, Client client) throws Exception {
TaskArgs args = TaskArgs.of(context);
long extracted = args.require(0, Long.class);
- EtlPipeline tasks = new EtlPipeline();
- tasks.bind(context, client);
- client.setXCom(tasks.transform(extracted));
+ double threshold = 0.9; // baked from lit(0.9) at Dag-build time
+ client.setXCom(new EtlPipeline().transform(client, context, extracted,
threshold));
}
}
- // Extract and Load follow the same shape.
+ // Extract, Load, Audit, and Notify follow the same shape.
}
```
-`bind(context, client)` is what `getClient()` and `getContext()` return for
that invocation, and a
-getter called with nothing bound throws.
+The injected arguments are passed straight into the user method, and the data
arguments bind by
+position through the same internal `TaskArgs` the mixed-language surface uses
+([ADR-0001](0001-mixed-lang-dag-interface.md)) — no getters, no `bind()`,
nothing ambient.
+
+**Literals.** A data argument is an `Arg<T>`, which a `TaskRef` satisfies; a
constant is wrapped
+with `lit(...)` — `transform(extract(), lit(0.9))` — and recorded as a baked
value with no edge.
Review Comment:
Sure, it's fine to keep it as-is in the ADR for the further reference.
--
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]