run
Usage
prism run
is used to execute your Prism project.
Usage: prism run [OPTIONS]
Run your Prism project. This is the CLI equivalent of calling PrismProject.run(...) in your Python script.
Examples:
โข prism run
โข prism run -t task01.Task01 -t task02.Task02
โข prism run -t task01.Task01 --all-downstream
โข prism run --runtime-ctx '{"hi": 1}'
โญโ Options โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ
โ --project-id TEXT Project ID. โ
โ --project-name TEXT Project name. โ
โ --project-version TEXT Project version. โ
โ --connector TEXT Import path to the connector instances to โ
โ use for your project. These can be accessed โ
โ at runtime CurrentRun.conn(...). โ
โ --concurrency INTEGER Number of threads to use when running tasks. โ
โ Default is 1 (i.e., single-threaded) โ
โ * --tasks-dir TEXT Directory containing tasks. Default is the โ
โ "tasks" folder in the current directory. โ
โ [required] โ
โ --package-lookups TEXT Additional directories / modules to look โ
โ within when importing modules and functions โ
โ in your code. The tasks_dir and its parent โ
โ are automatically added to this list. โ
โ --task -t TEXT Task ID to run. If not specified, then all โ
โ tasks are run. Tasks are retrieved from the โ
โ tasks_dir path specified in the PrismProject โ
โ instance. You can specify multiple tasks โ
โ with as follows: -t <your_first_task> -t โ
โ <your_second_task>. โ
โ --runtime-ctx -c TEXT Runtime context as a dictionary. Must be a โ
โ valid JSON. These overwrite variables in the โ
โ PrismProject context โ
โ --all-tasks-upstream -u Execute all tasks upstream of tasks โ
โ specified with --task โ
โ --all-tasks-downstream -d Execute all tasks downstream of tasks โ
โ specified with --task โ
โ --on-success -s TEXT Callback to run if the job succeeds. Use โ
โ import paths to specify the callback. You โ
โ can specify multiple callbacks as follows: โ
โ -s <callback1> -s <callback2> โ
โ --on-failure -f TEXT Callback to run if the job fails. Use import โ
โ paths to specify the callback. You can โ
โ specify multiple callbacks as follows: -f โ
โ <callback1> -f <callback2> โ
โ --full-refresh Run all the tasks, regardless of whether or โ
โ not they are already done โ
โ --log-level -l [info|warning|error|debug|critical] Set the log level โ
โ --disable-rich-logging Disable default logging behavior, whereby โ
โ logs are beautified in the console with the โ
โ rich package. โ
โ --log-file TEXT File in which to save the logs. Default is โ
โ None. โ
โ --help Show this message and exit. โ
โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
The CLI arguments are largely the same as the arguments used to instantiate the PrismProject
and call the PrismProject.run()
method. One difference, however is that --runtime-ctx
should be a string, not a JSON. For example:
prism run --runtime-ctx '{"hi": 1}'
Prism converts this string to a JSON prior to actually executing the project.
Last updated