Graph generation involves creating tasks for each kind. Kinds are ordered
kind-dependencies, and then the Loader specified in
kind.yml is used to obtain the initial set of tasks for that kind.
In short, loaders are responsible for turning the
kind.yml file into an
initial set of tasks that can then be passed down into the transforms.
What is a Loader?#
Loaders are Python functions with the following signature:
def loader(cls, kind, path, config, parameters, loaded_tasks): pass
kind is the name of the kind.
path is the path to the configuration directory for the kind. This
can be used to load extra data, templates, etc.
config is a dict containing the contents of the
parameters give details on which to base the task generation. See
Parameters for details.
loaded_tasks contains all tasks that have already been loaded (which is
guaranteed to contain all kinds of tasks listed in the
The return value is a list of inputs to the transforms listed in the kind’s
transforms property. The specific format for the input depends on the first
transform - whatever it expects.
Taskgraph provides two loaders, although in truth they are virtually identical:
Transform Loader is a barebones loader.
Projects may optionally provide their own loaders that support different behavior.