Skip to main content

Module validate

Module validate 

Source
Expand description

The master’s checks of uploaded parse results.

The Python API already refuses wrong DAGs at parse time; the master checks again what it relies on to schedule (it never runs user code, so DAG JSON is its only view of a DAG): the version that produced it, where it is, its trigger, task IDs, edges, cycles and the references between tasks. A file with an invalid DAG is treated as a file that failed to import: its DAGs keep their last good version (see archive/PROJECT.md, DAG code delivery).

Structs§

Checks
What a parse’s files are checked against.

Constants§

INVALID_DAG_EXCEPTION
The exception name of the import error recorded for a file with an invalid DAG.
INVALID_PATH_EXCEPTION
The exception name of the import error recorded for a path outside its root.

Functions§

connection_problems
The connections a root’s DAGs declare checked against the root’s own (decision 179): a file declaring one that isn’t defined (or is defined twice) fails, as the attempt would. Only over a whole root’s files: one file alone doesn’t see its siblings’ connections.
dag_problems
What is wrong with a DAG parsed from root:path; empty when it is valid.
output_problems
The tasks whose output can’t reach the master: a result past its message limit ([grpc] max_message_size) would end the worker’s stream (B33). A command’s output holds stdout and stderr, each up to its max_output_size.
storage_problems
The secret storages a DAG names that the worker that parsed it hasn’t configured (the default one, unnamed, isn’t checked).
target_problems
Each TriggerDagOperator checked against its target, over a whole root’s files, for schedr dags check only (decision 398): a target in the root that doesn’t let its DAG start it (not trigger=Chained(), or Chained(by=...) not naming it) makes the operator’s file fail; a target no file defines is a warning (it may be in a root not parsed yet, decision 379). The master doesn’t: one DAG’s edit would stop another’s file loading; its task fails when it runs instead.
validate_files
Checks the files of a parse of root: a file whose path isn’t inside the root, or that defines an invalid DAG, gets an import error listing the problems and no DAGs.