pub enum TaskKind {
Python {
arguments: BTreeMap<String, Value>,
branch: bool,
},
Sensor {
arguments: BTreeMap<String, Value>,
mode: SensorMode,
every_ms: Option<u64>,
max_wait_ms: Option<u64>,
wait_for: Option<SensorWaitFor>,
batch_ms: Option<u64>,
},
FirstOf {
at_least: Option<u32>,
},
WaitFor {
run_of: RunOf,
max_wait_ms: Option<u64>,
},
WaitForEvent {
event: EventNamed,
max_wait_ms: Option<u64>,
},
TriggerDag {
dag: DagId,
params: BTreeMap<String, Value>,
planned_for: Option<Value>,
wait: bool,
max_wait_ms: Option<u64>,
},
Command {
command: CommandLine,
env: BTreeMap<String, Template>,
connection_env: BTreeMap<String, String>,
resource: Option<ResourceRole>,
},
Script {
job: String,
script: String,
interpreter: String,
args: Vec<Template>,
env: BTreeMap<String, Template>,
working_dir: String,
resource: Option<ResourceRole>,
},
Empty,
}Expand description
The kind of a task and what it runs.
Variants§
Python
A @task function, found by task ID when the runner imports the DAG file.
Fields
Sensor
A wait step (@sensor, @sensor.poke): found by task ID, as a Python task, and ending
with its value or with the TimedOut outcome.
Fields
mode: SensorModeHow it waits.
max_wait_ms: Option<u64>How long it waits, in milliseconds; None: the worker’s [sensors] default_max_wait.
wait_for: Option<SensorWaitFor>@sensor(wait_for=RunOf(...)) (decision 353): called once a matching run of another
DAG has ended, with it as param, rather than at once.
FirstOf
first_of / at_least (decision 347): ended by the master, no process and no slot, as
soon as enough of its upstream edges are taken. Its output is {"$value": ..., "winner": ...}: the winner’s output and ID, or for at_least lists of them in the order they ended.
WaitFor
wait_for(RunOf(...)) (decision 353): waits for a run of another DAG, or one of its
tasks, ended by the master with no process and no slot. Its value is that run’s ID; it
ends Failed when the run (or task) ended otherwise, and TimedOut after max_wait.
Fields
WaitForEvent
wait_for(EventNamed(...)) (decision 354): waits for an event posted through the API,
ended by the master with no process and no slot. Its value is the event (key, data,
at); TimedOut after max_wait.
Fields
event: EventNamedWhich event.
TriggerDag
TriggerDagOperator (decisions 357-362, 365, 378-381): starts a chained run of another
DAG, carried out by the master with no process and no slot. Its value is the started
run’s ID; with wait it ends when that run has: Failed when the run didn’t succeed,
TimedOut after max_wait.
Fields
params: BTreeMap<String, Value>The run’s parameters, over the target’s defaults: literals or references, resolved by the master and checked against the target’s schema when the task runs.
Command
An inline command, run by the agent.
Fields
command: CommandLineThe command line.
connection_env: BTreeMap<String, String>Connections given as variables and files (decision 184:
connections={"DB": warehouse}), by prefix: DB_URL, DB_PGPASSFILE, … Each
is also in the task’s connections.
resource: Option<ResourceRole>Its part in a resource (M4.8d): a CommandResource’s setup, or a resource’s
cleanup_command; None for any other command.
Script
A script declared in a schedr.toml (M4.9): run by the agent with the declared
interpreter, from its script root at the version the master expects. A standalone job’s
task.
Fields
working_dir: StringWhere it runs, relative to the script root (schedr.toml’s directory by default).
resource: Option<ResourceRole>Its part in a resource (ScriptResource, cleanup_script), if any.
Empty
An EmptyOperator: completed by the master, no process.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for TaskKind
impl<'de> Deserialize<'de> for TaskKind
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for TaskKind
Source§impl JsonSchema for TaskKind
impl JsonSchema for TaskKind
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read more