Release History

The format is based on Keep a Changelog, and this project adheres to Semantic Versioning

1.1.0

Added

  • Support for dbt-core 1.5 and 1.7 or later. dbt-core 1.6 is not supported as it requires pydantic v1.

Changed

  • CLI args are now parsed with pydantic-settings, a new dependency, in place of argparse parsers. The CLI is also stricter:

    • unknown args now fail with an error. Previously they were ignored, and the value of a mistyped option e.g. --contracts models was silently used to filter files.

    • options now need a value. Previously e.g. a bare --profile was allowed, which set it to None.

    • null may be given to unset an option e.g. --target null.

  • dbt-validate now exits with code 1 when contracts fail without also printing a traceback.

  • PathCondition now matches paths using forward slashes as separators on every OS. Path patterns should use forward slashes e.g. models/staging, or be given as a list of path parts.

Fixed

  • dbt_contracts.properties failed with a circular import when imported before dbt_contracts.contracts.

  • Running the CLI module directly e.g. python -m dbt_contracts.cli --operation validate no longer takes the operation as a file to filter on.

  • has_expected_name now accepts the documented null data type key for patterns which apply to all data types without their own patterns. Configs using it previously failed validation.

  • PathCondition patterns with regex escapes e.g. .*\.sql$ never matched on any OS, and directory patterns never matched Windows paths, as backslashes were double escaped in both patterns and paths.

  • Validation now runs every term for each item. Previously, terms after the first failing term were skipped so their violations were never reported.

  • Release builds no longer report a dirty version when the README is sanitised for PyPI, so the default versioningit formats are restored.

Documentation

  • Linting now uses ruff instead of flake8.

  • The pre-commit guide now refers to the .pre-commit-config.yaml file that users configure, and the quick start describes where the contracts file is looked for and which formats are supported.

  • Base classes in the API reference and its inheritance diagrams now link to their generic classes rather than showing pydantic’s parametrised classes e.g. ContractTerm[TypeVar].

  • Added make commands for development e.g. make test, make lint and make check, and updated the contributing guide to use them with uv.

  • Fixed docs build warnings and removed warning suppressions for Sphinx extensions which are not enabled.

  • Added an API reference with inheritance diagrams, generated by sphinx.ext.autosummary on every docs build. Packages now declare their public API in __all__ so classes re-exported from private modules are documented.

1.0.9

Fixed

  • Path separators in Windows paths were being intepreted as special characters when path filtering. All backslashes in paths are now double escaped to prevent issues with regex matching.

1.0.8

Fixed

1.0.7

Changed

  • Properties files now outputted with extra indentation for arrays

1.0.6

Fixed

  • When selecting only a child contract with dbt-validate, paths were not being set on parent contracts leading to overprocessing. Paths are now set correctly.

1.0.5

Fixed

  • Paths were not assigned to runner when passed via CLI. Now passed as expected.

1.0.4

Fixed

  • HasAllColumns was not logging the correct extra columns. This is now fixed.

1.0.3

Changed

  • Drop requirement for pre-release pydantic version

1.0.2

Fixed

  • CLI functions now set logging to INFO by default. Results can now be viewed in terminal output.

1.0.1

Fixed

  • Fixed the hooks IDs and added generate hook

1.0.0

Stable release! πŸŽ‰

  • Complete redesign to improve modularity and performance

  • Add generators for properties generation from database objects