v0.0.12¶
New: Composable DAGs¶
DAGs can now contain other DAGs as steps, with a node hierarchy for map-reduce and inline sub-DAG execution.
Dag.map(sub_dag, label)— run a sub-DAG on each element of alistordict, concurrently viaasyncio.gather. Results collected back into the same collection type.CallNode/Dag.node(sub_dag, label)— run a sub-DAG once as a single step in the parent DAG.CompositeDagNode— base class forMapNodeandCallNode, validates one source and one sink in the sub-DAG.- Dag-Namespace refactoring — each
Dagowns its ownNamespace.dag.node(callable)auto-registers callables. Removedclone(),_merge_and_wire(), andDagNode >> Dag. Dag.parent_namespace— set when a DAG is registered in a namespace.Dag.resolve(nsref)checks parent first, then own namespace.
New: Callable DAGs¶
await dag(**kwargs)— run a DAG directly withNullProvenance. Kwargs matched to source node parameters by name. ReturnsDagRunResult.
New: DAG Factory Convention¶
@dag_factory— marks a function as a DAG factory. When registered in a namespace, the factory is called and the DAG registered with__suffix.Dag.node()andDag.map()also accept factories directly, auto-deriving the label from the function name.GlobalRef__suffix —GlobalRef("module:name__")falls back to callingmodule.name()ifmodule.name__doesn't exist.
New: Event-Driven Triggers (lythonic.compose.trigger)¶
TriggerDef— declarative trigger definitions (poll/push) registered viaNamespace.register_trigger(). Purely metadata.TriggerStore— SQLite-backed persistence for trigger activations and events (separate DB fromDagProvenance).TriggerManager— runtime coordinator:activate(),deactivate(),fire(name, payload)for push triggers,start()/stop()for background poll loop. Uses cron expressions viacroniter.
New: DAG Execution Improvements¶
- Sync executor — sync DAG nodes run in
asynciothread executor by default, preventing event loop blocking.@inlinedecorator to opt out. - Runtime resolution —
DagRunner._call_node()resolves callables viaDag.resolve()at runtime, enabling cache wrappers registered in the parent namespace to override raw callables. - Edge traversal tracking —
edge_traversalstable inDagProvenancerecords which edges were traversed during execution. - Node type markers —
node_typecolumn (source/sink/internal/composite) onnode_executionsfor DAG visualization. - Node run log context —
ContextVar-basedrun_idandnode_labelavailable during node execution vialogging.Filter.
Changed¶
DagRunnerconstructor — takesprovenanceparameter instead ofdb_path. Defaults toNullProvenance.register_cached_callable—nsrefis now optional (last parameter).CacheProhibitDirectCall— newContextVar-based guard with.require()static method for methods that must go through cache wrapper.
Dependencies¶
- Added
croniterfor cron expression parsing in triggers.
Documentation¶
- Updated compose pipeline tutorial for new API patterns.
- Added composable DAGs how-to guide.
- Added scheduled triggers tutorial.
- Updated module docstrings for
namespace.pyanddag_runner.py. - Added trigger reference page.