pierrejeambrun commented on code in PR #73438:
URL: https://github.com/apache/airflow/pull/73438#discussion_r4084187458
##########
airflow-core/docs/authoring-and-scheduling/language-sdks/typescript.rst:
##########
@@ -295,6 +295,28 @@ The packer reads the name from the call as written, so a
call it cannot read, su
Name that task explicitly: without an id it falls back to the handler's
run-time name, which
minification has already changed.
+Order-only edges
+~~~~~~~~~~~~~~~~
+
+An edge that carries no value has no argument name to travel under, so it is
drawn between the
+references themselves with ``before`` and ``after``, the TypeScript pair for
Python's ``>>`` and
+``<<``:
+
+.. code-block:: typescript
+
+ const loaded = load({ transformed });
+ const cleaned = cleanup();
+
+ loaded.before(cleaned); // load >> cleanup
+ cleaned.after(loaded, transformed); // [load, transform] >> cleanup
+
+Both take any number of references, so one call draws several edges, and
drawing an edge that
+already exists changes nothing. Each returns the reference it was called on, so
+``loaded.before(cleaned).before(notified)`` draws both edges from ``load``.
Review Comment:
from `loaded`
##########
ts-sdk/src/sdk/dag.ts:
##########
@@ -324,11 +362,15 @@ export class Dag {
readonly spec: DagSpec;
readonly #tasks = new Map<string, TaskRecord>();
readonly #inputs = new Map<string, RecordedInputs>();
+ // Keyed "upstream\u0000downstream", so declaring an edge twice records it
Review Comment:
weird encoded character in here.
##########
airflow-core/docs/authoring-and-scheduling/language-sdks/typescript.rst:
##########
@@ -295,6 +295,28 @@ The packer reads the name from the call as written, so a
call it cannot read, su
Name that task explicitly: without an id it falls back to the handler's
run-time name, which
minification has already changed.
+Order-only edges
+~~~~~~~~~~~~~~~~
+
+An edge that carries no value has no argument name to travel under, so it is
drawn between the
+references themselves with ``before`` and ``after``, the TypeScript pair for
Python's ``>>`` and
+``<<``:
+
+.. code-block:: typescript
+
+ const loaded = load({ transformed });
+ const cleaned = cleanup();
+
+ loaded.before(cleaned); // load >> cleanup
+ cleaned.after(loaded, transformed); // [load, transform] >> cleanup
+
Review Comment:
task is 'cleaned' not 'cleanup'
##########
ts-sdk/src/sdk/dag.ts:
##########
@@ -291,6 +328,7 @@ export type RecordedInputs = Readonly<Record<string,
TaskRef | JsonValue>>;
// Dag's private state without public accessors on the class.
let taskRecordsOf: (dag: Dag) => ReadonlyMap<string, TaskRecord>;
let inputsOf: (dag: Dag) => ReadonlyMap<string, RecordedInputs>;
+let orderEdgesOf: (dag: Dag) => readonly OrderEdge[];
Review Comment:
No loop detection, self loop prevention.
Is that expected to be implemented in a folllow up PR?
` // A cycle, which the Dag-level check rejects; the edges themselves
are
// two distinct edges and are recorded as such.
`
But that seems missing from current implementation.
##########
ts-sdk/src/sdk/dag.ts:
##########
Review Comment:
This probably need to be updated. "Identity only" I would remove, also keeps
task dependencies.
--
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]