run
Usage
prism run is used to execute a Python-based Prism project. This is distinct from a PySpark-based Prism project, in which case you would need to use the spark-submit command.
Usage: prism run [OPTIONS]
Execute your Prism project.
Examples:
โข prism run
โข prism run -m module01.py -m module02.py
โข prism run -m module01 --all-downstream
โข prism run -v VAR1=VALUE1 -v VAR2=VALUE2
โข prism run --context '{"hi": 1}'
โญโ Options โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ
โ --module -m TEXT Modules to execute. You can specify multiple modules with as follows: -m โ
โ <your_first_module> -m <your_second_module>. โ
โ --all-downstream Execute all tasks downstream of modules specified with --module โ
โ --all-upstream Execute all tasks upstream of modules specified with --module โ
โ --log-level -l [info|warn|error|debug] Set the log level โ
โ --full-tb Show the full traceback when an error occurs โ
โ --vars -v TEXT Variables as key value pairs. These overwrite variables in prism_project.py. All โ
โ values are intepreted as strings. โ
โ --context TEXT Context as a dictionary. Must be a valid JSON. These overwrite variables in โ
โ prism_project.py โ
โ --help Show this message and exit. โ
โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏHere's what prism run does under the hood:
It first executes the
prism compilecommand.Recall that this command parses the tasks contained in the
modules/folder fortasks.ref(...)calls, creates the dependency graph, and stores the project metadata (e.g., the configuration, thetasks.ref(...)calls, the targets, and the topological sort) in amanifest.
It parses the
prism_project.pyfile. It also parses the configuration files listed withinprism_project.py(e.g.,PROFILE_YML_PATH,TRIGGERS_YML_PATH).It creates a pipeline consisting of the global variables from
prism_project.pyand the adapters fromprofile.yml.It executes the tasks in a topological order.
Example
Here's what the output looks like in Terminal:
Required arguments
There are no required arguments for run.
Optional arguments
Here are the optional arguments you can run with run:
--full-tb: Display full traceback if errors arise at any stage of the pipeline--log-level: Log level, one ofinfo,warn,error, orcritical.--vars: Prism variables as key-value pairskey=value. These overwrite any variable definitions inprism_project.py. All values are read as strings.--context: Prism variables as JSON. Cannot co-exist with--vars. These overwrite any variable definitions inprism_project.py.--modules: Paths to modules that you want to run; if not specified, all modules in pipeline are run. Paths should be specified relative to themodulesfolder.--all-upstream: Run all modules upstream of those specified in--modules--all-downstream: Run all modules downstream of those specified in--modules
Last updated