CLI
Command-line interface for Koality.
This module provides the CLI for running, validating, and inspecting Koality data quality check configurations.
Commands
run: Execute data quality checks from a configuration file. validate: Validate a configuration file without executing checks. print: Print the resolved configuration in various formats.
Example
$ koality run --config_path checks.yaml $ koality validate --config_path checks.yaml $ koality print --config_path checks.yaml --format json
cli()
Koality - Data quality monitoring CLI.
Koality provides commands to run, validate, and inspect data quality check configurations. Use --help on any command for more details.
Source code in src/koality/cli.py
33 34 35 36 37 38 39 | |
print_config(config_path, output_format, indent, overwrites, database_setup_variable)
Print the resolved koality configuration.
Displays the fully resolved configuration after default propagation. This shows the effective configuration that would be used during execution. Filter values can be overridden using --overwrites (-o) options. Overwrites are applied to defaults before validation, so they propagate to all checks automatically.
Database setup variables can be provided using --database_setup_variable (-dsv) to substitute ${VAR_NAME} placeholders in the database_setup SQL. Variables can also be set via the DATABASE_SETUP_VARIABLES environment variable using comma-separated VAR=value pairs.
Output formats:
model: Pydantic model representation (Python repr).
yaml: YAML formatted output (default).
json: JSON formatted output.
Examples:
koality print --config_path checks.yaml
koality print --config_path checks.yaml --format json
koality print --config_path checks.yaml --format yaml --indent 4
koality print --config_path checks.yaml -o partition_date=2023-01-01
koality print --config_path checks.yaml -dsv PROJECT_ID=my-gcp-project
DATABASE_SETUP_VARIABLES="PROJECT_ID=my-project" koality print --config_path checks.yaml
Source code in src/koality/cli.py
523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 | |
run(config_path, overwrites, database_setup_variable)
Run koality checks from a configuration file.
Executes all data quality checks defined in the configuration file. Filter values can be overridden using --overwrites (-o) options. Overwrites are applied to defaults before validation, so they propagate to all checks automatically.
Database setup variables can be provided using --database_setup_variable (-dsv) to substitute ${VAR_NAME} placeholders in the database_setup SQL. Variables can also be set via the DATABASE_SETUP_VARIABLES environment variable using comma-separated VAR=value pairs.
Examples:
koality run --config_path checks.yaml
koality run --config_path checks.yaml -o partition_date=2023-01-01
koality run --config_path checks.yaml -dsv PROJECT_ID=my-gcp-project
koality run --config_path checks.yaml -dsv PROJECT_ID=prod -dsv DATASET=analytics
DATABASE_SETUP_VARIABLES="PROJECT_ID=my-project,DATASET=prod" koality run --config_path checks.yaml
Source code in src/koality/cli.py
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 | |
validate(config_path)
Validate a koality configuration file.
Parses and validates the configuration file against the Koality schema without executing any checks. Useful for CI/CD pipelines and debugging.
Exit codes:
0: Configuration is valid.
1: Configuration is invalid.
Examples:
koality validate --config_path checks.yaml
Source code in src/koality/cli.py
491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 | |