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