diff --git a/.gitignore b/.gitignore index 074bbde..ed66080 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,6 @@ .DS_Store node_modules/ -.venv \ No newline at end of file +.venv +env +__pycache__ \ No newline at end of file diff --git a/README.md b/README.md index 1cb79fb..27baf0e 100644 --- a/README.md +++ b/README.md @@ -112,4 +112,9 @@ _Do you use a different IDE which also supports JSON Schema? Please open a PR wi ## Contributing PRs that improve these schemata are welcome! -Please ensure that JSON keys are sorted by [vscode-sort-json](https://marketplace.visualstudio.com/items?itemName=richie5um2.vscode-sort-json) according to the rules in `.vscode/settings`. +These schemas are generated from [pydantic models](https://docs.pydantic.dev/latest/concepts/json_schema/). To make updates, the process is as follows: + +1. Create a virtual environment and install the dependencies: `pip install -r requirements.txt` +2. Make changes to the corresponding pydantic models in `src/latest.py` +3. Run the generation script: `python3 src/generate.py` +4. Add tests for valid and invalid JSON files in `tests/latest` \ No newline at end of file diff --git a/generate.py b/generate.py new file mode 100644 index 0000000..5afd73b --- /dev/null +++ b/generate.py @@ -0,0 +1,56 @@ +import json +from pathlib import Path +from typing import Any, Dict + +from src.latest.dbt_cloud import DbtCloud +from src.latest.dbt_yml_files import DbtYmlFiles +from src.latest.dependencies import Dependencies, Packages +from src.latest.selectors import Selectors +from pydantic.json_schema import GenerateJsonSchema + + +class RemoveNullsGenerateJsonSchema(GenerateJsonSchema): + """A GenerateJsonSchema which removes nullability from types. + + We do not want to include optional values in the json schema because + that would inhibit code completion and validation. + + Certain properties (such as freshness overrides) need to be nullable, + which can be achieved by setting the $comment value below. + """ + + def _remove_null(self, json_schema: Dict[str, Any]): + if "$comment" in json_schema and json_schema["$comment"] == "truly_nullable": + return + if "anyOf" in json_schema: + json_schema["anyOf"] = [ + item for item in json_schema["anyOf"] if item != {"type": "null"} + ] + for v in json_schema.values(): + if isinstance(v, dict): + self._remove_null(v) + + def generate(self, schema, mode="validation"): + json_schema = super().generate(schema, mode=mode) + json_schema["$schema"] = "http://json-schema.org/draft-07/schema#" + self._remove_null(json_schema) + return json_schema + + +if __name__ == "__main__": + files = { + "dbt_yml_files": DbtYmlFiles, + "dependencies": Dependencies, + "packages": Packages, + "selectors": Selectors, + "dbt_cloud": DbtCloud, + } + output_directory = Path("schemas/latest") + for file_name, model in files.items(): + schema_file = output_directory / f"{file_name}-latest.json" + schema_file.parent.mkdir(parents=True, exist_ok=True) + schema = model.model_json_schema( + mode="validation", schema_generator=RemoveNullsGenerateJsonSchema + ) + print("Generating", schema_file) + schema_file.write_text(json.dumps(schema, indent=2)) diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..1bd28af --- /dev/null +++ b/requirements.txt @@ -0,0 +1 @@ +datamodel-code-generator \ No newline at end of file diff --git a/schemas/latest-originals/dbt_cloud-latest.json b/schemas/latest-originals/dbt_cloud-latest.json new file mode 100644 index 0000000..70921f0 --- /dev/null +++ b/schemas/latest-originals/dbt_cloud-latest.json @@ -0,0 +1,14 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "object", + "properties": { + "project-id": { + "type": "string" + }, + "defer-env-id": { + "type": "string" + } + }, + "required": ["project-id"], + "additionalProperties": false +} diff --git a/schemas/latest-originals/dbt_project-latest.json b/schemas/latest-originals/dbt_project-latest.json new file mode 100644 index 0000000..db6bdf0 --- /dev/null +++ b/schemas/latest-originals/dbt_project-latest.json @@ -0,0 +1,1112 @@ +{ + "title": "dbt_project", + "type": "object", + "required": [ + "name" + ], + "$schema": "http://json-schema.org/draft-07/schema#", + "properties": { + "version": { + "type": "string" + }, + "name": { + "type": "string" + }, + "analysis-paths": { + "$ref": "#/$defs/array_of_strings" + }, + "asset-paths": { + "$ref": "#/$defs/array_of_strings" + }, + "clean-targets": { + "$ref": "#/$defs/array_of_strings" + }, + "config-version": { + "type": "number", + "default": 2 + }, + "data_tests": { + "$ref": "#/$defs/data_test_configs" + }, + "dbt-cloud": { + "type": "object", + "properties": { + "project-id": { + "type": "number" + } + }, + "additionalProperties": true + }, + "dispatch": { + "type": "array", + "items": { + "type": "object", + "required": [ + "macro_namespace", + "search_order" + ], + "properties": { + "macro_namespace": { + "type": "string" + }, + "search_order": { + "$ref": "#/$defs/array_of_strings" + } + }, + "additionalProperties": false + } + }, + "docs-paths": { + "$ref": "#/$defs/array_of_strings" + }, + "flags": { + "type": "object", + "properties": { + "cache_selected_only": { + "type": "boolean" + }, + "debug": { + "type": "boolean" + }, + "fail_fast": { + "type": "boolean" + }, + "indirect_selection": { + "type": "string" + }, + "log_format": { + "type": "string" + }, + "log_format_file": { + "type": "string" + }, + "log_level": { + "type": "string" + }, + "log_level_file": { + "type": "string" + }, + "partial_parse": { + "type": "boolean" + }, + "populate_cache": { + "type": "boolean" + }, + "printer_width": { + "type": "integer" + }, + "require_explicit_package_overrides_for_builtin_materializations": { + "type": "boolean" + }, + "require_resource_names_without_spaces": { + "type": "boolean" + }, + "send_anonymous_usage_stats": { + "type": "boolean" + }, + "source_freshness_run_project_hooks": { + "type": "boolean" + }, + "static_parser": { + "type": "boolean" + }, + "use_colors": { + "type": "boolean" + }, + "use_colors_file": { + "type": "boolean" + }, + "use_experimental_parser": { + "type": "boolean" + }, + "version_check": { + "type": "boolean" + }, + "warn_error": { + "type": "boolean" + }, + "warn_error_options": { + "type": "object" + }, + "write_json": { + "type": "boolean" + } + } + }, + "log-path": { + "type": "string" + }, + "macro-paths": { + "$ref": "#/$defs/array_of_strings" + }, + "model-paths": { + "$ref": "#/$defs/array_of_strings" + }, + "models": { + "$ref": "#/$defs/model_configs" + }, + "on-run-end": { + "anyOf": [ + { + "$ref": "#/$defs/array_of_strings" + }, + { + "type": "string" + } + ] + }, + "on-run-start": { + "anyOf": [ + { + "$ref": "#/$defs/array_of_strings" + }, + { + "type": "string" + } + ] + }, + "packages-install-path": { + "type": "string" + }, + "profile": { + "type": "string" + }, + "query-comment": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "object", + "properties": { + "append": { + "$ref": "#/$defs/boolean_or_jinja_string" + }, + "comment": { + "type": "string" + }, + "job-label": { + "$ref": "#/$defs/boolean_or_jinja_string" + } + }, + "additionalProperties": false + } + ] + }, + "quoting": { + "type": "object", + "properties": { + "database": { + "$ref": "#/$defs/boolean_or_jinja_string" + }, + "identifier": { + "$ref": "#/$defs/boolean_or_jinja_string" + }, + "schema": { + "$ref": "#/$defs/boolean_or_jinja_string" + } + } + }, + "require-dbt-version": { + "$ref": "#/$defs/string_or_array_of_strings" + }, + "seed-paths": { + "$ref": "#/$defs/array_of_strings" + }, + "seeds": { + "$ref": "#/$defs/seed_configs" + }, + "snapshot-paths": { + "$ref": "#/$defs/array_of_strings" + }, + "snapshots": { + "$ref": "#/$defs/snapshot_configs" + }, + "sources": { + "$ref": "#/$defs/source_configs" + }, + "target-path": { + "type": "string" + }, + "test-paths": { + "$ref": "#/$defs/array_of_strings" + }, + "tests": { + "$ref": "#/$defs/data_test_configs" + }, + "unit_tests": { + "$ref": "#/$defs/unit_test_configs" + }, + "vars": { + "type": "object" + } + }, + "additionalProperties": false, + "$defs": { + "access": { + "type": "string", + "enum": [ + "private", + "protected", + "public" + ] + }, + "alias": { + "type": "string" + }, + "array_of_strings": { + "type": "array", + "items": { + "type": "string" + } + }, + "auto_refresh": { + "$ref": "#/$defs/boolean_or_jinja_string" + }, + "backup": { + "$ref": "#/$defs/boolean_or_jinja_string" + }, + "boolean_or_jinja_string": { + "oneOf": [ + { + "$ref": "#/$defs/jinja_string" + }, + { + "type": "boolean" + } + ] + }, + "column_types": { + "type": "object", + "patternProperties": { + "": { + "type": "string" + } + } + }, + "contract": { + "type": "object", + "required": [ + "enforced" + ], + "properties": { + "enforced": { + "$ref": "#/$defs/boolean_or_jinja_string", + "default": "true" + } + } + }, + "data_test_configs": { + "title": "Data test configs", + "description": "Configurations set in the dbt_project.yml file will apply to all tests that don't have a more specific configuration set.", + "type": "object", + "properties": { + "+alias": { + "$ref": "#/$defs/alias" + }, + "+database": { + "$ref": "#/$defs/database" + }, + "+enabled": { + "$ref": "#/$defs/boolean_or_jinja_string" + }, + "+error_if": { + "$ref": "#/$defs/error_if" + }, + "+fail_calc": { + "$ref": "#/$defs/fail_calc" + }, + "+group": { + "$ref": "#/$defs/group" + }, + "+limit": { + "$ref": "#/$defs/limit" + }, + "+meta": { + "$ref": "#/$defs/meta" + }, + "+schema": { + "$ref": "#/$defs/schema" + }, + "+severity": { + "$ref": "#/$defs/severity" + }, + "+store_failures": { + "$ref": "#/$defs/boolean_or_jinja_string" + }, + "+tags": { + "$ref": "#/$defs/tags" + }, + "+warn_if": { + "$ref": "#/$defs/warn_if" + }, + "alias": { + "$ref": "#/$defs/alias" + }, + "database": { + "$ref": "#/$defs/database" + }, + "enabled": { + "$ref": "#/$defs/boolean_or_jinja_string" + }, + "error_if": { + "$ref": "#/$defs/error_if" + }, + "fail_calc": { + "$ref": "#/$defs/fail_calc" + }, + "group": { + "$ref": "#/$defs/group" + }, + "limit": { + "$ref": "#/$defs/limit" + }, + "meta": { + "$ref": "#/$defs/meta" + }, + "schema": { + "$ref": "#/$defs/schema" + }, + "severity": { + "$ref": "#/$defs/severity" + }, + "store_failures": { + "$ref": "#/$defs/boolean_or_jinja_string" + }, + "tags": { + "$ref": "#/$defs/tags" + }, + "warn_if": { + "$ref": "#/$defs/warn_if" + } + }, + "additionalProperties": { + "oneOf": [ + { + "$ref": "#/$defs/data_test_configs" + }, + { + "$ref": "#/$defs/empty_directory" + } + ] + } + }, + "database": { + "type": "string" + }, + "docs_config": { + "title": "Docs config", + "description": "Configurations for the appearance of nodes in the dbt documentation.", + "type": "object", + "properties": { + "node_color": { + "description": "The color of the node on the DAG in the documentation. It must be an Hex code or a valid CSS color name.", + "type": "string", + "pattern": "^(#[a-fA-F0-9]{3}|#[a-fA-F0-9]{6}|[^#][a-zA-Z]*)$" + }, + "show": { + "type": "boolean", + "default": true + } + }, + "additionalProperties": false + }, + "empty_directory": { + "type": "null" + }, + "error_if": { + "type": "string" + }, + "fail_calc": { + "type": "string" + }, + "file_format": { + "type": "string" + }, + "grant_access_to": { + "title": "Authorized views", + "description": "Configuration, specific to BigQuery adapter, used to setup authorized views.", + "type": "array", + "items": { + "type": "object", + "properties": { + "database": { + "type": "string" + }, + "project": { + "type": "string" + } + }, + "additionalProperties": false + } + }, + "grants": { + "description": "grant config. each key is a database permission and the value is the grantee of that permission", + "type": "object", + "patternProperties": { + ".*": { + "$ref": "#/$defs/string_or_array_of_strings" + } + }, + "additionalProperties": false + }, + "group": { + "type": "string" + }, + "hours_to_expiration": { + "description": "Configuration specific to BigQuery adapter used to set an expiration delay (in hours) to a table.", + "type": "number" + }, + "incremental_strategy": { + "type": "string" + }, + "invalidate_hard_deletes": { + "$ref": "#/$defs/boolean_or_jinja_string" + }, + "jinja_string": { + "type": "string", + "pattern": "\\{\\{.*\\}\\}" + }, + "kms_key_name": { + "description": "Configuration, specific to BigQuery adapter, of the KMS key name used for data encryption.", + "type": "string" + }, + "label_configs": { + "title": "Label configs", + "description": "Configurations specific to BigQuery adapter used to add labels and tags to tables & views created by dbt.", + "type": "object", + "patternProperties": { + "^[a-z][a-z0-9_-]{0,63}$": { + "oneOf": [ + { + "type": "string", + "pattern": "^[a-z0-9_-]{0,64}$" + }, + { + "$ref": "#/$defs/jinja_string" + } + ] + } + }, + "additionalProperties": false + }, + "limit": { + "type": "number" + }, + "location": { + "type": "string" + }, + "materialized": { + "type": "string" + }, + "meta": { + "type": "object" + }, + "model_configs": { + "title": "Model configs", + "description": "Configurations set in the dbt_project.yml file will apply to all models that don't have a more specific configuration set.", + "type": "object", + "properties": { + "+access": { + "$ref": "#/$defs/access" + }, + "+alias": { + "$ref": "#/$defs/alias" + }, + "+auto_refresh": { + "$ref": "#/$defs/auto_refresh" + }, + "+backup": { + "$ref": "#/$defs/backup" + }, + "+bind": { + "$ref": "#/$defs/boolean_or_jinja_string", + "default": false + }, + "+contract": { + "$ref": "#/$defs/contract" + }, + "+copy_grants": { + "$ref": "#/$defs/boolean_or_jinja_string" + }, + "+database": { + "$ref": "#/$defs/database" + }, + "+docs": { + "$ref": "#/$defs/docs_config" + }, + "+enabled": { + "$ref": "#/$defs/boolean_or_jinja_string" + }, + "+file_format": { + "$ref": "#/$defs/file_format" + }, + "+full_refresh": { + "$ref": "#/$defs/boolean_or_jinja_string" + }, + "+grant_access_to": { + "$ref": "#/$defs/grant_access_to" + }, + "+grants": { + "$ref": "#/$defs/grants" + }, + "+group": { + "$ref": "#/$defs/group" + }, + "+hours_to_expiration": { + "$ref": "#/$defs/hours_to_expiration" + }, + "+incremental_strategy": { + "$ref": "#/$defs/incremental_strategy" + }, + "+kms_key_name": { + "$ref": "#/$defs/kms_key_name" + }, + "+labels": { + "$ref": "#/$defs/label_configs" + }, + "+location": { + "$ref": "#/$defs/location" + }, + "+materialized": { + "$ref": "#/$defs/materialized" + }, + "+meta": { + "$ref": "#/$defs/meta" + }, + "+on_configuration_change": { + "$ref": "#/$defs/on_configuration_change" + }, + "+on_schema_change": { + "$ref": "#/$defs/on_schema_change" + }, + "+persist_docs": { + "$ref": "#/$defs/persist_docs_config" + }, + "+post-hook": { + "$ref": "#/$defs/array_of_strings" + }, + "+pre-hook": { + "$ref": "#/$defs/array_of_strings" + }, + "+schema": { + "$ref": "#/$defs/schema" + }, + "+secure": { + "$ref": "#/$defs/boolean_or_jinja_string", + "default": false + }, + "+snowflake_warehouse": { + "$ref": "#/$defs/snowflake_warehouse" + }, + "+sql_header": { + "$ref": "#/$defs/sql_header" + }, + "+tags": { + "$ref": "#/$defs/tags" + }, + "+target_lag": { + "$ref": "#/$defs/target_lag" + }, + "+transient": { + "$ref": "#/$defs/boolean_or_jinja_string" + }, + "access": { + "$ref": "#/$defs/access" + }, + "alias": { + "$ref": "#/$defs/alias" + }, + "auto_refresh": { + "$ref": "#/$defs/auto_refresh" + }, + "backup": { + "$ref": "#/$defs/backup" + }, + "bind": { + "$ref": "#/$defs/boolean_or_jinja_string", + "default": false + }, + "contract": { + "$ref": "#/$defs/contract" + }, + "copy_grants": { + "$ref": "#/$defs/boolean_or_jinja_string" + }, + "database": { + "$ref": "#/$defs/database" + }, + "docs": { + "$ref": "#/$defs/docs_config" + }, + "enabled": { + "$ref": "#/$defs/boolean_or_jinja_string" + }, + "file_format": { + "$ref": "#/$defs/file_format" + }, + "full_refresh": { + "$ref": "#/$defs/boolean_or_jinja_string" + }, + "grant_access_to": { + "$ref": "#/$defs/grant_access_to" + }, + "grants": { + "$ref": "#/$defs/grants" + }, + "group": { + "$ref": "#/$defs/group" + }, + "hours_to_expiration": { + "$ref": "#/$defs/hours_to_expiration" + }, + "incremental_strategy": { + "$ref": "#/$defs/incremental_strategy" + }, + "kms_key_name": { + "$ref": "#/$defs/kms_key_name" + }, + "labels": { + "$ref": "#/$defs/label_configs" + }, + "location": { + "$ref": "#/$defs/location" + }, + "materialized": { + "$ref": "#/$defs/materialized" + }, + "meta": { + "$ref": "#/$defs/meta" + }, + "on_configuration_change": { + "$ref": "#/$defs/on_configuration_change" + }, + "on_schema_change": { + "$ref": "#/$defs/on_schema_change" + }, + "persist_docs": { + "$ref": "#/$defs/persist_docs_config" + }, + "post-hook": { + "$ref": "#/$defs/array_of_strings" + }, + "pre-hook": { + "$ref": "#/$defs/array_of_strings" + }, + "schema": { + "$ref": "#/$defs/schema" + }, + "secure": { + "$ref": "#/$defs/boolean_or_jinja_string", + "default": false + }, + "snowflake_warehouse": { + "$ref": "#/$defs/snowflake_warehouse" + }, + "sql_header": { + "$ref": "#/$defs/sql_header" + }, + "tags": { + "$ref": "#/$defs/tags" + }, + "target_lag": { + "$ref": "#/$defs/target_lag" + }, + "transient": { + "$ref": "#/$defs/boolean_or_jinja_string" + } + }, + "additionalProperties": { + "oneOf": [ + { + "$ref": "#/$defs/model_configs" + }, + { + "$ref": "#/$defs/empty_directory" + } + ] + } + }, + "on_configuration_change": { + "type": "string", + "enum": [ + "apply", + "continue", + "fail" + ] + }, + "on_schema_change": { + "type": "string", + "enum": [ + "append_new_columns", + "fail", + "ignore", + "sync_all_columns" + ] + }, + "persist_docs_config": { + "title": "Persist docs config", + "description": "Configurations for the persistence of the dbt documentation.", + "type": "object", + "properties": { + "columns": { + "$ref": "#/$defs/boolean_or_jinja_string", + "default": true + }, + "relation": { + "$ref": "#/$defs/boolean_or_jinja_string", + "default": true + } + }, + "additionalProperties": false + }, + "schema": { + "type": [ + "string", + "null" + ] + }, + "seed_configs": { + "title": "Seed configs", + "type": "object", + "properties": { + "+column_types": { + "$ref": "#/$defs/column_types" + }, + "+copy_grants": { + "$ref": "#/$defs/boolean_or_jinja_string" + }, + "+database": { + "$ref": "#/$defs/database" + }, + "+docs": { + "$ref": "#/$defs/docs_config" + }, + "+enabled": { + "$ref": "#/$defs/boolean_or_jinja_string" + }, + "+full_refresh": { + "$ref": "#/$defs/boolean_or_jinja_string" + }, + "+grants": { + "$ref": "#/$defs/grants" + }, + "+group": { + "$ref": "#/$defs/group" + }, + "+meta": { + "$ref": "#/$defs/meta" + }, + "+persist_docs": { + "$ref": "#/$defs/persist_docs_config" + }, + "+quote_columns": { + "$ref": "#/$defs/boolean_or_jinja_string" + }, + "+schema": { + "$ref": "#/$defs/schema" + }, + "+tags": { + "$ref": "#/$defs/tags" + }, + "+transient": { + "$ref": "#/$defs/boolean_or_jinja_string" + }, + "column_types": { + "$ref": "#/$defs/column_types" + }, + "copy_grants": { + "$ref": "#/$defs/boolean_or_jinja_string" + }, + "database": { + "$ref": "#/$defs/database" + }, + "docs": { + "$ref": "#/$defs/docs_config" + }, + "enabled": { + "$ref": "#/$defs/boolean_or_jinja_string" + }, + "full_refresh": { + "$ref": "#/$defs/boolean_or_jinja_string" + }, + "grants": { + "$ref": "#/$defs/grants" + }, + "group": { + "$ref": "#/$defs/group" + }, + "meta": { + "$ref": "#/$defs/meta" + }, + "persist_docs": { + "$ref": "#/$defs/persist_docs_config" + }, + "quote_columns": { + "$ref": "#/$defs/boolean_or_jinja_string" + }, + "schema": { + "$ref": "#/$defs/schema" + }, + "tags": { + "$ref": "#/$defs/tags" + }, + "transient": { + "$ref": "#/$defs/boolean_or_jinja_string" + } + }, + "additionalProperties": { + "oneOf": [ + { + "$ref": "#/$defs/seed_configs" + }, + { + "$ref": "#/$defs/empty_directory" + } + ] + } + }, + "severity": { + "oneOf": [ + { + "$ref": "#/$defs/jinja_string" + }, + { + "type": "string", + "enum": [ + "warn", + "error" + ] + } + ] + }, + "snapshot_configs": { + "title": "Snapshot configs", + "type": "object", + "properties": { + "+alias": { + "$ref": "#/$defs/alias" + }, + "+check_cols": { + "$ref": "#/$defs/string_or_array_of_strings" + }, + "+docs": { + "$ref": "#/$defs/docs_config" + }, + "+enabled": { + "$ref": "#/$defs/boolean_or_jinja_string" + }, + "+grants": { + "$ref": "#/$defs/grants" + }, + "+group": { + "$ref": "#/$defs/group" + }, + "+invalidate_hard_deletes": { + "$ref": "#/$defs/invalidate_hard_deletes" + }, + "+meta": { + "$ref": "#/$defs/meta" + }, + "+persist_docs": { + "$ref": "#/$defs/persist_docs_config" + }, + "+post-hook": { + "$ref": "#/$defs/array_of_strings" + }, + "+pre-hook": { + "$ref": "#/$defs/array_of_strings" + }, + "+quote_columns": { + "$ref": "#/$defs/boolean_or_jinja_string" + }, + "+strategy": { + "$ref": "#/$defs/strategy" + }, + "+tags": { + "$ref": "#/$defs/tags" + }, + "+target_database": { + "$ref": "#/$defs/target_database" + }, + "+target_schema": { + "$ref": "#/$defs/target_schema" + }, + "+transient": { + "$ref": "#/$defs/boolean_or_jinja_string" + }, + "+unique_key": { + "$ref": "#/$defs/string_or_array_of_strings" + }, + "+updated_at": { + "$ref": "#/$defs/updated_at" + }, + "alias": { + "$ref": "#/$defs/alias" + }, + "check_cols": { + "$ref": "#/$defs/string_or_array_of_strings" + }, + "docs": { + "$ref": "#/$defs/docs_config" + }, + "enabled": { + "$ref": "#/$defs/boolean_or_jinja_string" + }, + "grants": { + "$ref": "#/$defs/grants" + }, + "group": { + "$ref": "#/$defs/group" + }, + "invalidate_hard_deletes": { + "$ref": "#/$defs/invalidate_hard_deletes" + }, + "meta": { + "$ref": "#/$defs/meta" + }, + "persist_docs": { + "$ref": "#/$defs/persist_docs_config" + }, + "post-hook": { + "$ref": "#/$defs/array_of_strings" + }, + "pre-hook": { + "$ref": "#/$defs/array_of_strings" + }, + "quote_columns": { + "$ref": "#/$defs/boolean_or_jinja_string" + }, + "strategy": { + "$ref": "#/$defs/strategy" + }, + "tags": { + "$ref": "#/$defs/tags" + }, + "target_database": { + "$ref": "#/$defs/target_database" + }, + "target_schema": { + "$ref": "#/$defs/target_schema" + }, + "transient": { + "$ref": "#/$defs/boolean_or_jinja_string" + }, + "unique_key": { + "$ref": "#/$defs/string_or_array_of_strings" + }, + "updated_at": { + "$ref": "#/$defs/updated_at" + } + }, + "additionalProperties": { + "oneOf": [ + { + "$ref": "#/$defs/snapshot_configs" + }, + { + "$ref": "#/$defs/empty_directory" + } + ] + } + }, + "snowflake_warehouse": { + "type": "string" + }, + "source_configs": { + "title": "Source configs", + "type": "object", + "properties": { + "+enabled": { + "$ref": "#/$defs/boolean_or_jinja_string" + }, + "+meta": { + "$ref": "#/$defs/meta" + }, + "+tags": { + "$ref": "#/$defs/tags" + }, + "enabled": { + "$ref": "#/$defs/boolean_or_jinja_string" + }, + "meta": { + "$ref": "#/$defs/meta" + }, + "tags": { + "$ref": "#/$defs/tags" + } + }, + "additionalProperties": { + "oneOf": [ + { + "$ref": "#/$defs/source_configs" + }, + { + "$ref": "#/$defs/empty_directory" + } + ] + } + }, + "sql_header": { + "type": "string" + }, + "strategy": { + "type": "string" + }, + "string_or_array_of_strings": { + "oneOf": [ + { + "type": "string" + }, + { + "$ref": "#/$defs/array_of_strings" + } + ] + }, + "tags": { + "$ref": "#/$defs/string_or_array_of_strings" + }, + "target_database": { + "type": "string" + }, + "target_lag": { + "type": "string", + "pattern": "^(?:downstream|\\d+\\s*(?:seconds|minutes|hours|days))$" + }, + "target_schema": { + "type": "string" + }, + "unit_test_configs": { + "properties": { + "+meta": { + "$ref": "#/$defs/meta" + }, + "+tags": { + "$ref": "#/$defs/tags" + }, + "meta": { + "$ref": "#/$defs/meta" + }, + "tags": { + "$ref": "#/$defs/tags" + } + }, + "additionalProperties": { + "oneOf": [ + { + "$ref": "#/$defs/unit_test_configs" + }, + { + "$ref": "#/$defs/empty_directory" + } + ] + } + }, + "updated_at": { + "type": "string" + }, + "warn_if": { + "type": "string" + } + } +} \ No newline at end of file diff --git a/schemas/latest-originals/dbt_yml_files-latest.json b/schemas/latest-originals/dbt_yml_files-latest.json new file mode 100644 index 0000000..b8c757b --- /dev/null +++ b/schemas/latest-originals/dbt_yml_files-latest.json @@ -0,0 +1,1961 @@ +{ + "title": "dbt_yml_files", + "type": "object", + "$schema": "http://json-schema.org/draft-07/schema#", + "properties": { + "version": { + "type": "number", + "const": 2 + }, + "analyses": { + "type": "array", + "items": { + "type": "object", + "required": [ + "name" + ], + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "columns": { + "type": "array", + "items": { + "type": "object", + "required": [ + "name" + ], + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "data_type": { + "type": "string" + } + }, + "additionalProperties": false + } + }, + "config": { + "type": "object", + "properties": { + "tags": { + "$ref": "#/$defs/string_or_array_of_strings" + } + }, + "additionalProperties": false + }, + "docs": { + "$ref": "#/$defs/docs_config" + }, + "group": { + "$ref": "#/$defs/group_name" + } + } + } + }, + "exposures": { + "type": "array", + "items": { + "type": "object", + "required": [ + "depends_on", + "name", + "owner", + "type" + ], + "$comment": "NB: depends_on is not strictly required, but is _expected_ according to the documentation", + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "dashboard", + "notebook", + "analysis", + "ml", + "application" + ] + }, + "depends_on": { + "type": "array", + "items": { + "type": "string" + } + }, + "label": { + "type": "string", + "$comment": "Added in dbt Core v1.3" + }, + "maturity": { + "type": "string", + "enum": [ + "high", + "medium", + "low" + ] + }, + "meta": { + "type": "object" + }, + "owner": { + "$ref": "#/$defs/owner" + }, + "tags": { + "$ref": "#/$defs/string_or_array_of_strings" + }, + "url": { + "type": "string" + } + } + } + }, + "groups": { + "type": "array", + "items": { + "type": "object", + "required": [ + "name", + "owner" + ], + "properties": { + "name": { + "type": "string" + }, + "owner": { + "$ref": "#/$defs/owner" + } + }, + "additionalProperties": false + } + }, + "macros": { + "type": "array", + "items": { + "type": "object", + "required": [ + "name" + ], + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "arguments": { + "type": "array", + "items": { + "type": "object", + "required": [ + "name" + ], + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "type": { + "type": "string" + } + }, + "additionalProperties": false + } + }, + "docs": { + "$ref": "#/$defs/docs_config" + } + }, + "additionalProperties": false + } + }, + "metrics": { + "type": "array", + "items": { + "type": "object", + "required": [ + "name", + "label", + "type", + "type_params" + ], + "if": { + "properties": { + "type": { + "enum": [ + "SIMPLE", + "simple" + ] + } + } + }, + "then": { + "properties": { + "type_params": { + "$ref": "#/$defs/simple_metric_type_params" + } + } + }, + "else": { + "if": { + "properties": { + "type": { + "enum": [ + "derived", + "DERIVED" + ] + } + } + }, + "then": { + "properties": { + "type_params": { + "$ref": "#/$defs/derived_metric_type_params" + } + } + }, + "else": { + "if": { + "properties": { + "type": { + "enum": [ + "cumulative", + "CUMULATIVE" + ] + } + } + }, + "then": { + "properties": { + "type_params": { + "$ref": "#/$defs/cumulative_metric_type_params" + } + } + }, + "else": { + "if": { + "properties": { + "type": { + "enum": [ + "conversion", + "CONVERSION" + ] + } + } + }, + "then": { + "properties": { + "type_params": { + "$ref": "#/$defs/conversion_metric_type_params" + } + } + }, + "else": { + "if": { + "properties": { + "type": { + "enum": [ + "ratio", + "RATIO" + ] + } + } + }, + "then": { + "properties": { + "type_params": { + "$ref": "#/$defs/ratio_metric_type_params" + } + } + } + } + } + } + }, + "properties": { + "name": { + "type": "string", + "pattern": "(?!.*__).*^[a-z][a-z0-9_]*[a-z0-9]$" + }, + "description": { + "type": "string" + }, + "type": { + "title": "Metric Type", + "enum": [ + "SIMPLE", + "RATIO", + "CUMULATIVE", + "DERIVED", + "CONVERSION", + "simple", + "ratio", + "cumulative", + "derived", + "conversion" + ] + }, + "filter": { + "type": "string" + }, + "group": { + "$ref": "#/$defs/group_name" + }, + "label": { + "type": "string" + }, + "type_params": { + "type": "object" + } + }, + "additionalProperties": false + } + }, + "models": { + "type": "array", + "items": { + "type": "object", + "required": [ + "name" + ], + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "access": { + "type": "string", + "enum": [ + "private", + "protected", + "public" + ] + }, + "columns": { + "type": "array", + "items": { + "$ref": "#/$defs/column_properties" + } + }, + "config": { + "$ref": "#/$defs/model_configs" + }, + "constraints": { + "$ref": "#/$defs/constraints" + }, + "data_tests": { + "type": "array", + "items": { + "$ref": "#/$defs/data_tests" + } + }, + "deprecation_date": { + "type": "string" + }, + "docs": { + "$ref": "#/$defs/docs_config" + }, + "group": { + "$ref": "#/$defs/group_name" + }, + "latest_version": { + "type": "number" + }, + "meta": { + "type": "object" + }, + "tests": { + "type": "array", + "items": { + "$ref": "#/$defs/data_tests" + } + }, + "versions": { + "type": "array", + "items": { + "type": "object", + "required": [ + "v" + ], + "properties": { + "columns": { + "type": "array", + "items": { + "anyOf": [ + { + "$ref": "#/$defs/include_exclude" + }, + { + "$ref": "#/$defs/column_properties" + } + ] + } + }, + "config": { + "$ref": "#/$defs/model_configs" + }, + "v": { + "type": "number" + } + } + } + } + }, + "additionalProperties": false + } + }, + "saved_queries": { + "type": "array", + "items": { + "type": "object", + "required": [ + "name", + "description", + "label", + "query_params" + ], + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "exports": { + "type": "array", + "items": { + "$ref": "#/$defs/export" + } + }, + "label": { + "type": "string" + }, + "query_params": { + "type": "object", + "properties": { + "dimensions": { + "$ref": "#/$defs/array_of_strings" + }, + "metrics": { + "$ref": "#/$defs/array_of_strings" + }, + "where": { + "$ref": "#/$defs/array_of_strings" + }, + "additionalProperties": false + } + } + }, + "additionalProperties": false + } + }, + "seeds": { + "type": "array", + "items": { + "type": "object", + "required": [ + "name" + ], + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "columns": { + "type": "array", + "items": { + "$ref": "#/$defs/column_properties" + } + }, + "config": { + "title": "Seed Config", + "type": "object", + "properties": { + "column_types": { + "type": "object" + }, + "copy_grants": { + "$ref": "#/$defs/boolean_or_jinja_string" + }, + "data_tests": { + "type": "array", + "items": { + "$ref": "#/$defs/data_tests" + } + }, + "database": { + "type": "string" + }, + "enabled": { + "$ref": "#/$defs/boolean_or_jinja_string" + }, + "grants": { + "$ref": "#/$defs/grants" + }, + "quote_columns": { + "$ref": "#/$defs/boolean_or_jinja_string" + }, + "schema": { + "type": "string" + } + } + }, + "docs": { + "$ref": "#/$defs/docs_config" + }, + "group": { + "$ref": "#/$defs/group_name" + }, + "tests": { + "type": "array", + "items": { + "$ref": "#/$defs/data_tests" + } + } + }, + "additionalProperties": false + } + }, + "semantic_models": { + "type": "array", + "items": { + "type": "object", + "required": [ + "name", + "model" + ], + "properties": { + "name": { + "type": "string", + "pattern": "(?!.*__).*^[a-z][a-z0-9_]*[a-z0-9]$" + }, + "description": { + "type": "string" + }, + "defaults": { + "type": "object", + "properties": { + "agg_time_dimension": { + "type": "string" + } + }, + "additionalProperties": false + }, + "dimensions": { + "type": "array", + "items": { + "$ref": "#/$defs/dimension" + } + }, + "entities": { + "type": "array", + "items": { + "$ref": "#/$defs/entity" + } + }, + "measures": { + "type": "array", + "items": { + "$ref": "#/$defs/measure" + } + }, + "model": { + "type": "string", + "default": "ref('')" + }, + "primary_entity": { + "type": "string" + } + }, + "additionalProperties": false + } + }, + "snapshots": { + "type": "array", + "items": { + "type": "object", + "required": [ + "name" + ], + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "columns": { + "type": "array", + "items": { + "$ref": "#/$defs/column_properties" + } + }, + "config": { + "title": "Snapshot Config", + "type": "object", + "properties": { + "alias": { + "type": "string" + }, + "check_cols": { + "$ref": "#/$defs/string_or_array_of_strings" + }, + "enabled": { + "$ref": "#/$defs/boolean_or_jinja_string" + }, + "grants": { + "$ref": "#/$defs/grants" + }, + "persist_docs": { + "$ref": "#/$defs/persist_docs_config" + }, + "post-hook": { + "$ref": "#/$defs/array_of_strings" + }, + "pre-hook": { + "$ref": "#/$defs/array_of_strings" + }, + "quote_columns": { + "$ref": "#/$defs/boolean_or_jinja_string" + }, + "strategy": { + "type": "string" + }, + "tags": { + "$ref": "#/$defs/string_or_array_of_strings" + }, + "target_database": { + "type": "string" + }, + "target_schema": { + "type": "string" + }, + "unique_key": { + "$ref": "#/$defs/string_or_array_of_strings" + }, + "updated_at": { + "type": "string" + } + } + }, + "data_tests": { + "type": "array", + "items": { + "$ref": "#/$defs/data_tests" + } + }, + "docs": { + "$ref": "#/$defs/docs_config" + }, + "group": { + "$ref": "#/$defs/group_name" + }, + "meta": { + "type": "object" + }, + "tests": { + "type": "array", + "items": { + "$ref": "#/$defs/data_tests" + } + } + }, + "additionalProperties": false + } + }, + "sources": { + "type": "array", + "items": { + "type": "object", + "required": [ + "name" + ], + "properties": { + "name": { + "description": "How you will identify the schema in {{ source() }} calls. Unless `schema` is also set, this will be the name of the schema in the database.", + "type": "string" + }, + "description": { + "type": "string" + }, + "config": { + "type": "object" + }, + "data_tests": { + "type": "array", + "items": { + "$ref": "#/$defs/data_tests" + } + }, + "database": { + "type": "string" + }, + "freshness": { + "$ref": "#/$defs/freshness_definition" + }, + "loaded_at_field": { + "type": "string" + }, + "loader": { + "type": "string" + }, + "meta": { + "type": "object" + }, + "overrides": { + "title": "Package to Override", + "description": "The name of another package installed in your project. If that package has a source with the same name as this one, its properties will be applied on top of the base properties of the overridden source. https://docs.getdbt.com/reference/resource-properties/overrides", + "type": "string" + }, + "quoting": { + "type": "object", + "properties": { + "database": { + "$ref": "#/$defs/boolean_or_jinja_string" + }, + "identifier": { + "$ref": "#/$defs/boolean_or_jinja_string" + }, + "schema": { + "$ref": "#/$defs/boolean_or_jinja_string" + } + }, + "additionalProperties": false + }, + "schema": { + "description": "The schema name as stored in the database. Only needed if you want to use a different `name` than what exists in the database (otherwise `name` is used by default)", + "type": "string" + }, + "tables": { + "type": "array", + "items": { + "type": "object", + "required": [ + "name" + ], + "properties": { + "name": { + "title": "Name", + "description": "How you will identify the table in {{ source() }} calls. Unless `identifier` is also set, this will be the name of the table in the database.", + "type": "string" + }, + "description": { + "type": "string" + }, + "columns": { + "type": "array", + "items": { + "$ref": "#/$defs/column_properties" + } + }, + "external": { + "type": "object" + }, + "freshness": { + "$ref": "#/$defs/freshness_definition" + }, + "identifier": { + "title": "Identifier", + "description": "The table name as stored in the database. Only needed if you want to give the source a different name than what exists in the database (otherwise `name` is used by default)", + "type": "string" + }, + "loaded_at_field": { + "description": "Which column to check during data freshness tests. Only needed if the table has a different loaded_at_field to the one defined on the source overall.", + "type": "string" + }, + "loader": { + "type": "string" + }, + "meta": { + "type": "object" + }, + "quoting": { + "type": "object", + "properties": { + "database": { + "$ref": "#/$defs/boolean_or_jinja_string" + }, + "identifier": { + "$ref": "#/$defs/boolean_or_jinja_string" + }, + "schema": { + "$ref": "#/$defs/boolean_or_jinja_string" + } + }, + "additionalProperties": false + }, + "tags": { + "$ref": "#/$defs/string_or_array_of_strings" + }, + "tests": { + "type": "array", + "items": { + "$ref": "#/$defs/data_tests" + } + } + }, + "additionalProperties": false + } + }, + "tags": { + "$ref": "#/$defs/string_or_array_of_strings" + }, + "tests": { + "type": "array", + "items": { + "$ref": "#/$defs/data_tests" + } + } + } + } + }, + "unit_tests": { + "type": "array", + "items": { + "type": "object", + "required": [ + "name", + "model", + "expect" + ], + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "config": { + "title": "Unit Test Config", + "type": "object", + "properties": { + "meta": { + "type": "object" + }, + "tags": { + "$ref": "#/$defs/string_or_array_of_strings" + } + }, + "additionalProperties": false + }, + "expect": { + "type": "object", + "if": { + "properties": { + "format": { + "const": "dict" + } + } + }, + "then": { + "properties": { + "rows": { + "description": "When `format` is `dict`, each item should be a dictionary containing a key-value pair for each column and its value, e.g. `{id: 1, code: 'ABC'}`", + "type": "array", + "items": { + "type": "object" + } + } + } + }, + "else": { + "properties": { + "rows": { + "description": "When `format` is csv or sql, a string containing comma-separated headers and values. Alternatively provide a fixture. Use the pipe character | to create a multi-line string in YAML.", + "type": "string" + } + } + }, + "properties": { + "fixture": { + "description": "Only relevant when format is csv. Specify the name of a fixture instead of providing `rows`.", + "type": "string" + }, + "format": { + "description": "Defaults to `dict` when not specified", + "type": "string", + "enum": [ + "csv", + "dict", + "sql" + ] + }, + "additionalProperties": false + } + }, + "given": { + "type": "array", + "items": { + "type": "object", + "if": { + "properties": { + "format": { + "const": "dict" + } + } + }, + "then": { + "properties": { + "rows": { + "description": "When `format` is `dict`, each item should be a dictionary containing a key-value pair for each column and its value, e.g. `{id: 1, code: 'ABC'}`", + "type": "array", + "items": { + "type": "object" + } + } + } + }, + "else": { + "properties": { + "rows": { + "description": "When `format` is csv or sql, a string containing comma-separated headers and values. Alternatively provide a fixture. Use the pipe character | to create a multi-line string in YAML.", + "type": "string" + } + } + }, + "properties": { + "fixture": { + "description": "Only relevant when format is csv. Specify the name of a fixture instead of providing `rows`.", + "type": "string" + }, + "format": { + "description": "Defaults to `dict` when not specified", + "type": "string", + "enum": [ + "csv", + "dict", + "sql" + ] + }, + "input": { + "description": "The relation whose inputs you need to mock. Enclose in ref or source without curly braces", + "type": "string", + "examples": [ + "ref('model_b')", + "ref('upstream_project', 'model_b')", + "source('schema', 'table')" + ] + }, + "additionalProperties": false + } + } + }, + "model": { + "description": "The name of the model whose behaviour you are testing. Does not need to be wrapped in a ref.", + "type": "string", + "examples": [ + "my_model" + ] + }, + "overrides": { + "type": "object", + "properties": { + "env_vars": { + "type": "object" + }, + "macros": { + "type": "object", + "examples": [ + { + "is_incremental": "true" + } + ] + }, + "vars": { + "type": "object" + } + }, + "additionalProperties": false + }, + "additionalProperties": false + }, + "additionalProperties": false + } + } + }, + "additionalProperties": false, + "$defs": { + "aggregation_type_params": { + "type": "object", + "properties": { + "percentile": { + "type": "number" + }, + "use_approximate_percentile": { + "type": "boolean" + }, + "use_discrete_percentile": { + "type": "boolean" + } + }, + "additionalProperties": false + }, + "array_of_strings": { + "type": "array", + "items": { + "type": "string" + } + }, + "boolean_or_jinja_string": { + "oneOf": [ + { + "$ref": "#/$defs/jinja_string" + }, + { + "type": "boolean" + } + ], + "additionalProperties": false + }, + "column_properties": { + "type": "object", + "required": [ + "name" + ], + "uniqueItems": true, + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "constraints": { + "$ref": "#/$defs/constraints" + }, + "data_tests": { + "type": "array", + "items": { + "$ref": "#/$defs/data_tests" + } + }, + "data_type": { + "type": "string" + }, + "meta": { + "type": "object" + }, + "policy_tags": { + "title": "Policy tags", + "description": "Configurations, specific to BigQuery adapter, used to set policy tags on specific columns, enabling column-level security. Only relevant when `persist_docs.columns` is true.", + "type": "array", + "items": { + "type": "string" + } + }, + "quote": { + "$ref": "#/$defs/boolean_or_jinja_string" + }, + "tags": { + "$ref": "#/$defs/string_or_array_of_strings" + }, + "tests": { + "type": "array", + "items": { + "$ref": "#/$defs/data_tests" + } + } + }, + "additionalProperties": false + }, + "constraints": { + "type": "array", + "items": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "name": { + "type": "string" + }, + "type": { + "type": "string" + }, + "columns": { + "$ref": "#/$defs/string_or_array_of_strings" + }, + "expression": { + "type": "string" + }, + "warn_unenforced": { + "$ref": "#/$defs/boolean_or_jinja_string" + }, + "warn_unsupported": { + "$ref": "#/$defs/boolean_or_jinja_string" + } + } + } + }, + "conversion_metric_type_params": { + "type": "object", + "properties": { + "conversion_type_params": { + "type": "object", + "required": [ + "entity", + "base_measure", + "conversion_measure" + ], + "properties": { + "base_measure": { + "$ref": "#/$defs/metric_input_measure" + }, + "calculation": { + "type": "string", + "default": "conversion_rate", + "enum": [ + "conversions", + "conversion_rate", + "CONVERSIONS", + "CONVERSION_RATE" + ] + }, + "constant_properties": { + "type": "array", + "items": { + "type": "object", + "required": [ + "base_property", + "conversion_property" + ], + "properties": { + "base_property": { + "description": "DIMENSION or ENTITY", + "type": "string" + }, + "conversion_property": { + "description": "DIMENSION or ENTITY", + "type": "string" + } + } + } + }, + "conversion_measure": { + "$ref": "#/$defs/metric_input_measure" + }, + "entity": { + "description": "The entity to calculate over", + "type": "string" + }, + "window": { + "type": "string" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + "cumulative_metric_type_params": { + "type": "object", + "properties": { + "grain_to_date": { + "enum": [ + "day", + "week", + "month", + "quarter", + "year" + ] + }, + "measure": { + "$ref": "#/$defs/metric_input_measure" + }, + "window": { + "type": "string" + } + }, + "additionalProperties": false + }, + "data_tests": { + "anyOf": [ + { + "type": "string" + }, + { + "title": "Relationships Test", + "type": "object", + "properties": { + "relationships": { + "type": "object", + "required": [ + "to", + "field" + ], + "properties": { + "name": { + "type": "string" + }, + "config": { + "$ref": "#/$defs/test_configs" + }, + "field": { + "title": "Relationships: Field", + "description": "The foreign key column", + "type": "string", + "default": "" + }, + "to": { + "type": "string", + "default": "ref('')", + "examples": [ + "ref('parent_model')", + "source('parent_schema', 'parent_table')" + ] + }, + "where": { + "type": "string" + } + } + } + } + }, + { + "title": "Accepted Values Test", + "type": "object", + "properties": { + "accepted_values": { + "type": "object", + "required": [ + "values" + ], + "properties": { + "name": { + "type": "string" + }, + "config": { + "$ref": "#/$defs/test_configs" + }, + "quote": { + "type": "boolean" + }, + "values": { + "type": "array", + "items": { + "type": "string" + } + }, + "where": { + "type": "string" + } + } + } + } + }, + { + "title": "Not Null Test", + "type": "object", + "properties": { + "not_null": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "config": { + "$ref": "#/$defs/test_configs" + }, + "where": { + "type": "string" + } + } + } + } + }, + { + "title": "Unique Test", + "type": "object", + "properties": { + "unique": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "config": { + "$ref": "#/$defs/test_configs" + }, + "where": { + "type": "string" + } + } + } + } + } + ] + }, + "derived_metric_type_params": { + "type": "object", + "properties": { + "expr": { + "type": "string" + }, + "metrics": { + "type": "array", + "items": { + "$ref": "#/$defs/metric_input_schema" + } + } + }, + "additionalProperties": false + }, + "dimension": { + "type": "object", + "required": [ + "name", + "type" + ], + "anyOf": [ + { + "not": { + "$ref": "#/$defs/is-time-dimension" + } + }, + { + "required": [ + "type_params" + ] + } + ], + "properties": { + "name": { + "type": "string", + "pattern": "(?!.*__).*^[a-z][a-z0-9_]*[a-z0-9]$" + }, + "description": { + "type": "string" + }, + "type": { + "title": "Dimension Type", + "enum": [ + "CATEGORICAL", + "TIME", + "categorical", + "time" + ] + }, + "expr": { + "type": [ + "string", + "boolean" + ] + }, + "is_partition": { + "type": "boolean" + }, + "type_params": { + "$ref": "#/$defs/dimension_type_params" + } + }, + "additionalProperties": false + }, + "dimension_type_params": { + "type": "object", + "required": [ + "time_granularity" + ], + "properties": { + "time_granularity": { + "enum": [ + "DAY", + "WEEK", + "MONTH", + "QUARTER", + "YEAR", + "day", + "week", + "month", + "quarter", + "year" + ] + }, + "validity_params": { + "$ref": "#/$defs/validity_params" + } + }, + "additionalProperties": false + }, + "docs_config": { + "title": "Docs config", + "description": "Configurations for the appearance of nodes in the dbt documentation.", + "type": "object", + "properties": { + "node_color": { + "description": "The color of the node on the DAG in the documentation. It must be an Hex code or a valid CSS color name.", + "type": "string", + "pattern": "^(#[a-fA-F0-9]{3}|#[a-fA-F0-9]{6}|[^#][a-zA-Z]*)$" + }, + "show": { + "type": "boolean", + "default": true + } + }, + "additionalProperties": false + }, + "entity": { + "type": "object", + "required": [ + "name", + "type" + ], + "properties": { + "name": { + "type": "string", + "pattern": "(?!.*__).*^[a-z][a-z0-9_]*[a-z0-9]$" + }, + "type": { + "title": "Entity Type", + "enum": [ + "PRIMARY", + "UNIQUE", + "FOREIGN", + "NATURAL", + "primary", + "unique", + "foreign", + "natural" + ] + }, + "entity": { + "type": "string" + }, + "expr": { + "type": [ + "string", + "boolean" + ] + } + }, + "additionalProperties": false + }, + "export": { + "type": "object", + "required": [ + "name" + ], + "properties": { + "name": { + "type": "string" + }, + "config": { + "title": "Export Config", + "type": "object", + "properties": { + "alias": { + "type": "string" + }, + "export_as": { + "enum": [ + "table", + "view", + "cache" + ] + }, + "schema": { + "type": "string" + } + }, + "additionalProperties": true + } + }, + "additionalProperties": false + }, + "freshness_definition": { + "default": { + "error_after": { + "count": 2, + "period": "day" + }, + "warn_after": { + "count": 1, + "period": "day" + } + }, + "oneOf": [ + { + "type": "object", + "properties": { + "error_after": { + "$ref": "#/$defs/freshness_rules" + }, + "filter": { + "type": "string" + }, + "warn_after": { + "$ref": "#/$defs/freshness_rules" + } + }, + "additionalProperties": false + }, + { + "const": null + } + ] + }, + "freshness_rules": { + "type": "object", + "required": [ + "count", + "period" + ], + "properties": { + "count": { + "$ref": "#/$defs/number_or_jinja_string" + }, + "period": { + "type": "string", + "enum": [ + "minute", + "hour", + "day" + ] + } + }, + "additionalProperties": false + }, + "grants": { + "description": "grant config. each key is a database permission and the value is the grantee of that permission", + "type": "object", + "patternProperties": { + ".*": { + "$ref": "#/$defs/string_or_array_of_strings" + } + }, + "additionalProperties": false + }, + "group_name": { + "type": "string" + }, + "include_exclude": { + "type": "object", + "properties": { + "exclude": { + "$ref": "#/$defs/string_or_array_of_strings" + }, + "include": { + "$ref": "#/$defs/string_or_array_of_strings" + } + } + }, + "is-time-dimension": { + "required": [ + "type" + ], + "properties": { + "type": { + "enum": [ + "TIME", + "time" + ] + } + } + }, + "jinja_string": { + "type": "string", + "pattern": "\\{\\{.*\\}\\}" + }, + "measure": { + "type": "object", + "required": [ + "name", + "agg" + ], + "properties": { + "name": { + "type": "string", + "pattern": "(?!.*__).*^[a-z][a-z0-9_]*[a-z0-9]$" + }, + "description": { + "type": "string" + }, + "agg": { + "enum": [ + "SUM", + "MIN", + "MAX", + "AVG", + "COUNT_DISTINCT", + "SUM_BOOLEAN", + "COUNT", + "PERCENTILE", + "MEDIAN", + "sum", + "min", + "max", + "avg", + "count_distinct", + "sum_boolean", + "count", + "percentile", + "median" + ] + }, + "agg_params": { + "$ref": "#/$defs/aggregation_type_params" + }, + "agg_time_dimension": { + "type": "string", + "pattern": "(?!.*__).*^[a-z][a-z0-9_]*[a-z0-9]$" + }, + "create_metric": { + "type": "boolean" + }, + "create_metric_display_name": { + "type": "string" + }, + "expr": { + "type": [ + "string", + "integer", + "boolean" + ] + }, + "label": { + "type": "string" + }, + "non_additive_dimension": { + "$ref": "#/$defs/non_additive_dimension" + } + }, + "additionalProperties": false + }, + "metric_input_measure": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "fill_nulls_with": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "integer" + } + ] + }, + "filter": { + "type": "string" + }, + "join_to_timespine": { + "type": "boolean" + } + }, + "additionalProperties": false + }, + "metric_input_schema": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "alias": { + "type": "string" + }, + "filter": { + "type": "string" + }, + "offset_window": { + "type": "string" + } + }, + "additionalProperties": false + }, + "model_configs": { + "type": "object", + "properties": { + "auto_refresh": { + "$ref": "#/$defs/boolean_or_jinja_string" + }, + "backup": { + "$ref": "#/$defs/boolean_or_jinja_string" + }, + "contract": { + "type": "object", + "properties": { + "enforced": { + "$ref": "#/$defs/boolean_or_jinja_string" + } + } + }, + "file_format": { + "type": "string" + }, + "grant_access_to": { + "title": "Authorized views", + "description": "Configuration, specific to BigQuery adapter, used to setup authorized views.", + "type": "array", + "items": { + "type": "object", + "required": [ + "database", + "project" + ], + "properties": { + "database": { + "type": "string" + }, + "project": { + "type": "string" + } + }, + "additionalProperties": false + } + }, + "grants": { + "$ref": "#/$defs/grants" + }, + "hours_to_expiration": { + "description": "Configuration specific to BigQuery adapter used to set an expiration delay (in hours) to a table.", + "type": "number" + }, + "kms_key_name": { + "description": "Configuration of the KMS key name, specific to BigQuery adapter.", + "type": "string", + "pattern": "projects/[a-zA-Z0-9_-]*/locations/[a-zA-Z0-9_-]*/keyRings/.*/cryptoKeys/.*" + }, + "labels": { + "title": "Label configs", + "description": "Configuration specific to BigQuery adapter used to add labels and tags to tables/views created by dbt.", + "type": "object", + "patternProperties": { + "^[a-z][a-z0-9_-]{0,62}$": { + "type": "string", + "pattern": "^[a-z0-9_-]{0,63}$" + } + }, + "additionalProperties": false + }, + "location": { + "type": "string" + }, + "materialized": { + "type": "string" + }, + "on_configuration_change": { + "type": "string", + "enum": [ + "apply", + "continue", + "fail" + ] + }, + "on_schema_change": { + "type": "string", + "enum": [ + "append_new_columns", + "fail", + "ignore", + "sync_all_columns" + ] + }, + "snowflake_warehouse": { + "type": "string" + }, + "sql_header": { + "type": "string" + }, + "target_lag": { + "type": "string", + "pattern": "^(?:downstream|\\d+\\s*(?:seconds|minutes|hours|days))$" + } + } + }, + "owner": { + "type": "object", + "anyOf": [ + { + "required": [ + "email" + ] + }, + { + "required": [ + "name" + ] + } + ], + "properties": { + "name": { + "type": "string" + }, + "email": { + "type": "string" + } + }, + "additionalProperties": false + }, + "non_additive_dimension": { + "type": "object", + "required": [ + "name" + ], + "properties": { + "name": { + "type": "string" + }, + "window_choice": { + "enum": [ + "MIN", + "MAX", + "min", + "max" + ] + }, + "window_groupings": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false + }, + "number_or_jinja_string": { + "oneOf": [ + { + "$ref": "#/$defs/jinja_string" + }, + { + "type": "number" + } + ], + "additionalProperties": false + }, + "persist_docs_config": { + "title": "Persist docs config", + "description": "Configurations for the persistence of the dbt documentation.", + "type": "object", + "properties": { + "columns": { + "$ref": "#/$defs/boolean_or_jinja_string", + "default": true + }, + "relation": { + "$ref": "#/$defs/boolean_or_jinja_string", + "default": true + } + }, + "additionalProperties": false + }, + "ratio_metric_type_params": { + "type": "object", + "properties": { + "denominator": { + "$ref": "#/$defs/metric_input_schema" + }, + "filter": { + "type": "string" + }, + "numerator": { + "$ref": "#/$defs/metric_input_schema" + } + }, + "additionalProperties": false + }, + "simple_metric_type_params": { + "type": "object", + "properties": { + "measure": { + "$ref": "#/$defs/metric_input_measure" + } + }, + "additionalProperties": false + }, + "string_or_array_of_strings": { + "oneOf": [ + { + "type": "string" + }, + { + "$ref": "#/$defs/array_of_strings" + } + ] + }, + "test_configs": { + "title": "Test configs", + "description": "Configurations set here will override configs set in dbt_project.yml.", + "type": "object", + "properties": { + "alias": { + "description": "Only relevant when `store_failures` is true", + "type": "string" + }, + "database": { + "description": "Only relevant when `store_failures` is true", + "type": "string" + }, + "enabled": { + "$ref": "#/$defs/boolean_or_jinja_string" + }, + "error_if": { + "type": "string" + }, + "fail_calc": { + "type": "string" + }, + "limit": { + "type": "number" + }, + "schema": { + "description": "Only relevant when `store_failures` is true", + "type": "string" + }, + "severity": { + "oneOf": [ + { + "$ref": "#/$defs/jinja_string" + }, + { + "type": "string", + "enum": [ + "warn", + "error" + ] + } + ] + }, + "store_failures": { + "$ref": "#/$defs/boolean_or_jinja_string" + }, + "tags": { + "$ref": "#/$defs/string_or_array_of_strings" + }, + "warn_if": { + "type": "string" + } + } + }, + "validity_params": { + "type": "object", + "properties": { + "is_end": { + "type": "boolean" + }, + "is_start": { + "type": "boolean" + } + }, + "additionalProperties": false + } + } +} \ No newline at end of file diff --git a/schemas/latest-originals/dependencies-latest.json b/schemas/latest-originals/dependencies-latest.json new file mode 100644 index 0000000..b17802a --- /dev/null +++ b/schemas/latest-originals/dependencies-latest.json @@ -0,0 +1,83 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "object", + "title": "dependencies", + "properties": { + "projects": { + "type": "array", + "items": { + "type": "object", + "required": ["name"], + "properties": { + "name": { + "type": "string" + } + }, + "additionalProperties": false + } + }, + "packages": { + "type": "array", + "items": { + "anyOf": [ + { + "type": "object", + "required": ["package", "version"], + "properties": { + "version": { + "title": "Package version", + "type": ["string", "number", "array"], + "description": "A semantic version string or range, such as [\">=1.0.0\", \"<2.0.0\"]" + }, + "install-prerelease": { + "title": "Install Prerelease", + "type": "boolean", + "description": "Opt in to prerelease versions of a package" + }, + "package": { + "title": "Package identifier", + "type": "string", + "description": "Must be in format `org_name/package_name`. Refer to hub.getdbt.com for installation instructions", + "examples": ["dbt-labs/dbt_utils"], + "pattern": "^[\\w\\-\\.]+/[\\w\\-\\.]+$" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": ["git"], + "properties": { + "git": { + "title": "Git URL", + "type": "string" + }, + "revision": { + "title": "Revision", + "type": "string", + "description": "Pin your package to a specific release by specifying a release name" + }, + "subdirectory": { + "title": "Subdirectory", + "type": "string", + "description": "Only required if the package is nested in a subdirectory of the git project" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "local": { + "type": "string" + } + }, + "additionalProperties": false + } + ] + }, + "minItems": 1 + } + }, + "additionalProperties": false +} diff --git a/schemas/latest-originals/packages-latest.json b/schemas/latest-originals/packages-latest.json new file mode 100644 index 0000000..86cc8a9 --- /dev/null +++ b/schemas/latest-originals/packages-latest.json @@ -0,0 +1,84 @@ +{ + "title": "packages", + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "object", + "required": [ + "packages" + ], + "properties": { + "packages": { + "type": "array", + "items": { + "anyOf": [ + { + "type": "object", + "required": [ + "package", + "version" + ], + "properties": { + "version": { + "title": "Package version", + "type": [ + "string", + "number", + "array" + ], + "description": "A semantic version string or range, such as [\">=1.0.0\", \"<2.0.0\"]" + }, + "install-prerelease": { + "title": "Install Prerelease", + "type": "boolean", + "description": "Opt in to prerelease versions of a package" + }, + "package": { + "title": "Package identifier", + "type": "string", + "description": "Must be in format `org_name/package_name`. Refer to hub.getdbt.com for installation instructions", + "examples": [ + "dbt-labs/dbt_utils" + ], + "pattern": "^[\\w\\-\\.]+/[\\w\\-\\.]+$" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "git" + ], + "properties": { + "git": { + "title": "Git URL", + "type": "string" + }, + "revision": { + "title": "Revision", + "type": "string", + "description": "Pin your package to a specific release by specifying a release name" + }, + "subdirectory": { + "title": "Subdirectory", + "type": "string", + "description": "Only required if the package is nested in a subdirectory of the git project" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "local": { + "type": "string" + } + }, + "additionalProperties": false + } + ] + }, + "minItems": 1 + } + }, + "additionalProperties": false +} diff --git a/schemas/latest-originals/selectors-latest.json b/schemas/latest-originals/selectors-latest.json new file mode 100644 index 0000000..7c818d7 --- /dev/null +++ b/schemas/latest-originals/selectors-latest.json @@ -0,0 +1,153 @@ +{ + "title": "selectors", + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "object", + "required": [ + "selectors" + ], + "properties": { + "selectors": { + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "default": { + "oneOf": [ + { + "type": "string", + "pattern": "\\{\\{.*\\}\\}" + }, + { + "type": "boolean" + } + ], + "additionalProperties": false + }, + "definition": { + "oneOf": [ + { + "$ref": "#/$defs/definition_block" + }, + { + "type": "string" + }, + { + "$ref": "#/$defs/union_block" + } + ] + } + }, + "additionalProperties": false + }, + "minItems": 1 + } + }, + "additionalProperties": false, + "$defs": { + "boolean_or_jinja_string": { + "oneOf": [ + { + "$ref": "#/$defs/jinja_string" + }, + { + "type": "boolean" + } + ], + "additionalProperties": false + }, + "definition_block": { + "type": "object", + "properties": { + "method": { + "type": "string", + "enum": [ + "tag", + "source", + "path", + "file", + "fqn", + "package", + "config", + "test_type", + "test_name", + "state", + "exposure", + "metric", + "result", + "source_status", + "group", + "wildcard" + ] + }, + "value": { + "type": "string" + }, + "children": { + "$ref": "#/$defs/boolean_or_jinja_string" + }, + "parents": { + "$ref": "#/$defs/boolean_or_jinja_string" + }, + "children_depth": { + "type": "number" + }, + "parents_depth": { + "type": "number" + }, + "childrens_parents": { + "$ref": "#/$defs/boolean_or_jinja_string" + }, + "indirect_selection": { + "type": "string", + "enum": ["buildable", "cautious", "eager"] + } + }, + "additionalProperties": true + }, + "exclude_block": { + "type": "array", + "items": { + "anyOf": [ + { + "$ref": "#/$defs/intersection_block" + }, + { + "$ref": "#/$defs/definition_block" + } + ] + } + }, + "intersection_block": { + "type": "array", + "items": { + "$ref": "#/$defs/definition_block" + } + }, + "jinja_string": { + "type": "string", + "pattern": "\\{\\{.*\\}\\}" + }, + "union_block": { + "type": "array", + "items": { + "anyOf": [ + { + "$ref": "#/$defs/intersection_block" + }, + { + "$ref": "#/$defs/definition_block" + }, + { + "$ref": "#/$defs/exclude_block" + } + ] + } + } + } +} diff --git a/schemas/latest/dbt_cloud-latest.json b/schemas/latest/dbt_cloud-latest.json index 70921f0..7e4de33 100644 --- a/schemas/latest/dbt_cloud-latest.json +++ b/schemas/latest/dbt_cloud-latest.json @@ -1,14 +1,24 @@ { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", + "additionalProperties": false, "properties": { "project-id": { + "title": "Project-Id", "type": "string" }, "defer-env-id": { - "type": "string" + "anyOf": [ + { + "type": "string" + } + ], + "default": null, + "title": "Defer-Env-Id" } }, - "required": ["project-id"], - "additionalProperties": false -} + "required": [ + "project-id" + ], + "title": "DbtCloud", + "type": "object", + "$schema": "http://json-schema.org/draft-07/schema#" +} \ No newline at end of file diff --git a/schemas/latest/dbt_project-latest.json b/schemas/latest/dbt_project-latest.json index db6bdf0..96a43be 100644 --- a/schemas/latest/dbt_project-latest.json +++ b/schemas/latest/dbt_project-latest.json @@ -1,1112 +1,2329 @@ { - "title": "dbt_project", - "type": "object", - "required": [ - "name" - ], - "$schema": "http://json-schema.org/draft-07/schema#", - "properties": { - "version": { + "$defs": { + "Access": { + "enum": [ + "private", + "protected", + "public" + ], + "title": "Access", "type": "string" }, - "name": { + "Alias": { + "title": "Alias", "type": "string" }, - "analysis-paths": { - "$ref": "#/$defs/array_of_strings" - }, - "asset-paths": { - "$ref": "#/$defs/array_of_strings" - }, - "clean-targets": { - "$ref": "#/$defs/array_of_strings" - }, - "config-version": { - "type": "number", - "default": 2 - }, - "data_tests": { - "$ref": "#/$defs/data_test_configs" - }, - "dbt-cloud": { - "type": "object", - "properties": { - "project-id": { - "type": "number" - } - }, - "additionalProperties": true - }, - "dispatch": { - "type": "array", + "ArrayOfStrings": { "items": { - "type": "object", - "required": [ - "macro_namespace", - "search_order" - ], - "properties": { - "macro_namespace": { - "type": "string" - }, - "search_order": { - "$ref": "#/$defs/array_of_strings" - } - }, - "additionalProperties": false - } - }, - "docs-paths": { - "$ref": "#/$defs/array_of_strings" + "type": "string" + }, + "title": "ArrayOfStrings", + "type": "array" }, - "flags": { - "type": "object", + "AuthorizedView": { + "additionalProperties": false, "properties": { - "cache_selected_only": { - "type": "boolean" - }, - "debug": { - "type": "boolean" - }, - "fail_fast": { - "type": "boolean" - }, - "indirect_selection": { - "type": "string" - }, - "log_format": { - "type": "string" - }, - "log_format_file": { - "type": "string" - }, - "log_level": { - "type": "string" - }, - "log_level_file": { - "type": "string" - }, - "partial_parse": { - "type": "boolean" - }, - "populate_cache": { - "type": "boolean" - }, - "printer_width": { - "type": "integer" - }, - "require_explicit_package_overrides_for_builtin_materializations": { - "type": "boolean" - }, - "require_resource_names_without_spaces": { - "type": "boolean" - }, - "send_anonymous_usage_stats": { - "type": "boolean" - }, - "source_freshness_run_project_hooks": { - "type": "boolean" - }, - "static_parser": { - "type": "boolean" - }, - "use_colors": { - "type": "boolean" - }, - "use_colors_file": { - "type": "boolean" - }, - "use_experimental_parser": { - "type": "boolean" - }, - "version_check": { - "type": "boolean" - }, - "warn_error": { - "type": "boolean" - }, - "warn_error_options": { - "type": "object" + "database": { + "anyOf": [ + { + "type": "string" + } + ], + "default": null, + "title": "Database" }, - "write_json": { - "type": "boolean" + "project": { + "anyOf": [ + { + "type": "string" + } + ], + "default": null, + "title": "Project" } - } - }, - "log-path": { - "type": "string" - }, - "macro-paths": { - "$ref": "#/$defs/array_of_strings" - }, - "model-paths": { - "$ref": "#/$defs/array_of_strings" + }, + "title": "AuthorizedView", + "type": "object" }, - "models": { - "$ref": "#/$defs/model_configs" + "AuthorizedViews": { + "description": "Configuration, specific to BigQuery adapter, used to setup authorized views.", + "items": { + "$ref": "#/$defs/AuthorizedView" + }, + "title": "AuthorizedViews", + "type": "array" }, - "on-run-end": { - "anyOf": [ - { - "$ref": "#/$defs/array_of_strings" - }, + "AutoRefresh": { + "allOf": [ { - "type": "string" + "$ref": "#/$defs/BooleanOrJinjaString" } - ] + ], + "title": "AutoRefresh" }, - "on-run-start": { - "anyOf": [ + "Backup": { + "allOf": [ { - "$ref": "#/$defs/array_of_strings" - }, - { - "type": "string" + "$ref": "#/$defs/BooleanOrJinjaString" } - ] - }, - "packages-install-path": { - "type": "string" - }, - "profile": { - "type": "string" + ], + "title": "Backup" }, - "query-comment": { - "oneOf": [ + "BooleanOrJinjaString": { + "anyOf": [ { - "type": "string" + "$ref": "#/$defs/JinjaString" }, { - "type": "object", - "properties": { - "append": { - "$ref": "#/$defs/boolean_or_jinja_string" - }, - "comment": { - "type": "string" - }, - "job-label": { - "$ref": "#/$defs/boolean_or_jinja_string" - } - }, - "additionalProperties": false - } - ] - }, - "quoting": { - "type": "object", - "properties": { - "database": { - "$ref": "#/$defs/boolean_or_jinja_string" - }, - "identifier": { - "$ref": "#/$defs/boolean_or_jinja_string" - }, - "schema": { - "$ref": "#/$defs/boolean_or_jinja_string" + "type": "boolean" } - } - }, - "require-dbt-version": { - "$ref": "#/$defs/string_or_array_of_strings" - }, - "seed-paths": { - "$ref": "#/$defs/array_of_strings" - }, - "seeds": { - "$ref": "#/$defs/seed_configs" - }, - "snapshot-paths": { - "$ref": "#/$defs/array_of_strings" - }, - "snapshots": { - "$ref": "#/$defs/snapshot_configs" - }, - "sources": { - "$ref": "#/$defs/source_configs" - }, - "target-path": { - "type": "string" - }, - "test-paths": { - "$ref": "#/$defs/array_of_strings" - }, - "tests": { - "$ref": "#/$defs/data_test_configs" - }, - "unit_tests": { - "$ref": "#/$defs/unit_test_configs" - }, - "vars": { - "type": "object" - } - }, - "additionalProperties": false, - "$defs": { - "access": { - "type": "string", - "enum": [ - "private", - "protected", - "public" - ] - }, - "alias": { - "type": "string" + ], + "title": "BooleanOrJinjaString" }, - "array_of_strings": { - "type": "array", - "items": { + "ColumnTypes": { + "additionalProperties": { "type": "string" - } - }, - "auto_refresh": { - "$ref": "#/$defs/boolean_or_jinja_string" - }, - "backup": { - "$ref": "#/$defs/boolean_or_jinja_string" - }, - "boolean_or_jinja_string": { - "oneOf": [ - { - "$ref": "#/$defs/jinja_string" - }, - { - "type": "boolean" - } - ] + }, + "title": "ColumnTypes", + "type": "object" }, - "column_types": { - "type": "object", - "patternProperties": { - "": { - "type": "string" + "Contract": { + "properties": { + "enforced": { + "$ref": "#/$defs/BooleanOrJinjaString" } - } - }, - "contract": { - "type": "object", + }, "required": [ "enforced" ], - "properties": { - "enforced": { - "$ref": "#/$defs/boolean_or_jinja_string", - "default": "true" - } - } + "title": "Contract", + "type": "object" }, - "data_test_configs": { - "title": "Data test configs", - "description": "Configurations set in the dbt_project.yml file will apply to all tests that don't have a more specific configuration set.", - "type": "object", + "DataTestConfigs": { "properties": { "+alias": { - "$ref": "#/$defs/alias" + "anyOf": [ + { + "$ref": "#/$defs/Alias" + } + ], + "default": null }, "+database": { - "$ref": "#/$defs/database" + "anyOf": [ + { + "$ref": "#/$defs/Database" + } + ], + "default": null }, "+enabled": { - "$ref": "#/$defs/boolean_or_jinja_string" + "anyOf": [ + { + "$ref": "#/$defs/BooleanOrJinjaString" + } + ], + "default": null }, "+error_if": { - "$ref": "#/$defs/error_if" + "anyOf": [ + { + "$ref": "#/$defs/ErrorIf" + } + ], + "default": null }, "+fail_calc": { - "$ref": "#/$defs/fail_calc" + "anyOf": [ + { + "$ref": "#/$defs/FailCalc" + } + ], + "default": null }, "+group": { - "$ref": "#/$defs/group" + "anyOf": [ + { + "$ref": "#/$defs/Group" + } + ], + "default": null }, "+limit": { - "$ref": "#/$defs/limit" + "anyOf": [ + { + "$ref": "#/$defs/Limit" + } + ], + "default": null }, "+meta": { - "$ref": "#/$defs/meta" + "anyOf": [ + { + "$ref": "#/$defs/Meta" + } + ], + "default": null }, "+schema": { - "$ref": "#/$defs/schema" + "anyOf": [ + { + "$ref": "#/$defs/Schema" + } + ], + "default": null }, "+severity": { - "$ref": "#/$defs/severity" + "anyOf": [ + { + "$ref": "#/$defs/Severity" + } + ], + "default": null }, "+store_failures": { - "$ref": "#/$defs/boolean_or_jinja_string" + "anyOf": [ + { + "$ref": "#/$defs/BooleanOrJinjaString" + } + ], + "default": null }, "+tags": { - "$ref": "#/$defs/tags" + "anyOf": [ + { + "$ref": "#/$defs/Tags" + } + ], + "default": null }, "+warn_if": { - "$ref": "#/$defs/warn_if" + "anyOf": [ + { + "$ref": "#/$defs/WarnIf" + } + ], + "default": null }, "alias": { - "$ref": "#/$defs/alias" + "anyOf": [ + { + "$ref": "#/$defs/Alias" + } + ], + "default": null }, "database": { - "$ref": "#/$defs/database" + "anyOf": [ + { + "$ref": "#/$defs/Database" + } + ], + "default": null }, "enabled": { - "$ref": "#/$defs/boolean_or_jinja_string" + "anyOf": [ + { + "$ref": "#/$defs/BooleanOrJinjaString" + } + ], + "default": null }, "error_if": { - "$ref": "#/$defs/error_if" + "anyOf": [ + { + "$ref": "#/$defs/ErrorIf" + } + ], + "default": null }, "fail_calc": { - "$ref": "#/$defs/fail_calc" + "anyOf": [ + { + "$ref": "#/$defs/FailCalc" + } + ], + "default": null }, "group": { - "$ref": "#/$defs/group" + "anyOf": [ + { + "$ref": "#/$defs/Group" + } + ], + "default": null }, "limit": { - "$ref": "#/$defs/limit" + "anyOf": [ + { + "$ref": "#/$defs/Limit" + } + ], + "default": null }, "meta": { - "$ref": "#/$defs/meta" + "anyOf": [ + { + "$ref": "#/$defs/Meta" + } + ], + "default": null }, "schema": { - "$ref": "#/$defs/schema" + "anyOf": [ + { + "$ref": "#/$defs/Schema" + } + ], + "default": null }, "severity": { - "$ref": "#/$defs/severity" + "anyOf": [ + { + "$ref": "#/$defs/Severity" + } + ], + "default": null }, "store_failures": { - "$ref": "#/$defs/boolean_or_jinja_string" + "anyOf": [ + { + "$ref": "#/$defs/BooleanOrJinjaString" + } + ], + "default": null }, "tags": { - "$ref": "#/$defs/tags" + "anyOf": [ + { + "$ref": "#/$defs/Tags" + } + ], + "default": null }, "warn_if": { - "$ref": "#/$defs/warn_if" + "anyOf": [ + { + "$ref": "#/$defs/WarnIf" + } + ], + "default": null } }, - "additionalProperties": { - "oneOf": [ - { - "$ref": "#/$defs/data_test_configs" - }, - { - "$ref": "#/$defs/empty_directory" - } - ] - } + "title": "DataTestConfigs", + "type": "object" }, - "database": { + "Database": { + "title": "Database", "type": "string" }, - "docs_config": { - "title": "Docs config", - "description": "Configurations for the appearance of nodes in the dbt documentation.", - "type": "object", + "DbtCloud": { + "additionalProperties": true, + "properties": { + "project-id": { + "anyOf": [ + { + "type": "number" + } + ], + "default": null, + "title": "Project-Id" + } + }, + "title": "DbtCloud", + "type": "object" + }, + "DispatchItem": { + "additionalProperties": false, + "properties": { + "macro_namespace": { + "title": "Macro Namespace", + "type": "string" + }, + "search_order": { + "$ref": "#/$defs/ArrayOfStrings" + } + }, + "required": [ + "macro_namespace", + "search_order" + ], + "title": "DispatchItem", + "type": "object" + }, + "DocsConfig": { + "additionalProperties": false, "properties": { "node_color": { + "anyOf": [ + { + "pattern": "^(#[a-fA-F0-9]{3}|#[a-fA-F0-9]{6}|[^#][a-zA-Z]*)$", + "type": "string" + } + ], + "default": null, "description": "The color of the node on the DAG in the documentation. It must be an Hex code or a valid CSS color name.", - "type": "string", - "pattern": "^(#[a-fA-F0-9]{3}|#[a-fA-F0-9]{6}|[^#][a-zA-Z]*)$" + "title": "Node Color" }, "show": { - "type": "boolean", - "default": true + "anyOf": [ + { + "type": "boolean" + } + ], + "default": true, + "title": "Show" } }, - "additionalProperties": false - }, - "empty_directory": { - "type": "null" + "title": "DocsConfig", + "type": "object" }, - "error_if": { + "ErrorIf": { + "title": "ErrorIf", "type": "string" }, - "fail_calc": { + "FailCalc": { + "title": "FailCalc", "type": "string" }, - "file_format": { + "FileFormat": { + "title": "FileFormat", "type": "string" }, - "grant_access_to": { - "title": "Authorized views", - "description": "Configuration, specific to BigQuery adapter, used to setup authorized views.", - "type": "array", - "items": { - "type": "object", - "properties": { - "database": { - "type": "string" - }, - "project": { - "type": "string" - } + "Flags": { + "properties": { + "cache_selected_only": { + "anyOf": [ + { + "type": "boolean" + } + ], + "default": null, + "title": "Cache Selected Only" }, - "additionalProperties": false - } - }, - "grants": { - "description": "grant config. each key is a database permission and the value is the grantee of that permission", - "type": "object", - "patternProperties": { - ".*": { - "$ref": "#/$defs/string_or_array_of_strings" + "debug": { + "anyOf": [ + { + "type": "boolean" + } + ], + "default": null, + "title": "Debug" + }, + "fail_fast": { + "anyOf": [ + { + "type": "boolean" + } + ], + "default": null, + "title": "Fail Fast" + }, + "indirect_selection": { + "anyOf": [ + { + "type": "string" + } + ], + "default": null, + "title": "Indirect Selection" + }, + "log_format": { + "anyOf": [ + { + "type": "string" + } + ], + "default": null, + "title": "Log Format" + }, + "log_format_file": { + "anyOf": [ + { + "type": "string" + } + ], + "default": null, + "title": "Log Format File" + }, + "log_level": { + "anyOf": [ + { + "type": "string" + } + ], + "default": null, + "title": "Log Level" + }, + "log_level_file": { + "anyOf": [ + { + "type": "string" + } + ], + "default": null, + "title": "Log Level File" + }, + "partial_parse": { + "anyOf": [ + { + "type": "boolean" + } + ], + "default": null, + "title": "Partial Parse" + }, + "populate_cache": { + "anyOf": [ + { + "type": "boolean" + } + ], + "default": null, + "title": "Populate Cache" + }, + "printer_width": { + "anyOf": [ + { + "type": "integer" + } + ], + "default": null, + "title": "Printer Width" + }, + "require_explicit_package_overrides_for_builtin_materializations": { + "anyOf": [ + { + "type": "boolean" + } + ], + "default": null, + "title": "Require Explicit Package Overrides For Builtin Materializations" + }, + "require_resource_names_without_spaces": { + "anyOf": [ + { + "type": "boolean" + } + ], + "default": null, + "title": "Require Resource Names Without Spaces" + }, + "send_anonymous_usage_stats": { + "anyOf": [ + { + "type": "boolean" + } + ], + "default": null, + "title": "Send Anonymous Usage Stats" + }, + "source_freshness_run_project_hooks": { + "anyOf": [ + { + "type": "boolean" + } + ], + "default": null, + "title": "Source Freshness Run Project Hooks" + }, + "static_parser": { + "anyOf": [ + { + "type": "boolean" + } + ], + "default": null, + "title": "Static Parser" + }, + "use_colors": { + "anyOf": [ + { + "type": "boolean" + } + ], + "default": null, + "title": "Use Colors" + }, + "use_colors_file": { + "anyOf": [ + { + "type": "boolean" + } + ], + "default": null, + "title": "Use Colors File" + }, + "use_experimental_parser": { + "anyOf": [ + { + "type": "boolean" + } + ], + "default": null, + "title": "Use Experimental Parser" + }, + "version_check": { + "anyOf": [ + { + "type": "boolean" + } + ], + "default": null, + "title": "Version Check" + }, + "warn_error": { + "anyOf": [ + { + "type": "boolean" + } + ], + "default": null, + "title": "Warn Error" + }, + "warn_error_options": { + "anyOf": [ + { + "type": "object" + } + ], + "default": null, + "title": "Warn Error Options" + }, + "write_json": { + "anyOf": [ + { + "type": "boolean" + } + ], + "default": null, + "title": "Write Json" } }, - "additionalProperties": false + "title": "Flags", + "type": "object" + }, + "Grants": { + "additionalProperties": { + "$ref": "#/$defs/StringOrArrayOfStrings" + }, + "description": "grant config. each key is a database permission and the value is the grantee of that permission", + "title": "Grants", + "type": "object" }, - "group": { + "Group": { + "title": "Group", "type": "string" }, - "hours_to_expiration": { + "HoursToExpiration": { "description": "Configuration specific to BigQuery adapter used to set an expiration delay (in hours) to a table.", + "title": "HoursToExpiration", "type": "number" }, - "incremental_strategy": { + "IncrementalStrategy": { + "title": "IncrementalStrategy", "type": "string" }, - "invalidate_hard_deletes": { - "$ref": "#/$defs/boolean_or_jinja_string" + "InvalidateHardDeletes": { + "allOf": [ + { + "$ref": "#/$defs/BooleanOrJinjaString" + } + ], + "title": "InvalidateHardDeletes" }, - "jinja_string": { - "type": "string", - "pattern": "\\{\\{.*\\}\\}" + "JinjaString": { + "pattern": "\\{\\{.*\\}\\}", + "title": "JinjaString", + "type": "string" }, - "kms_key_name": { + "KmsKeyName": { "description": "Configuration, specific to BigQuery adapter, of the KMS key name used for data encryption.", + "title": "KmsKeyName", "type": "string" }, - "label_configs": { - "title": "Label configs", - "description": "Configurations specific to BigQuery adapter used to add labels and tags to tables & views created by dbt.", - "type": "object", - "patternProperties": { - "^[a-z][a-z0-9_-]{0,63}$": { - "oneOf": [ - { - "type": "string", - "pattern": "^[a-z0-9_-]{0,64}$" - }, - { - "$ref": "#/$defs/jinja_string" - } - ] - } + "LabelConfigs": { + "pattern": "^[a-z0-9_-]{0,64}$", + "title": "LabelConfigs", + "type": "string" + }, + "LabelConfigs1": { + "additionalProperties": { + "anyOf": [ + { + "$ref": "#/$defs/LabelConfigs" + }, + { + "$ref": "#/$defs/JinjaString" + } + ] }, - "additionalProperties": false + "description": "Configurations specific to BigQuery adapter used to add labels and tags to tables & views created by dbt.", + "title": "LabelConfigs1", + "type": "object" }, - "limit": { + "Limit": { + "title": "Limit", "type": "number" }, - "location": { + "Location": { + "title": "Location", "type": "string" }, - "materialized": { + "Materialized": { + "title": "Materialized", "type": "string" }, - "meta": { + "Meta": { + "properties": {}, + "title": "Meta", "type": "object" }, - "model_configs": { - "title": "Model configs", - "description": "Configurations set in the dbt_project.yml file will apply to all models that don't have a more specific configuration set.", - "type": "object", + "ModelConfigs": { "properties": { "+access": { - "$ref": "#/$defs/access" + "anyOf": [ + { + "$ref": "#/$defs/Access" + } + ], + "default": null }, "+alias": { - "$ref": "#/$defs/alias" + "anyOf": [ + { + "$ref": "#/$defs/Alias" + } + ], + "default": null }, "+auto_refresh": { - "$ref": "#/$defs/auto_refresh" + "anyOf": [ + { + "$ref": "#/$defs/AutoRefresh" + } + ], + "default": null }, "+backup": { - "$ref": "#/$defs/backup" + "anyOf": [ + { + "$ref": "#/$defs/Backup" + } + ], + "default": null }, "+bind": { - "$ref": "#/$defs/boolean_or_jinja_string", + "anyOf": [ + { + "$ref": "#/$defs/BooleanOrJinjaString" + } + ], "default": false }, "+contract": { - "$ref": "#/$defs/contract" + "anyOf": [ + { + "$ref": "#/$defs/Contract" + } + ], + "default": null }, "+copy_grants": { - "$ref": "#/$defs/boolean_or_jinja_string" + "anyOf": [ + { + "$ref": "#/$defs/BooleanOrJinjaString" + } + ], + "default": null }, "+database": { - "$ref": "#/$defs/database" + "anyOf": [ + { + "$ref": "#/$defs/Database" + } + ], + "default": null }, "+docs": { - "$ref": "#/$defs/docs_config" + "anyOf": [ + { + "$ref": "#/$defs/DocsConfig" + } + ], + "default": null }, "+enabled": { - "$ref": "#/$defs/boolean_or_jinja_string" + "anyOf": [ + { + "$ref": "#/$defs/BooleanOrJinjaString" + } + ], + "default": null }, "+file_format": { - "$ref": "#/$defs/file_format" + "anyOf": [ + { + "$ref": "#/$defs/FileFormat" + } + ], + "default": null }, "+full_refresh": { - "$ref": "#/$defs/boolean_or_jinja_string" + "anyOf": [ + { + "$ref": "#/$defs/BooleanOrJinjaString" + } + ], + "default": null }, "+grant_access_to": { - "$ref": "#/$defs/grant_access_to" + "anyOf": [ + { + "$ref": "#/$defs/AuthorizedViews" + } + ], + "default": null }, "+grants": { - "$ref": "#/$defs/grants" + "anyOf": [ + { + "$ref": "#/$defs/Grants" + } + ], + "default": null }, "+group": { - "$ref": "#/$defs/group" + "anyOf": [ + { + "$ref": "#/$defs/Group" + } + ], + "default": null }, "+hours_to_expiration": { - "$ref": "#/$defs/hours_to_expiration" + "anyOf": [ + { + "$ref": "#/$defs/HoursToExpiration" + } + ], + "default": null }, "+incremental_strategy": { - "$ref": "#/$defs/incremental_strategy" + "anyOf": [ + { + "$ref": "#/$defs/IncrementalStrategy" + } + ], + "default": null }, "+kms_key_name": { - "$ref": "#/$defs/kms_key_name" + "anyOf": [ + { + "$ref": "#/$defs/KmsKeyName" + } + ], + "default": null }, "+labels": { - "$ref": "#/$defs/label_configs" + "anyOf": [ + { + "$ref": "#/$defs/LabelConfigs1" + } + ], + "default": null }, "+location": { - "$ref": "#/$defs/location" + "anyOf": [ + { + "$ref": "#/$defs/Location" + } + ], + "default": null }, "+materialized": { - "$ref": "#/$defs/materialized" + "anyOf": [ + { + "$ref": "#/$defs/Materialized" + } + ], + "default": null }, "+meta": { - "$ref": "#/$defs/meta" + "anyOf": [ + { + "$ref": "#/$defs/Meta" + } + ], + "default": null }, "+on_configuration_change": { - "$ref": "#/$defs/on_configuration_change" + "anyOf": [ + { + "$ref": "#/$defs/OnConfigurationChange" + } + ], + "default": null }, "+on_schema_change": { - "$ref": "#/$defs/on_schema_change" + "anyOf": [ + { + "$ref": "#/$defs/OnSchemaChange" + } + ], + "default": null }, "+persist_docs": { - "$ref": "#/$defs/persist_docs_config" + "anyOf": [ + { + "$ref": "#/$defs/PersistDocsConfig" + } + ], + "default": null }, "+post-hook": { - "$ref": "#/$defs/array_of_strings" + "anyOf": [ + { + "$ref": "#/$defs/ArrayOfStrings" + } + ], + "default": null }, "+pre-hook": { - "$ref": "#/$defs/array_of_strings" + "anyOf": [ + { + "$ref": "#/$defs/ArrayOfStrings" + } + ], + "default": null }, "+schema": { - "$ref": "#/$defs/schema" + "anyOf": [ + { + "$ref": "#/$defs/Schema" + } + ], + "default": null }, "+secure": { - "$ref": "#/$defs/boolean_or_jinja_string", + "anyOf": [ + { + "$ref": "#/$defs/BooleanOrJinjaString" + } + ], "default": false }, "+snowflake_warehouse": { - "$ref": "#/$defs/snowflake_warehouse" + "anyOf": [ + { + "$ref": "#/$defs/SnowflakeWarehouse" + } + ], + "default": null }, "+sql_header": { - "$ref": "#/$defs/sql_header" + "anyOf": [ + { + "$ref": "#/$defs/SqlHeader" + } + ], + "default": null }, "+tags": { - "$ref": "#/$defs/tags" + "anyOf": [ + { + "$ref": "#/$defs/Tags" + } + ], + "default": null }, "+target_lag": { - "$ref": "#/$defs/target_lag" + "anyOf": [ + { + "$ref": "#/$defs/TargetLag" + } + ], + "default": null }, "+transient": { - "$ref": "#/$defs/boolean_or_jinja_string" + "anyOf": [ + { + "$ref": "#/$defs/BooleanOrJinjaString" + } + ], + "default": null }, "access": { - "$ref": "#/$defs/access" + "anyOf": [ + { + "$ref": "#/$defs/Access" + } + ], + "default": null }, "alias": { - "$ref": "#/$defs/alias" + "anyOf": [ + { + "$ref": "#/$defs/Alias" + } + ], + "default": null }, "auto_refresh": { - "$ref": "#/$defs/auto_refresh" + "anyOf": [ + { + "$ref": "#/$defs/AutoRefresh" + } + ], + "default": null }, "backup": { - "$ref": "#/$defs/backup" + "anyOf": [ + { + "$ref": "#/$defs/Backup" + } + ], + "default": null }, "bind": { - "$ref": "#/$defs/boolean_or_jinja_string", + "anyOf": [ + { + "$ref": "#/$defs/BooleanOrJinjaString" + } + ], "default": false }, "contract": { - "$ref": "#/$defs/contract" + "anyOf": [ + { + "$ref": "#/$defs/Contract" + } + ], + "default": null }, "copy_grants": { - "$ref": "#/$defs/boolean_or_jinja_string" + "anyOf": [ + { + "$ref": "#/$defs/BooleanOrJinjaString" + } + ], + "default": null }, "database": { - "$ref": "#/$defs/database" + "anyOf": [ + { + "$ref": "#/$defs/Database" + } + ], + "default": null }, "docs": { - "$ref": "#/$defs/docs_config" + "anyOf": [ + { + "$ref": "#/$defs/DocsConfig" + } + ], + "default": null }, "enabled": { - "$ref": "#/$defs/boolean_or_jinja_string" - }, + "anyOf": [ + { + "$ref": "#/$defs/BooleanOrJinjaString" + } + ], + "default": null + }, "file_format": { - "$ref": "#/$defs/file_format" + "anyOf": [ + { + "$ref": "#/$defs/FileFormat" + } + ], + "default": null }, "full_refresh": { - "$ref": "#/$defs/boolean_or_jinja_string" + "anyOf": [ + { + "$ref": "#/$defs/BooleanOrJinjaString" + } + ], + "default": null }, "grant_access_to": { - "$ref": "#/$defs/grant_access_to" + "anyOf": [ + { + "$ref": "#/$defs/AuthorizedViews" + } + ], + "default": null }, "grants": { - "$ref": "#/$defs/grants" + "anyOf": [ + { + "$ref": "#/$defs/Grants" + } + ], + "default": null }, "group": { - "$ref": "#/$defs/group" + "anyOf": [ + { + "$ref": "#/$defs/Group" + } + ], + "default": null }, "hours_to_expiration": { - "$ref": "#/$defs/hours_to_expiration" + "anyOf": [ + { + "$ref": "#/$defs/HoursToExpiration" + } + ], + "default": null }, "incremental_strategy": { - "$ref": "#/$defs/incremental_strategy" + "anyOf": [ + { + "$ref": "#/$defs/IncrementalStrategy" + } + ], + "default": null }, "kms_key_name": { - "$ref": "#/$defs/kms_key_name" + "anyOf": [ + { + "$ref": "#/$defs/KmsKeyName" + } + ], + "default": null }, "labels": { - "$ref": "#/$defs/label_configs" + "anyOf": [ + { + "$ref": "#/$defs/LabelConfigs1" + } + ], + "default": null }, "location": { - "$ref": "#/$defs/location" + "anyOf": [ + { + "$ref": "#/$defs/Location" + } + ], + "default": null }, "materialized": { - "$ref": "#/$defs/materialized" + "anyOf": [ + { + "$ref": "#/$defs/Materialized" + } + ], + "default": null }, "meta": { - "$ref": "#/$defs/meta" + "anyOf": [ + { + "$ref": "#/$defs/Meta" + } + ], + "default": null }, "on_configuration_change": { - "$ref": "#/$defs/on_configuration_change" + "anyOf": [ + { + "$ref": "#/$defs/OnConfigurationChange" + } + ], + "default": null }, "on_schema_change": { - "$ref": "#/$defs/on_schema_change" + "anyOf": [ + { + "$ref": "#/$defs/OnSchemaChange" + } + ], + "default": null }, "persist_docs": { - "$ref": "#/$defs/persist_docs_config" + "anyOf": [ + { + "$ref": "#/$defs/PersistDocsConfig" + } + ], + "default": null }, "post-hook": { - "$ref": "#/$defs/array_of_strings" + "anyOf": [ + { + "$ref": "#/$defs/ArrayOfStrings" + } + ], + "default": null }, "pre-hook": { - "$ref": "#/$defs/array_of_strings" + "anyOf": [ + { + "$ref": "#/$defs/ArrayOfStrings" + } + ], + "default": null }, "schema": { - "$ref": "#/$defs/schema" + "anyOf": [ + { + "$ref": "#/$defs/Schema" + } + ], + "default": null }, "secure": { - "$ref": "#/$defs/boolean_or_jinja_string", + "anyOf": [ + { + "$ref": "#/$defs/BooleanOrJinjaString" + } + ], "default": false }, "snowflake_warehouse": { - "$ref": "#/$defs/snowflake_warehouse" + "anyOf": [ + { + "$ref": "#/$defs/SnowflakeWarehouse" + } + ], + "default": null }, "sql_header": { - "$ref": "#/$defs/sql_header" + "anyOf": [ + { + "$ref": "#/$defs/SqlHeader" + } + ], + "default": null }, "tags": { - "$ref": "#/$defs/tags" + "anyOf": [ + { + "$ref": "#/$defs/Tags" + } + ], + "default": null }, "target_lag": { - "$ref": "#/$defs/target_lag" + "anyOf": [ + { + "$ref": "#/$defs/TargetLag" + } + ], + "default": null }, "transient": { - "$ref": "#/$defs/boolean_or_jinja_string" + "anyOf": [ + { + "$ref": "#/$defs/BooleanOrJinjaString" + } + ], + "default": null } }, - "additionalProperties": { - "oneOf": [ - { - "$ref": "#/$defs/model_configs" - }, - { - "$ref": "#/$defs/empty_directory" - } - ] - } + "title": "ModelConfigs", + "type": "object" }, - "on_configuration_change": { - "type": "string", + "OnConfigurationChange": { "enum": [ "apply", "continue", "fail" - ] + ], + "title": "OnConfigurationChange", + "type": "string" }, - "on_schema_change": { - "type": "string", + "OnSchemaChange": { "enum": [ "append_new_columns", "fail", "ignore", "sync_all_columns" - ] + ], + "title": "OnSchemaChange", + "type": "string" }, - "persist_docs_config": { - "title": "Persist docs config", - "description": "Configurations for the persistence of the dbt documentation.", - "type": "object", + "PersistDocsConfig": { + "additionalProperties": false, "properties": { "columns": { - "$ref": "#/$defs/boolean_or_jinja_string", - "default": true + "anyOf": [ + { + "$ref": "#/$defs/BooleanOrJinjaString" + } + ] }, "relation": { - "$ref": "#/$defs/boolean_or_jinja_string", - "default": true + "anyOf": [ + { + "$ref": "#/$defs/BooleanOrJinjaString" + } + ] + } + }, + "title": "PersistDocsConfig", + "type": "object" + }, + "QueryComment": { + "additionalProperties": false, + "properties": { + "append": { + "anyOf": [ + { + "$ref": "#/$defs/BooleanOrJinjaString" + } + ], + "default": null + }, + "comment": { + "anyOf": [ + { + "type": "string" + } + ], + "default": null, + "title": "Comment" + }, + "job-label": { + "anyOf": [ + { + "$ref": "#/$defs/BooleanOrJinjaString" + } + ], + "default": null + } + }, + "title": "QueryComment", + "type": "object" + }, + "Quoting": { + "properties": { + "database": { + "anyOf": [ + { + "$ref": "#/$defs/BooleanOrJinjaString" + } + ], + "default": null + }, + "identifier": { + "anyOf": [ + { + "$ref": "#/$defs/BooleanOrJinjaString" + } + ], + "default": null + }, + "schema": { + "anyOf": [ + { + "$ref": "#/$defs/BooleanOrJinjaString" + } + ], + "default": null } }, - "additionalProperties": false + "title": "Quoting", + "type": "object" }, - "schema": { - "type": [ - "string", - "null" - ] + "Schema": { + "anyOf": [ + { + "type": "string" + } + ], + "title": "Schema" }, - "seed_configs": { - "title": "Seed configs", - "type": "object", + "SeedConfigs": { "properties": { "+column_types": { - "$ref": "#/$defs/column_types" + "anyOf": [ + { + "$ref": "#/$defs/ColumnTypes" + } + ], + "default": null }, "+copy_grants": { - "$ref": "#/$defs/boolean_or_jinja_string" + "anyOf": [ + { + "$ref": "#/$defs/BooleanOrJinjaString" + } + ], + "default": null }, "+database": { - "$ref": "#/$defs/database" + "anyOf": [ + { + "$ref": "#/$defs/Database" + } + ], + "default": null }, "+docs": { - "$ref": "#/$defs/docs_config" + "anyOf": [ + { + "$ref": "#/$defs/DocsConfig" + } + ], + "default": null }, "+enabled": { - "$ref": "#/$defs/boolean_or_jinja_string" + "anyOf": [ + { + "$ref": "#/$defs/BooleanOrJinjaString" + } + ], + "default": null }, "+full_refresh": { - "$ref": "#/$defs/boolean_or_jinja_string" + "anyOf": [ + { + "$ref": "#/$defs/BooleanOrJinjaString" + } + ], + "default": null }, "+grants": { - "$ref": "#/$defs/grants" + "anyOf": [ + { + "$ref": "#/$defs/Grants" + } + ], + "default": null }, "+group": { - "$ref": "#/$defs/group" + "anyOf": [ + { + "$ref": "#/$defs/Group" + } + ], + "default": null }, "+meta": { - "$ref": "#/$defs/meta" + "anyOf": [ + { + "$ref": "#/$defs/Meta" + } + ], + "default": null }, "+persist_docs": { - "$ref": "#/$defs/persist_docs_config" + "anyOf": [ + { + "$ref": "#/$defs/PersistDocsConfig" + } + ], + "default": null }, "+quote_columns": { - "$ref": "#/$defs/boolean_or_jinja_string" + "anyOf": [ + { + "$ref": "#/$defs/BooleanOrJinjaString" + } + ], + "default": null }, "+schema": { - "$ref": "#/$defs/schema" + "anyOf": [ + { + "$ref": "#/$defs/Schema" + } + ], + "default": null }, "+tags": { - "$ref": "#/$defs/tags" + "anyOf": [ + { + "$ref": "#/$defs/Tags" + } + ], + "default": null }, "+transient": { - "$ref": "#/$defs/boolean_or_jinja_string" + "anyOf": [ + { + "$ref": "#/$defs/BooleanOrJinjaString" + } + ], + "default": null }, "column_types": { - "$ref": "#/$defs/column_types" + "anyOf": [ + { + "$ref": "#/$defs/ColumnTypes" + } + ], + "default": null }, "copy_grants": { - "$ref": "#/$defs/boolean_or_jinja_string" + "anyOf": [ + { + "$ref": "#/$defs/BooleanOrJinjaString" + } + ], + "default": null }, "database": { - "$ref": "#/$defs/database" + "anyOf": [ + { + "$ref": "#/$defs/Database" + } + ], + "default": null }, "docs": { - "$ref": "#/$defs/docs_config" + "anyOf": [ + { + "$ref": "#/$defs/DocsConfig" + } + ], + "default": null }, "enabled": { - "$ref": "#/$defs/boolean_or_jinja_string" + "anyOf": [ + { + "$ref": "#/$defs/BooleanOrJinjaString" + } + ], + "default": null }, "full_refresh": { - "$ref": "#/$defs/boolean_or_jinja_string" + "anyOf": [ + { + "$ref": "#/$defs/BooleanOrJinjaString" + } + ], + "default": null }, "grants": { - "$ref": "#/$defs/grants" + "anyOf": [ + { + "$ref": "#/$defs/Grants" + } + ], + "default": null }, "group": { - "$ref": "#/$defs/group" + "anyOf": [ + { + "$ref": "#/$defs/Group" + } + ], + "default": null }, "meta": { - "$ref": "#/$defs/meta" + "anyOf": [ + { + "$ref": "#/$defs/Meta" + } + ], + "default": null }, "persist_docs": { - "$ref": "#/$defs/persist_docs_config" + "anyOf": [ + { + "$ref": "#/$defs/PersistDocsConfig" + } + ], + "default": null }, "quote_columns": { - "$ref": "#/$defs/boolean_or_jinja_string" + "anyOf": [ + { + "$ref": "#/$defs/BooleanOrJinjaString" + } + ], + "default": null }, "schema": { - "$ref": "#/$defs/schema" + "anyOf": [ + { + "$ref": "#/$defs/Schema" + } + ], + "default": null }, "tags": { - "$ref": "#/$defs/tags" + "anyOf": [ + { + "$ref": "#/$defs/Tags" + } + ], + "default": null }, "transient": { - "$ref": "#/$defs/boolean_or_jinja_string" + "anyOf": [ + { + "$ref": "#/$defs/BooleanOrJinjaString" + } + ], + "default": null } }, - "additionalProperties": { - "oneOf": [ - { - "$ref": "#/$defs/seed_configs" - }, - { - "$ref": "#/$defs/empty_directory" - } - ] - } + "title": "SeedConfigs", + "type": "object" }, - "severity": { - "oneOf": [ + "Severity": { + "anyOf": [ { - "$ref": "#/$defs/jinja_string" + "$ref": "#/$defs/JinjaString" }, { - "type": "string", - "enum": [ - "warn", - "error" - ] + "$ref": "#/$defs/Severity1" } - ] + ], + "title": "Severity" + }, + "Severity1": { + "enum": [ + "warn", + "error" + ], + "title": "Severity1", + "type": "string" }, - "snapshot_configs": { - "title": "Snapshot configs", - "type": "object", + "SnapshotConfigs": { "properties": { "+alias": { - "$ref": "#/$defs/alias" + "anyOf": [ + { + "$ref": "#/$defs/Alias" + } + ], + "default": null }, "+check_cols": { - "$ref": "#/$defs/string_or_array_of_strings" + "anyOf": [ + { + "$ref": "#/$defs/StringOrArrayOfStrings" + } + ], + "default": null }, "+docs": { - "$ref": "#/$defs/docs_config" + "anyOf": [ + { + "$ref": "#/$defs/DocsConfig" + } + ], + "default": null }, "+enabled": { - "$ref": "#/$defs/boolean_or_jinja_string" + "anyOf": [ + { + "$ref": "#/$defs/BooleanOrJinjaString" + } + ], + "default": null }, "+grants": { - "$ref": "#/$defs/grants" + "anyOf": [ + { + "$ref": "#/$defs/Grants" + } + ], + "default": null }, "+group": { - "$ref": "#/$defs/group" + "anyOf": [ + { + "$ref": "#/$defs/Group" + } + ], + "default": null }, "+invalidate_hard_deletes": { - "$ref": "#/$defs/invalidate_hard_deletes" + "anyOf": [ + { + "$ref": "#/$defs/InvalidateHardDeletes" + } + ], + "default": null }, "+meta": { - "$ref": "#/$defs/meta" + "anyOf": [ + { + "$ref": "#/$defs/Meta" + } + ], + "default": null }, "+persist_docs": { - "$ref": "#/$defs/persist_docs_config" + "anyOf": [ + { + "$ref": "#/$defs/PersistDocsConfig" + } + ], + "default": null }, "+post-hook": { - "$ref": "#/$defs/array_of_strings" + "anyOf": [ + { + "$ref": "#/$defs/ArrayOfStrings" + } + ], + "default": null }, "+pre-hook": { - "$ref": "#/$defs/array_of_strings" + "anyOf": [ + { + "$ref": "#/$defs/ArrayOfStrings" + } + ], + "default": null }, "+quote_columns": { - "$ref": "#/$defs/boolean_or_jinja_string" + "anyOf": [ + { + "$ref": "#/$defs/BooleanOrJinjaString" + } + ], + "default": null }, "+strategy": { - "$ref": "#/$defs/strategy" + "anyOf": [ + { + "$ref": "#/$defs/Strategy" + } + ], + "default": null }, "+tags": { - "$ref": "#/$defs/tags" + "anyOf": [ + { + "$ref": "#/$defs/Tags" + } + ], + "default": null }, "+target_database": { - "$ref": "#/$defs/target_database" + "anyOf": [ + { + "$ref": "#/$defs/TargetDatabase" + } + ], + "default": null }, "+target_schema": { - "$ref": "#/$defs/target_schema" + "anyOf": [ + { + "$ref": "#/$defs/TargetSchema" + } + ], + "default": null }, "+transient": { - "$ref": "#/$defs/boolean_or_jinja_string" + "anyOf": [ + { + "$ref": "#/$defs/BooleanOrJinjaString" + } + ], + "default": null }, "+unique_key": { - "$ref": "#/$defs/string_or_array_of_strings" + "anyOf": [ + { + "$ref": "#/$defs/StringOrArrayOfStrings" + } + ], + "default": null }, "+updated_at": { - "$ref": "#/$defs/updated_at" + "anyOf": [ + { + "$ref": "#/$defs/UpdatedAt" + } + ], + "default": null }, "alias": { - "$ref": "#/$defs/alias" + "anyOf": [ + { + "$ref": "#/$defs/Alias" + } + ], + "default": null }, "check_cols": { - "$ref": "#/$defs/string_or_array_of_strings" + "anyOf": [ + { + "$ref": "#/$defs/StringOrArrayOfStrings" + } + ], + "default": null }, "docs": { - "$ref": "#/$defs/docs_config" + "anyOf": [ + { + "$ref": "#/$defs/DocsConfig" + } + ], + "default": null }, "enabled": { - "$ref": "#/$defs/boolean_or_jinja_string" + "anyOf": [ + { + "$ref": "#/$defs/BooleanOrJinjaString" + } + ], + "default": null }, "grants": { - "$ref": "#/$defs/grants" + "anyOf": [ + { + "$ref": "#/$defs/Grants" + } + ], + "default": null }, "group": { - "$ref": "#/$defs/group" + "anyOf": [ + { + "$ref": "#/$defs/Group" + } + ], + "default": null }, "invalidate_hard_deletes": { - "$ref": "#/$defs/invalidate_hard_deletes" + "anyOf": [ + { + "$ref": "#/$defs/InvalidateHardDeletes" + } + ], + "default": null }, "meta": { - "$ref": "#/$defs/meta" + "anyOf": [ + { + "$ref": "#/$defs/Meta" + } + ], + "default": null }, "persist_docs": { - "$ref": "#/$defs/persist_docs_config" + "anyOf": [ + { + "$ref": "#/$defs/PersistDocsConfig" + } + ], + "default": null }, "post-hook": { - "$ref": "#/$defs/array_of_strings" + "anyOf": [ + { + "$ref": "#/$defs/ArrayOfStrings" + } + ], + "default": null }, "pre-hook": { - "$ref": "#/$defs/array_of_strings" + "anyOf": [ + { + "$ref": "#/$defs/ArrayOfStrings" + } + ], + "default": null }, "quote_columns": { - "$ref": "#/$defs/boolean_or_jinja_string" + "anyOf": [ + { + "$ref": "#/$defs/BooleanOrJinjaString" + } + ], + "default": null }, "strategy": { - "$ref": "#/$defs/strategy" + "anyOf": [ + { + "$ref": "#/$defs/Strategy" + } + ], + "default": null }, "tags": { - "$ref": "#/$defs/tags" + "anyOf": [ + { + "$ref": "#/$defs/Tags" + } + ], + "default": null }, "target_database": { - "$ref": "#/$defs/target_database" + "anyOf": [ + { + "$ref": "#/$defs/TargetDatabase" + } + ], + "default": null }, "target_schema": { - "$ref": "#/$defs/target_schema" + "anyOf": [ + { + "$ref": "#/$defs/TargetSchema" + } + ], + "default": null }, "transient": { - "$ref": "#/$defs/boolean_or_jinja_string" + "anyOf": [ + { + "$ref": "#/$defs/BooleanOrJinjaString" + } + ], + "default": null }, "unique_key": { - "$ref": "#/$defs/string_or_array_of_strings" + "anyOf": [ + { + "$ref": "#/$defs/StringOrArrayOfStrings" + } + ], + "default": null }, "updated_at": { - "$ref": "#/$defs/updated_at" + "anyOf": [ + { + "$ref": "#/$defs/UpdatedAt" + } + ], + "default": null } }, - "additionalProperties": { - "oneOf": [ - { - "$ref": "#/$defs/snapshot_configs" - }, - { - "$ref": "#/$defs/empty_directory" - } - ] - } + "title": "SnapshotConfigs", + "type": "object" }, - "snowflake_warehouse": { + "SnowflakeWarehouse": { + "title": "SnowflakeWarehouse", "type": "string" }, - "source_configs": { - "title": "Source configs", - "type": "object", + "SourceConfigs": { "properties": { "+enabled": { - "$ref": "#/$defs/boolean_or_jinja_string" + "anyOf": [ + { + "$ref": "#/$defs/BooleanOrJinjaString" + } + ], + "default": null }, "+meta": { - "$ref": "#/$defs/meta" + "anyOf": [ + { + "$ref": "#/$defs/Meta" + } + ], + "default": null }, "+tags": { - "$ref": "#/$defs/tags" + "anyOf": [ + { + "$ref": "#/$defs/Tags" + } + ], + "default": null }, "enabled": { - "$ref": "#/$defs/boolean_or_jinja_string" + "anyOf": [ + { + "$ref": "#/$defs/BooleanOrJinjaString" + } + ], + "default": null }, "meta": { - "$ref": "#/$defs/meta" + "anyOf": [ + { + "$ref": "#/$defs/Meta" + } + ], + "default": null }, "tags": { - "$ref": "#/$defs/tags" + "anyOf": [ + { + "$ref": "#/$defs/Tags" + } + ], + "default": null } }, - "additionalProperties": { - "oneOf": [ - { - "$ref": "#/$defs/source_configs" - }, - { - "$ref": "#/$defs/empty_directory" - } - ] - } + "title": "SourceConfigs", + "type": "object" }, - "sql_header": { + "SqlHeader": { + "title": "SqlHeader", "type": "string" }, - "strategy": { + "Strategy": { + "title": "Strategy", "type": "string" }, - "string_or_array_of_strings": { - "oneOf": [ + "StringOrArrayOfStrings": { + "anyOf": [ { "type": "string" }, { - "$ref": "#/$defs/array_of_strings" + "$ref": "#/$defs/ArrayOfStrings" } - ] + ], + "title": "StringOrArrayOfStrings" }, - "tags": { - "$ref": "#/$defs/string_or_array_of_strings" + "Tags": { + "allOf": [ + { + "$ref": "#/$defs/StringOrArrayOfStrings" + } + ], + "title": "Tags" }, - "target_database": { + "TargetDatabase": { + "title": "TargetDatabase", "type": "string" }, - "target_lag": { - "type": "string", - "pattern": "^(?:downstream|\\d+\\s*(?:seconds|minutes|hours|days))$" + "TargetLag": { + "pattern": "^(?:downstream|\\d+\\s*(?:seconds|minutes|hours|days))$", + "title": "TargetLag", + "type": "string" }, - "target_schema": { + "TargetSchema": { + "title": "TargetSchema", "type": "string" }, - "unit_test_configs": { + "UnitTestConfigs": { "properties": { "+meta": { - "$ref": "#/$defs/meta" + "anyOf": [ + { + "$ref": "#/$defs/Meta" + } + ], + "default": null }, "+tags": { - "$ref": "#/$defs/tags" + "anyOf": [ + { + "$ref": "#/$defs/Tags" + } + ], + "default": null }, "meta": { - "$ref": "#/$defs/meta" + "anyOf": [ + { + "$ref": "#/$defs/Meta" + } + ], + "default": null }, "tags": { - "$ref": "#/$defs/tags" + "anyOf": [ + { + "$ref": "#/$defs/Tags" + } + ], + "default": null } }, - "additionalProperties": { - "oneOf": [ - { - "$ref": "#/$defs/unit_test_configs" - }, - { - "$ref": "#/$defs/empty_directory" - } - ] - } + "title": "UnitTestConfigs", + "type": "object" }, - "updated_at": { + "UpdatedAt": { + "title": "UpdatedAt", "type": "string" }, - "warn_if": { + "WarnIf": { + "title": "WarnIf", "type": "string" } - } + }, + "additionalProperties": false, + "properties": { + "version": { + "anyOf": [ + { + "type": "string" + } + ], + "default": null, + "title": "Version" + }, + "name": { + "title": "Name", + "type": "string" + }, + "analysis-paths": { + "anyOf": [ + { + "$ref": "#/$defs/ArrayOfStrings" + } + ], + "default": null + }, + "asset-paths": { + "anyOf": [ + { + "$ref": "#/$defs/ArrayOfStrings" + } + ], + "default": null + }, + "clean-targets": { + "anyOf": [ + { + "$ref": "#/$defs/ArrayOfStrings" + } + ], + "default": null + }, + "config-version": { + "anyOf": [ + { + "type": "number" + } + ], + "default": 2, + "title": "Config-Version" + }, + "data_tests": { + "anyOf": [ + { + "$ref": "#/$defs/DataTestConfigs" + } + ], + "default": null + }, + "dbt-cloud": { + "anyOf": [ + { + "$ref": "#/$defs/DbtCloud" + } + ], + "default": null + }, + "dispatch": { + "anyOf": [ + { + "items": { + "$ref": "#/$defs/DispatchItem" + }, + "type": "array" + } + ], + "default": null, + "title": "Dispatch" + }, + "docs-paths": { + "anyOf": [ + { + "$ref": "#/$defs/ArrayOfStrings" + } + ], + "default": null + }, + "flags": { + "anyOf": [ + { + "$ref": "#/$defs/Flags" + } + ], + "default": null + }, + "log-path": { + "anyOf": [ + { + "type": "string" + } + ], + "default": null, + "title": "Log-Path" + }, + "macro-paths": { + "anyOf": [ + { + "$ref": "#/$defs/ArrayOfStrings" + } + ], + "default": null + }, + "model-paths": { + "anyOf": [ + { + "$ref": "#/$defs/ArrayOfStrings" + } + ], + "default": null + }, + "models": { + "anyOf": [ + { + "$ref": "#/$defs/ModelConfigs" + } + ], + "default": null + }, + "on-run-end": { + "anyOf": [ + { + "$ref": "#/$defs/ArrayOfStrings" + }, + { + "type": "string" + } + ], + "default": null, + "title": "On-Run-End" + }, + "on-run-start": { + "anyOf": [ + { + "$ref": "#/$defs/ArrayOfStrings" + }, + { + "type": "string" + } + ], + "default": null, + "title": "On-Run-Start" + }, + "packages-install-path": { + "anyOf": [ + { + "type": "string" + } + ], + "default": null, + "title": "Packages-Install-Path" + }, + "profile": { + "anyOf": [ + { + "type": "string" + } + ], + "default": null, + "title": "Profile" + }, + "query-comment": { + "anyOf": [ + { + "type": "string" + }, + { + "$ref": "#/$defs/QueryComment" + } + ], + "default": null, + "title": "Query-Comment" + }, + "quoting": { + "anyOf": [ + { + "$ref": "#/$defs/Quoting" + } + ], + "default": null + }, + "require-dbt-version": { + "anyOf": [ + { + "$ref": "#/$defs/StringOrArrayOfStrings" + } + ], + "default": null + }, + "seed-paths": { + "anyOf": [ + { + "$ref": "#/$defs/ArrayOfStrings" + } + ], + "default": null + }, + "seeds": { + "anyOf": [ + { + "$ref": "#/$defs/SeedConfigs" + } + ], + "default": null + }, + "snapshot-paths": { + "anyOf": [ + { + "$ref": "#/$defs/ArrayOfStrings" + } + ], + "default": null + }, + "snapshots": { + "anyOf": [ + { + "$ref": "#/$defs/SnapshotConfigs" + } + ], + "default": null + }, + "sources": { + "anyOf": [ + { + "$ref": "#/$defs/SourceConfigs" + } + ], + "default": null + }, + "target-path": { + "anyOf": [ + { + "type": "string" + } + ], + "default": null, + "title": "Target-Path" + }, + "test-paths": { + "anyOf": [ + { + "$ref": "#/$defs/ArrayOfStrings" + } + ], + "default": null + }, + "tests": { + "anyOf": [ + { + "$ref": "#/$defs/DataTestConfigs" + } + ], + "default": null + }, + "unit_tests": { + "anyOf": [ + { + "$ref": "#/$defs/UnitTestConfigs" + } + ], + "default": null + }, + "vars": { + "anyOf": [ + { + "type": "object" + } + ], + "default": null, + "title": "Vars" + } + }, + "required": [ + "name" + ], + "title": "DbtProject", + "type": "object" } \ No newline at end of file diff --git a/schemas/latest/dbt_yml_files-latest.json b/schemas/latest/dbt_yml_files-latest.json index 46d4e2f..d4003c0 100644 --- a/schemas/latest/dbt_yml_files-latest.json +++ b/schemas/latest/dbt_yml_files-latest.json @@ -1,2052 +1,4061 @@ { - "title": "dbt_yml_files", - "type": "object", - "$schema": "http://json-schema.org/draft-07/schema#", - "properties": { - "version": { - "type": "number", - "const": 2 - }, - "analyses": { - "type": "array", - "items": { - "type": "object", - "required": [ - "name" - ], - "properties": { - "name": { - "type": "string" - }, - "description": { + "$defs": { + "AcceptedValues": { + "properties": { + "name": { + "anyOf": [ + { + "type": "string" + } + ], + "default": "", + "title": "Name" + }, + "config": { + "anyOf": [ + { + "$ref": "#/$defs/TestConfigs" + } + ], + "default": "" + }, + "quote": { + "anyOf": [ + { + "type": "boolean" + } + ], + "default": "", + "title": "Quote" + }, + "values": { + "items": { "type": "string" }, - "columns": { - "type": "array", - "items": { - "type": "object", - "required": [ - "name" - ], - "properties": { - "name": { - "type": "string" - }, - "description": { - "type": "string" - }, - "data_type": { - "type": "string" - } - }, - "additionalProperties": false + "title": "Values", + "type": "array" + }, + "where": { + "anyOf": [ + { + "type": "string" } - }, - "config": { - "type": "object", - "properties": { - "tags": { - "$ref": "#/$defs/string_or_array_of_strings" - } - }, - "additionalProperties": false - }, - "docs": { - "$ref": "#/$defs/docs_config" - }, - "group": { - "$ref": "#/$defs/group" - } + ], + "default": "", + "title": "Where" } - } + }, + "required": [ + "values" + ], + "title": "AcceptedValues", + "type": "object" }, - "exposures": { - "type": "array", - "items": { - "type": "object", - "required": [ - "depends_on", - "name", - "owner", - "type" - ], - "$comment": "NB: depends_on is not strictly required, but is _expected_ according to the documentation", - "properties": { - "name": { - "type": "string" - }, - "description": { - "type": "string" - }, - "type": { - "type": "string", - "enum": [ - "dashboard", - "notebook", - "analysis", - "ml", - "application" - ] - }, - "depends_on": { - "type": "array", - "items": { - "type": "string" + "AcceptedValuesTest": { + "properties": { + "accepted_values": { + "anyOf": [ + { + "$ref": "#/$defs/AcceptedValues" } - }, - "label": { - "type": "string", - "$comment": "Added in dbt Core v1.3" - }, - "maturity": { - "type": "string", - "enum": [ - "high", - "medium", - "low" - ] - }, - "meta": { - "type": "object" - }, - "owner": { - "type": "object", - "anyOf": [ - { - "required": [ - "email" - ] - }, - { - "required": [ - "name" - ] - } - ], - "properties": { - "name": { - "type": "string" - }, - "email": { - "type": "string" - } - }, - "additionalProperties": false - }, - "tags": { - "$ref": "#/$defs/string_or_array_of_strings" - }, - "url": { - "type": "string" + ], + "default": { + "name": "", + "config": "", + "quote": "", + "values": [], + "where": "" } } - } + }, + "title": "AcceptedValuesTest", + "type": "object" }, - "groups": { - "type": "array", - "items": { - "type": "object", - "required": [ - "name", - "owner" - ], - "properties": { - "name": { - "type": "string" - }, - "owner": { - "type": "object", - "minProperties": 1, - "properties": { - "name": { - "type": "string" - }, - "email": { - "type": "string" - } - }, - "additionalProperties": true - } - }, - "additionalProperties": false - } + "Access": { + "enum": [ + "private", + "protected", + "public" + ], + "title": "Access", + "type": "string" }, - "macros": { - "type": "array", - "items": { - "type": "object", - "required": [ - "name" - ], - "properties": { - "name": { - "type": "string" - }, - "description": { - "type": "string" - }, - "arguments": { - "type": "array", - "items": { - "type": "object", - "required": [ - "name" - ], - "properties": { - "name": { - "type": "string" - }, - "description": { - "type": "string" - }, - "type": { - "type": "string" - } - }, - "additionalProperties": false - } - }, - "docs": { - "$ref": "#/$defs/docs_config" - } - }, - "additionalProperties": false - } + "Agg": { + "enum": [ + "SUM", + "MIN", + "MAX", + "AVG", + "COUNT_DISTINCT", + "SUM_BOOLEAN", + "COUNT", + "PERCENTILE", + "MEDIAN", + "sum", + "min", + "max", + "avg", + "count_distinct", + "sum_boolean", + "count", + "percentile", + "median" + ], + "title": "Agg", + "type": "string" }, - "metrics": { - "type": "array", - "items": { - "type": "object", - "required": [ - "name", - "label", - "type", - "type_params" - ], - "if": { - "properties": { - "type": { - "enum": [ - "SIMPLE", - "simple" - ] + "AggregationTypeParams": { + "additionalProperties": false, + "properties": { + "percentile": { + "anyOf": [ + { + "type": "number" } - } + ], + "default": "", + "title": "Percentile" }, - "then": { - "properties": { - "type_params": { - "$ref": "#/$defs/simple_metric_type_params" + "use_approximate_percentile": { + "anyOf": [ + { + "type": "boolean" } - } + ], + "default": "", + "title": "Use Approximate Percentile" }, - "else": { - "if": { - "properties": { - "type": { - "enum": [ - "derived", - "DERIVED" - ] - } + "use_discrete_percentile": { + "anyOf": [ + { + "type": "boolean" } - }, - "then": { - "properties": { - "type_params": { - "$ref": "#/$defs/derived_metric_type_params" - } + ], + "default": "", + "title": "Use Discrete Percentile" + } + }, + "title": "AggregationTypeParams", + "type": "object" + }, + "Analysis": { + "properties": { + "name": { + "title": "Name", + "type": "string" + }, + "description": { + "anyOf": [ + { + "type": "string" } - }, - "else": { - "if": { - "properties": { - "type": { - "enum": [ - "cumulative", - "CUMULATIVE" - ] - } - } - }, - "then": { - "properties": { - "type_params": { - "$ref": "#/$defs/cumulative_metric_type_params" - } - } - }, - "else": { - "if": { - "properties": { - "type": { - "enum": [ - "conversion", - "CONVERSION" - ] - } - } - }, - "then": { - "properties": { - "type_params": { - "$ref": "#/$defs/conversion_metric_type_params" - } - } + ], + "default": "", + "title": "Description" + }, + "columns": { + "anyOf": [ + { + "items": { + "$ref": "#/$defs/Column" }, - "else": { - "if": { - "properties": { - "type": { - "enum": [ - "ratio", - "RATIO" - ] - } - } - }, - "then": { - "properties": { - "type_params": { - "$ref": "#/$defs/ratio_metric_type_params" - } - } - } - } + "type": "array" } - } - }, - "properties": { - "name": { - "type": "string", - "pattern": "(?!.*__).*^[a-z][a-z0-9_]*[a-z0-9]$" - }, - "description": { - "type": "string" - }, - "type": { - "enum": [ - "SIMPLE", - "RATIO", - "CUMULATIVE", - "DERIVED", - "CONVERSION", - "simple", - "ratio", - "cumulative", - "derived", - "conversion" - ] - }, - "filter": { - "type": "string" - }, - "group": { - "$ref": "#/$defs/group" - }, - "label": { - "type": "string" - }, - "time_granularity": { - "enum": [ - "nanosecond", - "microsecond", - "millisecond", - "second", - "minute", - "hour", - "day", - "week", - "month", - "quarter", - "year" - ] - }, - "type_params": { - "type": "object" - } + ], + "default": "", + "title": "Columns" }, - "additionalProperties": false - } - }, - "models": { - "type": "array", - "items": { - "type": "object", - "required": [ - "name" - ], - "properties": { - "name": { - "type": "string" - }, - "description": { - "type": "string" - }, - "access": { - "type": "string", - "enum": [ - "private", - "protected", - "public" - ] - }, - "columns": { - "type": "array", - "items": { - "$ref": "#/$defs/column_properties" + "config": { + "anyOf": [ + { + "$ref": "#/$defs/Config" } - }, - "config": { - "$ref": "#/$defs/model_configs" - }, - "constraints": { - "$ref": "#/$defs/constraints" - }, - "data_tests": { - "type": "array", - "items": { - "$ref": "#/$defs/data_tests" + ], + "default": "" + }, + "docs": { + "anyOf": [ + { + "$ref": "#/$defs/DocsConfig" } - }, - "deprecation_date": { - "type": "string" - }, - "docs": { - "$ref": "#/$defs/docs_config" - }, - "group": { - "$ref": "#/$defs/group" - }, - "latest_version": { - "type": "number" - }, - "meta": { - "type": "object" - }, - "tests": { - "type": "array", - "items": { - "$ref": "#/$defs/data_tests" + ], + "default": "" + }, + "group": { + "anyOf": [ + { + "$ref": "#/$defs/GroupName" } - }, - "time_spine": { - "type": "object", - "required": [ - "standard_granularity_column" - ], - "properties": { - "standard_granularity_column": { - "type": "string" - } - }, - "additionalProperties": false - }, - "versions": { - "type": "array", - "items": { - "type": "object", - "required": [ - "v" - ], - "properties": { - "columns": { - "type": "array", - "items": { - "anyOf": [ - { - "$ref": "#/$defs/include_exclude" - }, - { - "$ref": "#/$defs/column_properties" - } - ] - } - }, - "config": { - "$ref": "#/$defs/model_configs" - }, - "v": { - "type": "number" - } - } + ], + "default": "" + } + }, + "required": [ + "name" + ], + "title": "Analysis", + "type": "object" + }, + "Argument": { + "additionalProperties": false, + "properties": { + "name": { + "title": "Name", + "type": "string" + }, + "description": { + "anyOf": [ + { + "type": "string" } - } + ], + "default": "", + "title": "Description" }, - "additionalProperties": false - } + "type": { + "anyOf": [ + { + "type": "string" + } + ], + "default": "", + "title": "Type" + } + }, + "required": [ + "name" + ], + "title": "Argument", + "type": "object" }, - "saved_queries": { - "type": "array", + "ArrayOfStrings": { "items": { - "type": "object", - "required": [ - "name", - "description", - "label", - "query_params" - ], - "properties": { - "name": { - "type": "string" - }, - "description": { - "type": "string" - }, - "exports": { - "type": "array", - "items": { - "$ref": "#/$defs/export" - } - }, - "label": { - "type": "string" - }, - "query_params": { - "type": "object", - "properties": { - "dimensions": { - "$ref": "#/$defs/array_of_strings" - }, - "metrics": { - "$ref": "#/$defs/array_of_strings" - }, - "where": { - "$ref": "#/$defs/array_of_strings" - }, - "additionalProperties": false - } - } + "type": "string" + }, + "title": "ArrayOfStrings", + "type": "array" + }, + "AuthorizedView": { + "additionalProperties": false, + "properties": { + "database": { + "title": "Database", + "type": "string" + }, + "project": { + "title": "Project", + "type": "string" + } + }, + "required": [ + "database", + "project" + ], + "title": "AuthorizedView", + "type": "object" + }, + "BooleanOrJinjaString": { + "anyOf": [ + { + "$ref": "#/$defs/JinjaString" }, - "additionalProperties": false - } + { + "type": "boolean" + } + ], + "title": "BooleanOrJinjaString" }, - "seeds": { - "type": "array", - "items": { - "type": "object", - "required": [ - "name" - ], - "properties": { - "name": { - "type": "string" - }, - "description": { - "type": "string" - }, - "columns": { - "type": "array", - "items": { - "$ref": "#/$defs/column_properties" + "Calculation": { + "enum": [ + "conversions", + "conversion_rate", + "CONVERSIONS", + "CONVERSION_RATE" + ], + "title": "Calculation", + "type": "string" + }, + "CategoricalDimension": { + "additionalProperties": false, + "properties": { + "name": { + "pattern": "(?!.*__).*^[a-z][a-z0-9_]*[a-z0-9]$", + "title": "Name", + "type": "string" + }, + "description": { + "anyOf": [ + { + "type": "string" } - }, - "config": { - "type": "object", - "properties": { - "column_types": { - "type": "object" - }, - "copy_grants": { - "$ref": "#/$defs/boolean_or_jinja_string" - }, - "data_tests": { - "type": "array", - "items": { - "$ref": "#/$defs/data_tests" - } - }, - "database": { - "type": "string" - }, - "enabled": { - "$ref": "#/$defs/boolean_or_jinja_string" - }, - "grants": { - "$ref": "#/$defs/grants" - }, - "quote_columns": { - "$ref": "#/$defs/boolean_or_jinja_string" - }, - "schema": { - "type": "string" - } + ], + "default": "", + "title": "Description" + }, + "expr": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "boolean" } - }, - "docs": { - "$ref": "#/$defs/docs_config" - }, - "group": { - "$ref": "#/$defs/group" - }, - "tests": { - "type": "array", - "items": { - "$ref": "#/$defs/data_tests" + ], + "default": "", + "title": "Expr" + }, + "is_partition": { + "anyOf": [ + { + "type": "boolean" } - } + ], + "default": true, + "title": "Is Partition" }, - "additionalProperties": false - } + "type": { + "$ref": "#/$defs/CategoricalDimensionType" + } + }, + "required": [ + "name", + "type" + ], + "title": "CategoricalDimension", + "type": "object" }, - "semantic_models": { - "type": "array", - "items": { - "type": "object", - "required": [ - "name", - "model" - ], - "properties": { - "name": { - "type": "string", - "pattern": "(?!.*__).*^[a-z][a-z0-9_]*[a-z0-9]$" - }, - "description": { - "type": "string" - }, - "defaults": { - "type": "object", - "properties": { - "agg_time_dimension": { - "type": "string" - } - }, - "additionalProperties": false - }, - "dimensions": { - "type": "array", - "items": { - "$ref": "#/$defs/dimension" + "CategoricalDimensionType": { + "enum": [ + "CATEGORICAL", + "categorical" + ], + "title": "CategoricalDimensionType", + "type": "string" + }, + "Column": { + "additionalProperties": false, + "properties": { + "name": { + "title": "Name", + "type": "string" + }, + "description": { + "anyOf": [ + { + "type": "string" } - }, - "entities": { - "type": "array", - "items": { - "$ref": "#/$defs/entity" + ], + "default": "", + "title": "Description" + }, + "data_type": { + "anyOf": [ + { + "type": "string" } - }, - "measures": { - "type": "array", - "items": { - "$ref": "#/$defs/measure" + ], + "default": "", + "title": "Data Type" + } + }, + "required": [ + "name" + ], + "title": "Column", + "type": "object" + }, + "ColumnProperties": { + "additionalProperties": false, + "properties": { + "name": { + "title": "Name", + "type": "string" + }, + "description": { + "anyOf": [ + { + "type": "string" } - }, - "model": { - "type": "string", - "default": "ref('')" - }, - "primary_entity": { - "type": "string" - } + ], + "default": "", + "title": "Description" }, - "additionalProperties": false - } - }, - "snapshots": { - "type": "array", - "items": { - "type": "object", - "required": [ - "name" - ], - "properties": { - "name": { - "type": "string" - }, - "description": { - "type": "string" - }, - "columns": { - "type": "array", - "items": { - "$ref": "#/$defs/column_properties" + "constraints": { + "anyOf": [ + { + "$ref": "#/$defs/Constraints" } - }, - "config": { - "type": "object", - "properties": { - "alias": { - "type": "string" - }, - "check_cols": { - "$ref": "#/$defs/string_or_array_of_strings" - }, - "enabled": { - "$ref": "#/$defs/boolean_or_jinja_string" - }, - "grants": { - "$ref": "#/$defs/grants" - }, - "persist_docs": { - "$ref": "#/$defs/persist_docs_config" - }, - "post-hook": { - "$ref": "#/$defs/array_of_strings" - }, - "pre-hook": { - "$ref": "#/$defs/array_of_strings" - }, - "quote_columns": { - "$ref": "#/$defs/boolean_or_jinja_string" - }, - "strategy": { - "type": "string" - }, - "tags": { - "$ref": "#/$defs/string_or_array_of_strings" - }, - "target_database": { - "type": "string" + ], + "default": "" + }, + "data_tests": { + "anyOf": [ + { + "items": { + "$ref": "#/$defs/DataTests" }, - "target_schema": { + "type": "array" + } + ], + "default": "", + "title": "Data Tests" + }, + "data_type": { + "anyOf": [ + { + "type": "string" + } + ], + "default": "", + "title": "Data Type" + }, + "meta": { + "anyOf": [ + { + "type": "object" + } + ], + "default": "", + "title": "Meta" + }, + "policy_tags": { + "anyOf": [ + { + "items": { "type": "string" }, - "unique_key": { - "$ref": "#/$defs/string_or_array_of_strings" - }, - "updated_at": { - "type": "string" - } - } - }, - "data_tests": { - "type": "array", - "items": { - "$ref": "#/$defs/data_tests" + "type": "array" } - }, - "docs": { - "$ref": "#/$defs/docs_config" - }, - "group": { - "$ref": "#/$defs/group" - }, - "meta": { - "type": "object" - }, - "tests": { - "type": "array", - "items": { - "$ref": "#/$defs/data_tests" + ], + "default": null, + "description": "Configurations, specific to BigQuery adapter, used to set policy tags on specific columns, enabling column-level security. Only relevant when `persist_docs.columns` is true.", + "title": "Policy tags" + }, + "quote": { + "anyOf": [ + { + "$ref": "#/$defs/BooleanOrJinjaString" } - } + ], + "default": "" }, - "additionalProperties": false - } - }, - "sources": { - "type": "array", - "items": { - "type": "object", - "required": [ - "name" - ], - "properties": { - "name": { - "description": "How you will identify the schema in {{ source() }} calls. Unless `schema` is also set, this will be the name of the schema in the database.", - "type": "string" - }, - "description": { - "type": "string" - }, - "config": { - "type": "object" - }, - "data_tests": { - "type": "array", - "items": { - "$ref": "#/$defs/data_tests" + "tags": { + "anyOf": [ + { + "$ref": "#/$defs/StringOrArrayOfStrings" } - }, - "database": { - "type": "string" - }, - "freshness": { - "$ref": "#/$defs/freshness_definition" - }, - "loaded_at_field": { - "type": "string" - }, - "loader": { - "type": "string" - }, - "meta": { - "type": "object" - }, - "overrides": { - "title": "Package to Override", - "description": "The name of another package installed in your project. If that package has a source with the same name as this one, its properties will be applied on top of the base properties of the overridden source. https://docs.getdbt.com/reference/resource-properties/overrides", - "type": "string" - }, - "quoting": { - "type": "object", - "properties": { - "database": { - "$ref": "#/$defs/boolean_or_jinja_string" - }, - "identifier": { - "$ref": "#/$defs/boolean_or_jinja_string" - }, - "schema": { - "$ref": "#/$defs/boolean_or_jinja_string" - } - }, - "additionalProperties": false - }, - "schema": { - "description": "The schema name as stored in the database. Only needed if you want to use a different `name` than what exists in the database (otherwise `name` is used by default)", - "type": "string" - }, - "tables": { - "type": "array", - "items": { - "type": "object", - "required": [ - "name" - ], - "properties": { - "name": { - "title": "Name", - "description": "How you will identify the table in {{ source() }} calls. Unless `identifier` is also set, this will be the name of the table in the database.", - "type": "string" - }, - "description": { - "type": "string" - }, - "columns": { - "type": "array", - "items": { - "$ref": "#/$defs/column_properties" - } - }, - "external": { - "type": "object" - }, - "freshness": { - "$ref": "#/$defs/freshness_definition" - }, - "identifier": { - "title": "Identifier", - "description": "The table name as stored in the database. Only needed if you want to give the source a different name than what exists in the database (otherwise `name` is used by default)", - "type": "string" - }, - "loaded_at_field": { - "description": "Which column to check during data freshness tests. Only needed if the table has a different loaded_at_field to the one defined on the source overall.", - "type": "string" - }, - "loader": { - "type": "string" - }, - "meta": { - "type": "object" - }, - "quoting": { - "type": "object", - "properties": { - "database": { - "$ref": "#/$defs/boolean_or_jinja_string" - }, - "identifier": { - "$ref": "#/$defs/boolean_or_jinja_string" - }, - "schema": { - "$ref": "#/$defs/boolean_or_jinja_string" - } - }, - "additionalProperties": false - }, - "tags": { - "$ref": "#/$defs/string_or_array_of_strings" - }, - "tests": { - "type": "array", - "items": { - "$ref": "#/$defs/data_tests" - } - } + ], + "default": "" + }, + "tests": { + "anyOf": [ + { + "items": { + "$ref": "#/$defs/DataTests" }, - "additionalProperties": false + "type": "array" } - }, - "tags": { - "$ref": "#/$defs/string_or_array_of_strings" - }, - "tests": { - "type": "array", - "items": { - "$ref": "#/$defs/data_tests" + ], + "default": "", + "title": "Tests" + } + }, + "required": [ + "name" + ], + "title": "ColumnProperties", + "type": "object" + }, + "Config": { + "additionalProperties": false, + "properties": { + "tags": { + "anyOf": [ + { + "$ref": "#/$defs/StringOrArrayOfStrings" } - } + ], + "default": "" } - } + }, + "title": "Config", + "type": "object" }, - "unit_tests": { - "type": "array", - "items": { - "type": "object", - "required": [ - "name", - "model", - "expect" - ], - "properties": { - "name": { + "ConstantProperty": { + "properties": { + "base_property": { + "description": "DIMENSION or ENTITY", + "title": "Base Property", + "type": "string" + }, + "conversion_property": { + "description": "DIMENSION or ENTITY", + "title": "Conversion Property", + "type": "string" + } + }, + "required": [ + "base_property", + "conversion_property" + ], + "title": "ConstantProperty", + "type": "object" + }, + "Constraint": { + "properties": { + "name": { + "anyOf": [ + { + "type": "string" + } + ], + "default": "", + "title": "Name" + }, + "type": { + "title": "Type", + "type": "string" + }, + "columns": { + "anyOf": [ + { + "$ref": "#/$defs/StringOrArrayOfStrings" + } + ], + "default": "" + }, + "expression": { + "anyOf": [ + { + "type": "string" + } + ], + "default": "", + "title": "Expression" + }, + "warn_unenforced": { + "anyOf": [ + { + "$ref": "#/$defs/BooleanOrJinjaString" + } + ], + "default": "" + }, + "warn_unsupported": { + "anyOf": [ + { + "$ref": "#/$defs/BooleanOrJinjaString" + } + ], + "default": "" + } + }, + "required": [ + "type" + ], + "title": "Constraint", + "type": "object" + }, + "Constraints": { + "items": { + "$ref": "#/$defs/Constraint" + }, + "title": "Constraints", + "type": "array" + }, + "Contract": { + "properties": { + "enforced": { + "anyOf": [ + { + "$ref": "#/$defs/BooleanOrJinjaString" + } + ], + "default": true + } + }, + "title": "Contract", + "type": "object" + }, + "ConversionMetric": { + "additionalProperties": false, + "properties": { + "name": { + "pattern": "(?!.*__).*^[a-z][a-z0-9_]*[a-z0-9]$", + "title": "Name", + "type": "string" + }, + "description": { + "anyOf": [ + { + "type": "string" + } + ], + "default": "", + "title": "Description" + }, + "filter": { + "anyOf": [ + { + "type": "string" + } + ], + "default": "", + "title": "Filter" + }, + "group": { + "anyOf": [ + { + "$ref": "#/$defs/GroupName" + } + ], + "default": "" + }, + "label": { + "title": "Label", + "type": "string" + }, + "time_granularity": { + "anyOf": [ + { + "$ref": "#/$defs/TimeGranularity" + } + ], + "default": "" + }, + "type": { + "$ref": "#/$defs/ConversionMetricType" + }, + "type_params": { + "$ref": "#/$defs/ConversionMetricTypeParams" + } + }, + "required": [ + "name", + "label", + "type", + "type_params" + ], + "title": "ConversionMetric", + "type": "object" + }, + "ConversionMetricType": { + "enum": [ + "CONVERSION", + "conversion" + ], + "title": "ConversionMetricType", + "type": "string" + }, + "ConversionMetricTypeParams": { + "additionalProperties": false, + "properties": { + "conversion_type_params": { + "anyOf": [ + { + "$ref": "#/$defs/ConversionTypeParams" + } + ], + "default": "" + } + }, + "title": "ConversionMetricTypeParams", + "type": "object" + }, + "ConversionTypeParams": { + "additionalProperties": false, + "properties": { + "base_measure": { + "$ref": "#/$defs/MetricInputMeasure" + }, + "calculation": { + "anyOf": [ + { + "$ref": "#/$defs/Calculation" + } + ], + "default": "conversion_rate" + }, + "constant_properties": { + "anyOf": [ + { + "items": { + "$ref": "#/$defs/ConstantProperty" + }, + "type": "array" + } + ], + "default": "", + "title": "Constant Properties" + }, + "conversion_measure": { + "$ref": "#/$defs/MetricInputMeasure" + }, + "entity": { + "description": "The entity to calculate over", + "title": "Entity", + "type": "string" + }, + "window": { + "anyOf": [ + { + "type": "string" + } + ], + "default": "", + "title": "Window" + } + }, + "required": [ + "base_measure", + "conversion_measure", + "entity" + ], + "title": "ConversionTypeParams", + "type": "object" + }, + "CumulativeMetric": { + "additionalProperties": false, + "properties": { + "name": { + "pattern": "(?!.*__).*^[a-z][a-z0-9_]*[a-z0-9]$", + "title": "Name", + "type": "string" + }, + "description": { + "anyOf": [ + { + "type": "string" + } + ], + "default": "", + "title": "Description" + }, + "filter": { + "anyOf": [ + { + "type": "string" + } + ], + "default": "", + "title": "Filter" + }, + "group": { + "anyOf": [ + { + "$ref": "#/$defs/GroupName" + } + ], + "default": "" + }, + "label": { + "title": "Label", + "type": "string" + }, + "time_granularity": { + "anyOf": [ + { + "$ref": "#/$defs/TimeGranularity" + } + ], + "default": "" + }, + "type": { + "$ref": "#/$defs/CumulativeMetricType" + }, + "type_params": { + "$ref": "#/$defs/CumulativeMetricTypeParams" + } + }, + "required": [ + "name", + "label", + "type", + "type_params" + ], + "title": "CumulativeMetric", + "type": "object" + }, + "CumulativeMetricType": { + "enum": [ + "CUMULATIVE", + "cumulative" + ], + "title": "CumulativeMetricType", + "type": "string" + }, + "CumulativeMetricTypeParams": { + "additionalProperties": false, + "properties": { + "grain_to_date": { + "anyOf": [ + { + "$ref": "#/$defs/TimeGranularity" + } + ], + "default": "month" + }, + "measure": { + "anyOf": [ + { + "$ref": "#/$defs/MetricInputMeasure" + } + ], + "default": "" + }, + "window": { + "anyOf": [ + { + "type": "string" + } + ], + "default": "", + "title": "Window" + } + }, + "title": "CumulativeMetricTypeParams", + "type": "object" + }, + "DataTests": { + "anyOf": [ + { + "type": "string" + }, + { + "$ref": "#/$defs/RelationshipsTest" + }, + { + "$ref": "#/$defs/AcceptedValuesTest" + }, + { + "$ref": "#/$defs/NotNullTest" + }, + { + "$ref": "#/$defs/UniqueTest" + } + ], + "title": "DataTests" + }, + "Defaults": { + "additionalProperties": false, + "properties": { + "agg_time_dimension": { + "anyOf": [ + { + "type": "string" + } + ], + "default": "", + "title": "Agg Time Dimension" + } + }, + "title": "Defaults", + "type": "object" + }, + "DerivedMetric": { + "additionalProperties": false, + "properties": { + "name": { + "pattern": "(?!.*__).*^[a-z][a-z0-9_]*[a-z0-9]$", + "title": "Name", + "type": "string" + }, + "description": { + "anyOf": [ + { + "type": "string" + } + ], + "default": "", + "title": "Description" + }, + "filter": { + "anyOf": [ + { + "type": "string" + } + ], + "default": "", + "title": "Filter" + }, + "group": { + "anyOf": [ + { + "$ref": "#/$defs/GroupName" + } + ], + "default": "" + }, + "label": { + "title": "Label", + "type": "string" + }, + "time_granularity": { + "anyOf": [ + { + "$ref": "#/$defs/TimeGranularity" + } + ], + "default": "" + }, + "type": { + "$ref": "#/$defs/DerivedMetricType" + }, + "type_params": { + "$ref": "#/$defs/DerivedMetricTypeParams" + } + }, + "required": [ + "name", + "label", + "type", + "type_params" + ], + "title": "DerivedMetric", + "type": "object" + }, + "DerivedMetricType": { + "enum": [ + "DERIVED", + "derived" + ], + "title": "DerivedMetricType", + "type": "string" + }, + "DerivedMetricTypeParams": { + "additionalProperties": false, + "properties": { + "expr": { + "anyOf": [ + { + "type": "string" + } + ], + "default": "", + "title": "Expr" + }, + "metrics": { + "anyOf": [ + { + "items": { + "$ref": "#/$defs/MetricInputSchema" + }, + "type": "array" + } + ], + "default": "", + "title": "Metrics" + } + }, + "title": "DerivedMetricTypeParams", + "type": "object" + }, + "Dimension": { + "anyOf": [ + { + "$ref": "#/$defs/CategoricalDimension" + }, + { + "$ref": "#/$defs/TimeDimension" + } + ], + "title": "Dimension" + }, + "DimensionTypeParams": { + "additionalProperties": false, + "properties": { + "time_granularity": { + "$ref": "#/$defs/TimeGranularity" + }, + "validity_params": { + "anyOf": [ + { + "$ref": "#/$defs/ValidityParams" + } + ], + "default": "" + } + }, + "required": [ + "time_granularity" + ], + "title": "DimensionTypeParams", + "type": "object" + }, + "DocsConfig": { + "additionalProperties": false, + "properties": { + "node_color": { + "anyOf": [ + { + "pattern": "^(#[a-fA-F0-9]{3}|#[a-fA-F0-9]{6}|[^#][a-zA-Z]*)$", + "type": "string" + } + ], + "default": null, + "description": "The color of the node on the DAG in the documentation. It must be an Hex code or a valid CSS color name.", + "title": "Node Color" + }, + "show": { + "anyOf": [ + { + "type": "boolean" + } + ], + "default": true, + "title": "Show" + } + }, + "title": "DocsConfig", + "type": "object" + }, + "Entity": { + "additionalProperties": false, + "properties": { + "name": { + "pattern": "(?!.*__).*^[a-z][a-z0-9_]*[a-z0-9]$", + "title": "Name", + "type": "string" + }, + "type": { + "allOf": [ + { + "$ref": "#/$defs/EntityType" + } + ], + "title": "Entity Type" + }, + "entity": { + "anyOf": [ + { + "type": "string" + } + ], + "default": "", + "title": "Entity" + }, + "expr": { + "anyOf": [ + { + "type": "string" + } + ], + "default": "", + "description": "The field that denotes the entity. Defaults to name if unspecified", + "title": "Expr" + } + }, + "required": [ + "name", + "type" + ], + "title": "Entity", + "type": "object" + }, + "EntityType": { + "enum": [ + "PRIMARY", + "UNIQUE", + "FOREIGN", + "NATURAL", + "primary", + "unique", + "foreign", + "natural" + ], + "title": "EntityType", + "type": "string" + }, + "Export": { + "additionalProperties": false, + "properties": { + "name": { + "title": "Name", + "type": "string" + }, + "config": { + "anyOf": [ + { + "$ref": "#/$defs/ExportConfig" + } + ], + "title": "Export Config" + } + }, + "required": [ + "name", + "config" + ], + "title": "Export", + "type": "object" + }, + "ExportAs": { + "enum": [ + "table", + "view", + "cache" + ], + "title": "ExportAs", + "type": "string" + }, + "ExportConfig": { + "additionalProperties": true, + "properties": { + "alias": { + "anyOf": [ + { + "type": "string" + } + ], + "default": "", + "title": "Alias" + }, + "export_as": { + "anyOf": [ + { + "$ref": "#/$defs/ExportAs" + } + ], + "default": "" + }, + "schema": { + "anyOf": [ + { + "type": "string" + } + ], + "default": "", + "title": "Schema" + } + }, + "title": "ExportConfig", + "type": "object" + }, + "Exposure": { + "properties": { + "name": { + "title": "Name", + "type": "string" + }, + "description": { + "anyOf": [ + { + "type": "string" + } + ], + "default": "", + "title": "Description" + }, + "type": { + "$ref": "#/$defs/Type" + }, + "depends_on": { + "items": { "type": "string" }, - "description": { - "type": "string" + "title": "Depends On", + "type": "array" + }, + "label": { + "anyOf": [ + { + "type": "string" + } + ], + "default": "", + "title": "Label" + }, + "maturity": { + "anyOf": [ + { + "$ref": "#/$defs/Maturity" + } + ], + "default": "medium" + }, + "meta": { + "anyOf": [ + { + "type": "object" + } + ], + "default": "", + "title": "Meta" + }, + "owner": { + "anyOf": [ + { + "$ref": "#/$defs/OwnerWithEmail" + }, + { + "$ref": "#/$defs/OwnerWithName" + } + ], + "title": "Owner" + }, + "tags": { + "anyOf": [ + { + "$ref": "#/$defs/StringOrArrayOfStrings" + } + ], + "default": "" + }, + "url": { + "anyOf": [ + { + "type": "string" + } + ], + "default": "", + "title": "Url" + } + }, + "required": [ + "name", + "type", + "depends_on", + "owner" + ], + "title": "Exposure", + "type": "object" + }, + "FreshnessDefinition": { + "additionalProperties": false, + "properties": { + "warn_after": { + "anyOf": [ + { + "$ref": "#/$defs/FreshnessRules" + } + ], + "default": { + "count": 1.0, + "period": "hour" + } + }, + "error_after": { + "anyOf": [ + { + "$ref": "#/$defs/FreshnessRules" + } + ], + "default": { + "count": 1.0, + "period": "day" + } + }, + "filter": { + "anyOf": [ + { + "type": "string" + } + ], + "default": "", + "title": "Filter" + } + }, + "title": "FreshnessDefinition", + "type": "object" + }, + "FreshnessPeriod": { + "enum": [ + "minute", + "hour", + "day" + ], + "title": "FreshnessPeriod", + "type": "string" + }, + "FreshnessRules": { + "additionalProperties": false, + "properties": { + "count": { + "$ref": "#/$defs/NumberOrJinjaString" + }, + "period": { + "$ref": "#/$defs/FreshnessPeriod" + } + }, + "required": [ + "count", + "period" + ], + "title": "FreshnessRules", + "type": "object" + }, + "Grants": { + "additionalProperties": { + "$ref": "#/$defs/StringOrArrayOfStrings" + }, + "description": "grant config. each key is a database permission and the value is the grantee of that permission", + "title": "Grants", + "type": "object" + }, + "Group": { + "additionalProperties": false, + "properties": { + "name": { + "title": "Name", + "type": "string" + }, + "owner": { + "anyOf": [ + { + "$ref": "#/$defs/OwnerWithEmail" + }, + { + "$ref": "#/$defs/OwnerWithName" + } + ], + "title": "Owner" + } + }, + "required": [ + "name", + "owner" + ], + "title": "Group", + "type": "object" + }, + "GroupName": { + "title": "GroupName", + "type": "string" + }, + "IncludeExclude": { + "properties": { + "exclude": { + "anyOf": [ + { + "$ref": "#/$defs/StringOrArrayOfStrings" + } + ], + "default": "" + }, + "include": { + "anyOf": [ + { + "$ref": "#/$defs/StringOrArrayOfStrings" + } + ], + "default": "" + } + }, + "title": "IncludeExclude", + "type": "object" + }, + "JinjaString": { + "pattern": "\\{\\{.+\\}\\}", + "title": "JinjaString", + "type": "string" + }, + "Macro": { + "additionalProperties": false, + "properties": { + "name": { + "title": "Name", + "type": "string" + }, + "description": { + "anyOf": [ + { + "type": "string" + } + ], + "default": "", + "title": "Description" + }, + "arguments": { + "anyOf": [ + { + "items": { + "$ref": "#/$defs/Argument" + }, + "type": "array" + } + ], + "default": "", + "title": "Arguments" + }, + "docs": { + "anyOf": [ + { + "$ref": "#/$defs/DocsConfig" + } + ], + "default": "" + } + }, + "required": [ + "name" + ], + "title": "Macro", + "type": "object" + }, + "Maturity": { + "enum": [ + "high", + "medium", + "low" + ], + "title": "Maturity", + "type": "string" + }, + "Measure": { + "additionalProperties": false, + "properties": { + "name": { + "pattern": "(?!.*__).*^[a-z][a-z0-9_]*[a-z0-9]$", + "title": "Name", + "type": "string" + }, + "description": { + "anyOf": [ + { + "type": "string" + } + ], + "default": "", + "title": "Description" + }, + "agg": { + "$ref": "#/$defs/Agg" + }, + "agg_params": { + "anyOf": [ + { + "$ref": "#/$defs/AggregationTypeParams" + } + ], + "default": "" + }, + "agg_time_dimension": { + "anyOf": [ + { + "pattern": "(?!.*__).*^[a-z][a-z0-9_]*[a-z0-9]$", + "type": "string" + } + ], + "default": null, + "title": "Agg Time Dimension" + }, + "create_metric": { + "anyOf": [ + { + "type": "boolean" + } + ], + "default": true, + "title": "Create Metric" + }, + "create_metric_display_name": { + "anyOf": [ + { + "type": "string" + } + ], + "default": "", + "title": "Create Metric Display Name" + }, + "expr": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "integer" + }, + { + "type": "boolean" + } + ], + "default": "", + "title": "Expr" + }, + "label": { + "anyOf": [ + { + "type": "string" + } + ], + "default": "", + "title": "Label" + }, + "non_additive_dimension": { + "anyOf": [ + { + "$ref": "#/$defs/NonAdditiveDimension" + } + ], + "default": { + "name": "", + "window_choice": "min", + "window_groupings": [] + }, + "description": "Specify dimensions that the measure should not be aggregated over." + } + }, + "required": [ + "name", + "agg" + ], + "title": "Measure", + "type": "object" + }, + "MetricInputMeasure": { + "additionalProperties": false, + "properties": { + "name": { + "anyOf": [ + { + "type": "string" + } + ], + "default": "", + "title": "Name" + }, + "fill_nulls_with": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "integer" + } + ], + "default": 0, + "title": "Fill Nulls With" + }, + "filter": { + "anyOf": [ + { + "type": "string" + } + ], + "default": "", + "title": "Filter" + }, + "join_to_timespine": { + "anyOf": [ + { + "type": "boolean" + } + ], + "default": true, + "description": "Indicates if the aggregated measure should be joined to the time spine table to fill in missing dates", + "title": "Join To Timespine" + } + }, + "title": "MetricInputMeasure", + "type": "object" + }, + "MetricInputSchema": { + "additionalProperties": false, + "properties": { + "name": { + "anyOf": [ + { + "type": "string" + } + ], + "default": "", + "title": "Name" + }, + "alias": { + "anyOf": [ + { + "type": "string" + } + ], + "default": "", + "title": "Alias" + }, + "filter": { + "anyOf": [ + { + "type": "string" + } + ], + "default": "", + "title": "Filter" + }, + "offset_window": { + "anyOf": [ + { + "type": "string" + } + ], + "default": "", + "title": "Offset Window" + } + }, + "title": "MetricInputSchema", + "type": "object" + }, + "Model": { + "additionalProperties": false, + "properties": { + "name": { + "title": "Name", + "type": "string" + }, + "description": { + "anyOf": [ + { + "type": "string" + } + ], + "default": "", + "title": "Description" + }, + "access": { + "anyOf": [ + { + "$ref": "#/$defs/Access" + } + ], + "default": "private" + }, + "columns": { + "anyOf": [ + { + "items": { + "$ref": "#/$defs/ColumnProperties" + }, + "type": "array" + } + ], + "default": "", + "title": "Columns" + }, + "config": { + "anyOf": [ + { + "$ref": "#/$defs/ModelConfigs" + } + ], + "default": "" + }, + "constraints": { + "anyOf": [ + { + "$ref": "#/$defs/Constraints" + } + ], + "default": "" + }, + "data_tests": { + "anyOf": [ + { + "items": { + "$ref": "#/$defs/DataTests" + }, + "type": "array" + } + ], + "default": "", + "title": "Data Tests" + }, + "deprecation_date": { + "anyOf": [ + { + "type": "string" + } + ], + "default": "", + "title": "Deprecation Date" + }, + "docs": { + "anyOf": [ + { + "$ref": "#/$defs/DocsConfig" + } + ], + "default": "" + }, + "group": { + "anyOf": [ + { + "$ref": "#/$defs/GroupName" + } + ], + "default": "" + }, + "latest_version": { + "anyOf": [ + { + "type": "number" + } + ], + "default": "", + "title": "Latest Version" + }, + "meta": { + "anyOf": [ + { + "type": "object" + } + ], + "default": "", + "title": "Meta" + }, + "tests": { + "anyOf": [ + { + "items": { + "$ref": "#/$defs/DataTests" + }, + "type": "array" + } + ], + "default": "", + "title": "Tests" + }, + "versions": { + "anyOf": [ + { + "items": { + "$ref": "#/$defs/Version" + }, + "type": "array" + } + ], + "default": "", + "title": "Versions" + } + }, + "required": [ + "name" + ], + "title": "Model", + "type": "object" + }, + "ModelConfigs": { + "properties": { + "auto_refresh": { + "anyOf": [ + { + "$ref": "#/$defs/BooleanOrJinjaString" + } + ], + "default": true + }, + "backup": { + "anyOf": [ + { + "$ref": "#/$defs/BooleanOrJinjaString" + } + ], + "default": true + }, + "contract": { + "anyOf": [ + { + "$ref": "#/$defs/Contract" + } + ], + "default": { + "enforced": true + } + }, + "file_format": { + "anyOf": [ + { + "type": "string" + } + ], + "default": "", + "title": "File Format" + }, + "grant_access_to": { + "anyOf": [ + { + "items": { + "$ref": "#/$defs/AuthorizedView" + }, + "type": "array" + } + ], + "default": null, + "description": "Configuration, specific to BigQuery adapter, used to setup authorized views.", + "title": "Authorized views" + }, + "grants": { + "anyOf": [ + { + "$ref": "#/$defs/Grants" + } + ], + "default": { + "select": [ + "reporter_role", + "bi_user" + ] + } + }, + "hours_to_expiration": { + "anyOf": [ + { + "type": "number" + } + ], + "default": 1, + "description": "Configuration specific to BigQuery adapter used to set an expiration delay (in hours) to a table.", + "title": "Hours To Expiration" + }, + "kms_key_name": { + "anyOf": [ + { + "pattern": "projects/[a-zA-Z0-9_-]*/locations/[a-zA-Z0-9_-]*/keyRings/.*/cryptoKeys/.*", + "type": "string" + } + ], + "default": "", + "description": "Configuration of the KMS key name, specific to BigQuery adapter.", + "title": "Kms Key Name" + }, + "labels": { + "anyOf": [ + { + "additionalProperties": { + "type": "string" + }, + "type": "object" + } + ], + "default": { + "key": "value" + }, + "description": "Configuration specific to BigQuery adapter used to add labels and tags to tables/views created by dbt.", + "title": "Label configs" + }, + "location": { + "anyOf": [ + { + "type": "string" + } + ], + "default": "", + "title": "Location" + }, + "materialized": { + "anyOf": [ + { + "type": "string" + } + ], + "default": "", + "title": "Materialized" + }, + "on_configuration_change": { + "anyOf": [ + { + "$ref": "#/$defs/OnConfigurationChange" + } + ], + "default": "" + }, + "on_schema_change": { + "anyOf": [ + { + "$ref": "#/$defs/OnSchemaChange" + } + ], + "default": "" + }, + "snowflake_warehouse": { + "anyOf": [ + { + "type": "string" + } + ], + "default": "", + "title": "Snowflake Warehouse" + }, + "sql_header": { + "anyOf": [ + { + "type": "string" + } + ], + "default": "", + "title": "Sql Header" + }, + "target_lag": { + "anyOf": [ + { + "pattern": "^(?:downstream|\\d+\\s*(?:seconds|minutes|hours|days))$", + "type": "string" + } + ], + "default": null, + "title": "Target Lag" + } + }, + "title": "ModelConfigs", + "type": "object" + }, + "NonAdditiveDimension": { + "additionalProperties": false, + "properties": { + "name": { + "default": "", + "description": "The name of the time dimension (that has already been defined in the data source) that the measure should not be aggregated over.", + "title": "Name", + "type": "string" + }, + "window_choice": { + "allOf": [ + { + "$ref": "#/$defs/WindowChoice" + } + ], + "default": "min", + "description": "`min` and `max` reflect the beginning and end of the time period respectively." + }, + "window_groupings": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + } + ], + "default": [], + "description": "Provide the entities that you would like to group by.", + "title": "Window Groupings" + } + }, + "title": "NonAdditiveDimension", + "type": "object" + }, + "NotNull": { + "properties": { + "name": { + "anyOf": [ + { + "type": "string" + } + ], + "default": "", + "title": "Name" + }, + "config": { + "anyOf": [ + { + "$ref": "#/$defs/TestConfigs" + } + ], + "default": "" + }, + "where": { + "anyOf": [ + { + "type": "string" + } + ], + "default": "", + "title": "Where" + } + }, + "title": "NotNull", + "type": "object" + }, + "NotNullTest": { + "properties": { + "not_null": { + "anyOf": [ + { + "$ref": "#/$defs/NotNull" + } + ], + "default": "" + } + }, + "title": "NotNullTest", + "type": "object" + }, + "NumberOrJinjaString": { + "anyOf": [ + { + "$ref": "#/$defs/JinjaString" + }, + { + "type": "number" + } + ], + "title": "NumberOrJinjaString" + }, + "OnConfigurationChange": { + "enum": [ + "apply", + "continue", + "fail" + ], + "title": "OnConfigurationChange", + "type": "string" + }, + "OnSchemaChange": { + "enum": [ + "append_new_columns", + "fail", + "ignore", + "sync_all_columns" + ], + "title": "OnSchemaChange", + "type": "string" + }, + "Overrides": { + "additionalProperties": false, + "properties": { + "env_vars": { + "anyOf": [ + { + "type": "object" + } + ], + "default": { + "ENV_VAR_NAME": "value" + }, + "title": "Env Vars" + }, + "macros": { + "anyOf": [ + { + "type": "object" + } + ], + "default": null, + "examples": [ + { + "is_incremental": "true" + } + ], + "title": "Macros" + }, + "vars": { + "anyOf": [ + { + "type": "object" + } + ], + "default": { + "var_name": "value" }, - "config": { - "type": "object", - "properties": { - "meta": { - "type": "object" + "title": "Vars" + } + }, + "title": "Overrides", + "type": "object" + }, + "OwnerWithEmail": { + "additionalProperties": false, + "properties": { + "email": { + "title": "Email", + "type": "string" + } + }, + "required": [ + "email" + ], + "title": "OwnerWithEmail", + "type": "object" + }, + "OwnerWithName": { + "additionalProperties": false, + "properties": { + "name": { + "title": "Name", + "type": "string" + } + }, + "required": [ + "name" + ], + "title": "OwnerWithName", + "type": "object" + }, + "PersistDocsConfig": { + "additionalProperties": false, + "properties": { + "columns": { + "anyOf": [ + { + "$ref": "#/$defs/BooleanOrJinjaString" + } + ] + }, + "relation": { + "anyOf": [ + { + "$ref": "#/$defs/BooleanOrJinjaString" + } + ] + } + }, + "title": "PersistDocsConfig", + "type": "object" + }, + "QueryParams": { + "properties": { + "dimensions": { + "anyOf": [ + { + "$ref": "#/$defs/ArrayOfStrings" + } + ], + "default": "" + }, + "metrics": { + "anyOf": [ + { + "$ref": "#/$defs/ArrayOfStrings" + } + ], + "default": "" + }, + "where": { + "anyOf": [ + { + "$ref": "#/$defs/ArrayOfStrings" + } + ], + "default": "" + } + }, + "title": "QueryParams", + "type": "object" + }, + "Quoting": { + "additionalProperties": false, + "properties": { + "database": { + "anyOf": [ + { + "$ref": "#/$defs/BooleanOrJinjaString" + } + ], + "default": "" + }, + "identifier": { + "anyOf": [ + { + "$ref": "#/$defs/BooleanOrJinjaString" + } + ], + "default": "" + }, + "schema": { + "anyOf": [ + { + "$ref": "#/$defs/BooleanOrJinjaString" + } + ], + "default": "" + } + }, + "title": "Quoting", + "type": "object" + }, + "RatioMetric": { + "additionalProperties": false, + "properties": { + "name": { + "pattern": "(?!.*__).*^[a-z][a-z0-9_]*[a-z0-9]$", + "title": "Name", + "type": "string" + }, + "description": { + "anyOf": [ + { + "type": "string" + } + ], + "default": "", + "title": "Description" + }, + "filter": { + "anyOf": [ + { + "type": "string" + } + ], + "default": "", + "title": "Filter" + }, + "group": { + "anyOf": [ + { + "$ref": "#/$defs/GroupName" + } + ], + "default": "" + }, + "label": { + "title": "Label", + "type": "string" + }, + "time_granularity": { + "anyOf": [ + { + "$ref": "#/$defs/TimeGranularity" + } + ], + "default": "" + }, + "type": { + "$ref": "#/$defs/RatioMetricType" + }, + "type_params": { + "$ref": "#/$defs/RatioMetricTypeParams" + } + }, + "required": [ + "name", + "label", + "type", + "type_params" + ], + "title": "RatioMetric", + "type": "object" + }, + "RatioMetricType": { + "enum": [ + "RATIO", + "ratio" + ], + "title": "RatioMetricType", + "type": "string" + }, + "RatioMetricTypeParams": { + "additionalProperties": false, + "properties": { + "denominator": { + "anyOf": [ + { + "$ref": "#/$defs/MetricInputSchema" + } + ], + "default": "" + }, + "filter": { + "anyOf": [ + { + "type": "string" + } + ], + "default": "", + "title": "Filter" + }, + "numerator": { + "anyOf": [ + { + "$ref": "#/$defs/MetricInputSchema" + } + ], + "default": "" + } + }, + "title": "RatioMetricTypeParams", + "type": "object" + }, + "Relationships": { + "additionalProperties": false, + "properties": { + "name": { + "anyOf": [ + { + "type": "string" + } + ], + "default": "", + "title": "Name" + }, + "config": { + "anyOf": [ + { + "$ref": "#/$defs/TestConfigs" + } + ], + "default": "" + }, + "field": { + "description": "The foreign key column", + "title": "Relationships: Field", + "type": "string" + }, + "to": { + "examples": [ + "ref('parent_model')", + "source('parent_schema', 'parent_table')" + ], + "title": "To", + "type": "string" + }, + "where": { + "anyOf": [ + { + "type": "string" + } + ], + "default": "", + "title": "Where" + } + }, + "required": [ + "field", + "to" + ], + "title": "Relationships", + "type": "object" + }, + "RelationshipsTest": { + "properties": { + "relationships": { + "anyOf": [ + { + "$ref": "#/$defs/Relationships" + } + ], + "default": "" + } + }, + "title": "RelationshipsTest", + "type": "object" + }, + "SavedQuery": { + "additionalProperties": false, + "properties": { + "name": { + "title": "Name", + "type": "string" + }, + "description": { + "title": "Description", + "type": "string" + }, + "exports": { + "anyOf": [ + { + "items": { + "$ref": "#/$defs/Export" }, - "tags": { - "$ref": "#/$defs/string_or_array_of_strings" - } - }, - "additionalProperties": false - }, - "expect": { - "type": "object", - "if": { - "properties": { - "format": { - "const": "dict" - } - } - }, - "then": { - "properties": { - "rows": { - "description": "When `format` is `dict`, each item should be a dictionary containing a key-value pair for each column and its value, e.g. `{id: 1, code: 'ABC'}`", - "type": "array", - "items": { - "type": "object" - } - } - } - }, - "else": { - "properties": { - "rows": { - "description": "When `format` is csv or sql, a string containing comma-separated headers and values. Alternatively provide a fixture. Use the pipe character | to create a multi-line string in YAML.", - "type": "string" - } - } - }, - "properties": { - "fixture": { - "description": "Only relevant when format is csv. Specify the name of a fixture instead of providing `rows`.", - "type": "string" + "type": "array" + } + ], + "default": "", + "title": "Exports" + }, + "label": { + "title": "Label", + "type": "string" + }, + "query_params": { + "$ref": "#/$defs/QueryParams" + } + }, + "required": [ + "name", + "description", + "label", + "query_params" + ], + "title": "SavedQuery", + "type": "object" + }, + "Seed": { + "additionalProperties": false, + "properties": { + "name": { + "title": "Name", + "type": "string" + }, + "description": { + "anyOf": [ + { + "type": "string" + } + ], + "default": "", + "title": "Description" + }, + "columns": { + "anyOf": [ + { + "items": { + "$ref": "#/$defs/ColumnProperties" }, - "format": { - "description": "Defaults to `dict` when not specified", - "type": "string", - "enum": [ - "dict", - "sql", - "csv" - ] + "type": "array" + } + ], + "default": "", + "title": "Columns" + }, + "config": { + "anyOf": [ + { + "$ref": "#/$defs/SeedConfig" + } + ], + "default": "", + "title": "Seed Config" + }, + "docs": { + "anyOf": [ + { + "$ref": "#/$defs/DocsConfig" + } + ], + "default": "" + }, + "group": { + "anyOf": [ + { + "$ref": "#/$defs/GroupName" + } + ], + "default": "" + }, + "tests": { + "anyOf": [ + { + "items": { + "$ref": "#/$defs/DataTests" }, - "additionalProperties": false + "type": "array" } - }, - "given": { - "type": "array", - "items": { - "type": "object", - "if": { - "properties": { - "format": { - "const": "dict" - } - } + ], + "default": "", + "title": "Tests" + } + }, + "required": [ + "name" + ], + "title": "Seed", + "type": "object" + }, + "SeedConfig": { + "properties": { + "column_types": { + "anyOf": [ + { + "type": "object" + } + ], + "default": "", + "title": "Column Types" + }, + "copy_grants": { + "anyOf": [ + { + "$ref": "#/$defs/BooleanOrJinjaString" + } + ], + "default": true + }, + "data_tests": { + "anyOf": [ + { + "items": { + "$ref": "#/$defs/DataTests" }, - "then": { - "properties": { - "rows": { - "description": "When `format` is `dict`, each item should be a dictionary containing a key-value pair for each column and its value, e.g. `{id: 1, code: 'ABC'}`", - "type": "array", - "items": { - "type": "object" - } - } - } + "type": "array" + } + ], + "default": "", + "title": "Data Tests" + }, + "database": { + "anyOf": [ + { + "type": "string" + } + ], + "default": "", + "title": "Database" + }, + "enabled": { + "anyOf": [ + { + "$ref": "#/$defs/BooleanOrJinjaString" + } + ], + "default": false + }, + "grants": { + "anyOf": [ + { + "$ref": "#/$defs/Grants" + } + ], + "default": { + "select": [ + "reporter_role", + "bi_user" + ] + } + }, + "quote_columns": { + "anyOf": [ + { + "$ref": "#/$defs/BooleanOrJinjaString" + } + ], + "default": "" + }, + "schema": { + "anyOf": [ + { + "type": "string" + } + ], + "default": null, + "title": "Schema" + } + }, + "title": "SeedConfig", + "type": "object" + }, + "SemanticModel": { + "additionalProperties": false, + "properties": { + "name": { + "pattern": "(?!.*__).*^[a-z][a-z0-9_]*[a-z0-9]$", + "title": "Name", + "type": "string" + }, + "description": { + "anyOf": [ + { + "type": "string" + } + ], + "default": "", + "title": "Description" + }, + "defaults": { + "anyOf": [ + { + "$ref": "#/$defs/Defaults" + } + ], + "default": "" + }, + "dimensions": { + "anyOf": [ + { + "items": { + "$ref": "#/$defs/Dimension" }, - "else": { - "properties": { - "rows": { - "description": "When `format` is csv or sql, a string containing comma-separated headers and values. Alternatively provide a fixture. Use the pipe character | to create a multi-line string in YAML.", - "type": "string" - } - } + "type": "array" + } + ], + "default": "", + "title": "Dimensions" + }, + "entities": { + "anyOf": [ + { + "items": { + "$ref": "#/$defs/Entity" + }, + "type": "array" + } + ], + "default": "", + "title": "Entities" + }, + "measures": { + "anyOf": [ + { + "items": { + "$ref": "#/$defs/Measure" + }, + "type": "array" + } + ], + "default": "", + "title": "Measures" + }, + "model": { + "title": "Model", + "type": "string" + }, + "primary_entity": { + "anyOf": [ + { + "type": "string" + } + ], + "default": "", + "title": "Primary Entity" + } + }, + "required": [ + "name", + "model" + ], + "title": "SemanticModel", + "type": "object" + }, + "Severity": { + "enum": [ + "warn", + "error" + ], + "title": "Severity", + "type": "string" + }, + "SimpleMetric": { + "additionalProperties": false, + "properties": { + "name": { + "pattern": "(?!.*__).*^[a-z][a-z0-9_]*[a-z0-9]$", + "title": "Name", + "type": "string" + }, + "description": { + "anyOf": [ + { + "type": "string" + } + ], + "default": "", + "title": "Description" + }, + "filter": { + "anyOf": [ + { + "type": "string" + } + ], + "default": "", + "title": "Filter" + }, + "group": { + "anyOf": [ + { + "$ref": "#/$defs/GroupName" + } + ], + "default": "" + }, + "label": { + "title": "Label", + "type": "string" + }, + "time_granularity": { + "anyOf": [ + { + "$ref": "#/$defs/TimeGranularity" + } + ], + "default": "" + }, + "type": { + "$ref": "#/$defs/SimpleMetricType" + }, + "type_params": { + "$ref": "#/$defs/SimpleMetricTypeParams" + } + }, + "required": [ + "name", + "label", + "type", + "type_params" + ], + "title": "SimpleMetric", + "type": "object" + }, + "SimpleMetricType": { + "enum": [ + "SIMPLE", + "simple" + ], + "title": "SimpleMetricType", + "type": "string" + }, + "SimpleMetricTypeParams": { + "additionalProperties": false, + "properties": { + "measure": { + "anyOf": [ + { + "$ref": "#/$defs/MetricInputMeasure" + } + ], + "default": "" + } + }, + "title": "SimpleMetricTypeParams", + "type": "object" + }, + "Snapshot": { + "additionalProperties": false, + "properties": { + "name": { + "title": "Name", + "type": "string" + }, + "description": { + "anyOf": [ + { + "type": "string" + } + ], + "default": "", + "title": "Description" + }, + "columns": { + "anyOf": [ + { + "items": { + "$ref": "#/$defs/ColumnProperties" }, - "properties": { - "fixture": { - "description": "Only relevant when format is csv. Specify the name of a fixture instead of providing `rows`.", - "type": "string" - }, - "format": { - "description": "Defaults to `dict` when not specified", - "type": "string", - "enum": [ - "dict", - "csv", - "sql" - ] - }, - "input": { - "description": "The relation whose inputs you need to mock. Enclose in ref or source without curly braces", - "type": "string", - "examples": [ - "ref('model_b')", - "ref('upstream_project', 'model_b')", - "source('schema', 'table')" - ] - }, - "additionalProperties": false - } + "type": "array" } - }, - "model": { - "description": "The name of the model whose behaviour you are testing. Does not need to be wrapped in a ref.", - "type": "string", - "examples": [ - "my_model" - ] - }, - "overrides": { - "type": "object", - "properties": { - "env_vars": { - "type": "object" - }, - "macros": { - "type": "object", - "examples": [ - { - "is_incremental": "true" - } - ] + ], + "default": "", + "title": "Columns" + }, + "config": { + "anyOf": [ + { + "$ref": "#/$defs/SnapshotConfig" + } + ], + "default": "", + "title": "Snapshot Config" + }, + "data_tests": { + "anyOf": [ + { + "items": { + "$ref": "#/$defs/DataTests" }, - "vars": { - "type": "object" - } - }, - "additionalProperties": false - }, - "additionalProperties": false + "type": "array" + } + ], + "default": "", + "title": "Data Tests" }, - "additionalProperties": false - } - } - }, - "additionalProperties": false, - "$defs": { - "aggregation_type_params": { - "type": "object", - "properties": { - "percentile": { - "type": "number" + "docs": { + "anyOf": [ + { + "$ref": "#/$defs/DocsConfig" + } + ], + "default": "" }, - "use_approximate_percentile": { - "type": "boolean" + "group": { + "anyOf": [ + { + "$ref": "#/$defs/GroupName" + } + ], + "default": "" }, - "use_discrete_percentile": { - "type": "boolean" - } - }, - "additionalProperties": false - }, - "array_of_strings": { - "type": "array", - "items": { - "type": "string" - } - }, - "boolean_or_jinja_string": { - "oneOf": [ - { - "$ref": "#/$defs/jinja_string" + "meta": { + "anyOf": [ + { + "type": "object" + } + ], + "default": "", + "title": "Meta" }, - { - "type": "boolean" + "tests": { + "anyOf": [ + { + "items": { + "$ref": "#/$defs/DataTests" + }, + "type": "array" + } + ], + "default": "", + "title": "Tests" } - ], - "additionalProperties": false - }, - "column_properties": { - "type": "object", + }, "required": [ "name" ], - "uniqueItems": true, + "title": "Snapshot", + "type": "object" + }, + "SnapshotConfig": { "properties": { - "name": { - "type": "string" + "alias": { + "anyOf": [ + { + "type": "string" + } + ], + "default": "", + "title": "Alias" }, - "description": { - "type": "string" + "check_cols": { + "anyOf": [ + { + "$ref": "#/$defs/StringOrArrayOfStrings" + } + ], + "default": "" }, - "constraints": { - "$ref": "#/$defs/constraints" + "enabled": { + "anyOf": [ + { + "$ref": "#/$defs/BooleanOrJinjaString" + } + ], + "default": false }, - "data_tests": { - "type": "array", - "items": { - "$ref": "#/$defs/data_tests" + "grants": { + "anyOf": [ + { + "$ref": "#/$defs/Grants" + } + ], + "default": { + "select": [ + "reporter_role", + "bi_user" + ] } }, - "data_type": { - "type": "string" + "persist_docs": { + "anyOf": [ + { + "$ref": "#/$defs/PersistDocsConfig" + } + ], + "default": "" }, - "granularity": { - "enum": [ - "nanosecond", - "microsecond", - "millisecond", - "second", - "minute", - "hour", - "day", - "week", - "month", - "quarter", - "year" - ] + "post-hook": { + "anyOf": [ + { + "$ref": "#/$defs/ArrayOfStrings" + } + ], + "default": "" }, - "meta": { - "type": "object" + "pre-hook": { + "anyOf": [ + { + "$ref": "#/$defs/ArrayOfStrings" + } + ], + "default": "" }, - "policy_tags": { - "title": "Policy tags", - "description": "Configurations, specific to BigQuery adapter, used to set policy tags on specific columns, enabling column-level security. Only relevant when `persist_docs.columns` is true.", - "type": "array", - "items": { - "type": "string" - } + "quote_columns": { + "anyOf": [ + { + "$ref": "#/$defs/BooleanOrJinjaString" + } + ], + "default": "" }, - "quote": { - "$ref": "#/$defs/boolean_or_jinja_string" + "strategy": { + "anyOf": [ + { + "type": "string" + } + ], + "default": "", + "title": "Strategy" }, "tags": { - "$ref": "#/$defs/string_or_array_of_strings" + "anyOf": [ + { + "$ref": "#/$defs/StringOrArrayOfStrings" + } + ], + "default": "" }, - "tests": { - "type": "array", - "items": { - "$ref": "#/$defs/data_tests" - } + "target_database": { + "anyOf": [ + { + "type": "string" + } + ], + "default": "", + "title": "Target Database" + }, + "target_schema": { + "anyOf": [ + { + "type": "string" + } + ], + "default": "", + "title": "Target Schema" + }, + "unique_key": { + "anyOf": [ + { + "$ref": "#/$defs/StringOrArrayOfStrings" + } + ], + "default": "" + }, + "updated_at": { + "anyOf": [ + { + "type": "string" + } + ], + "default": "", + "title": "Updated At" } }, - "additionalProperties": false - }, - "constraints": { - "type": "array", - "items": { - "type": "object", - "required": [ - "type" - ], - "properties": { - "name": { - "type": "string" - }, - "type": { - "type": "string" - }, - "columns": { - "$ref": "#/$defs/string_or_array_of_strings" - }, - "expression": { - "type": "string" - }, - "warn_unenforced": { - "$ref": "#/$defs/boolean_or_jinja_string" - }, - "warn_unsupported": { - "$ref": "#/$defs/boolean_or_jinja_string" - } - } - } + "title": "SnapshotConfig", + "type": "object" }, - "conversion_metric_type_params": { - "type": "object", + "Source": { "properties": { - "conversion_type_params": { - "type": "object", - "required": [ - "entity", - "base_measure", - "conversion_measure" - ], - "properties": { - "base_measure": { - "$ref": "#/$defs/metric_input_measure" - }, - "calculation": { - "type": "string", - "default": "conversion_rate", - "enum": [ - "conversions", - "conversion_rate", - "CONVERSIONS", - "CONVERSION_RATE" - ] - }, - "constant_properties": { - "type": "array", + "name": { + "description": "How you will identify the schema in {{ source() }} calls. Unless `schema` is also set, this will be the name of the schema in the database.", + "title": "Name", + "type": "string" + }, + "description": { + "anyOf": [ + { + "type": "string" + } + ], + "default": "", + "title": "Description" + }, + "config": { + "anyOf": [ + { + "type": "object" + } + ], + "default": "", + "title": "Config" + }, + "data_tests": { + "anyOf": [ + { "items": { - "type": "object", - "required": [ - "base_property", - "conversion_property" - ], - "properties": { - "base_property": { - "description": "DIMENSION or ENTITY", - "type": "string" - }, - "conversion_property": { - "description": "DIMENSION or ENTITY", - "type": "string" - } - } - } + "$ref": "#/$defs/DataTests" + }, + "type": "array" + } + ], + "default": "", + "title": "Data Tests" + }, + "database": { + "anyOf": [ + { + "type": "string" + } + ], + "default": "", + "title": "Database" + }, + "freshness": { + "$comment": "truly_nullable", + "anyOf": [ + { + "$ref": "#/$defs/FreshnessDefinition" }, - "conversion_measure": { - "$ref": "#/$defs/metric_input_measure" + { + "type": "null" + } + ], + "default": { + "warn_after": { + "count": 1.0, + "period": "hour" }, - "entity": { - "description": "The entity to calculate over", - "type": "string" + "error_after": { + "count": 1.0, + "period": "day" }, - "window": { + "filter": "" + } + }, + "loaded_at_field": { + "anyOf": [ + { "type": "string" } - }, - "additionalProperties": false - } - }, - "additionalProperties": false - }, - "cumulative_metric_type_params": { - "type": "object", - "properties": { - "cumulative_type_params": { - "type": "object", - "properties": { - "window": { + ], + "default": "", + "title": "Loaded At Field" + }, + "loader": { + "anyOf": [ + { "type": "string" - }, - "grain_to_date": { - "enum": [ - "nanosecond", - "microsecond", - "millisecond", - "second", - "minute", - "hour", - "day", - "week", - "month", - "quarter", - "year" - ] - }, - "period_agg": { - "enum": [ - "first", - "last", - "average" - ] } - }, - "additionalProperties": false - }, - "grain_to_date": { - "enum": [ - "nanosecond", - "microsecond", - "millisecond", - "second", - "minute", - "hour", - "day", - "week", - "month", - "quarter", - "year" - ] + ], + "default": "", + "title": "Loader" }, - "measure": { - "$ref": "#/$defs/metric_input_measure" + "meta": { + "anyOf": [ + { + "type": "object" + } + ], + "default": "", + "title": "Meta" }, - "window": { - "type": "string" - } - }, - "additionalProperties": false - }, - "data_tests": { - "anyOf": [ - { - "type": "string" + "overrides": { + "anyOf": [ + { + "type": "string" + } + ], + "default": null, + "description": "The name of another package installed in your project. If that package has a source with the same name as this one, its properties will be applied on top of the base properties of the overridden source. https://docs.getdbt.com/reference/resource-properties/overrides", + "title": "Package to Override" }, - { - "title": "Relationships Test", - "type": "object", - "properties": { - "relationships": { - "type": "object", - "required": [ - "to", - "field" - ], - "properties": { - "name": { - "type": "string" - }, - "config": { - "$ref": "#/$defs/test_configs" - }, - "field": { - "title": "Relationships: Field", - "description": "The foreign key column", - "type": "string", - "default": "" - }, - "to": { - "type": "string", - "default": "ref('')", - "examples": [ - "ref('parent_model')", - "source('parent_schema', 'parent_table')" - ] - }, - "where": { - "type": "string" - } - } + "quoting": { + "anyOf": [ + { + "$ref": "#/$defs/Quoting" } - } + ], + "default": "" }, - { - "title": "Accepted Values Test", - "type": "object", - "properties": { - "accepted_values": { - "type": "object", - "required": [ - "values" - ], - "properties": { - "name": { - "type": "string" - }, - "config": { - "$ref": "#/$defs/test_configs" - }, - "quote": { - "type": "boolean" - }, - "values": { - "type": "array", - "items": { - "type": "string" - } - }, - "where": { - "type": "string" - } - } + "schema": { + "anyOf": [ + { + "type": "string" } - } + ], + "default": null, + "description": "The schema name as stored in the database. Only needed if you want to use a different `name` than what exists in the database (otherwise `name` is used by default)", + "title": "Schema" }, - { - "title": "Not Null Test", - "type": "object", - "properties": { - "not_null": { - "type": "object", - "properties": { - "name": { - "type": "string" - }, - "config": { - "$ref": "#/$defs/test_configs" - }, - "where": { - "type": "string" - } - } + "tables": { + "anyOf": [ + { + "items": { + "$ref": "#/$defs/Table" + }, + "type": "array" } - } + ], + "default": "", + "title": "Tables" }, - { - "title": "Unique Test", - "type": "object", - "properties": { - "unique": { - "type": "object", - "properties": { - "name": { - "type": "string" - }, - "config": { - "$ref": "#/$defs/test_configs" - }, - "where": { - "type": "string" - } - } + "tags": { + "anyOf": [ + { + "$ref": "#/$defs/StringOrArrayOfStrings" } - } - } - ] - }, - "derived_metric_type_params": { - "type": "object", - "properties": { - "expr": { - "type": "string" + ], + "default": "" }, - "metrics": { - "type": "array", - "items": { - "$ref": "#/$defs/metric_input_schema" - } + "tests": { + "anyOf": [ + { + "items": { + "$ref": "#/$defs/DataTests" + }, + "type": "array" + } + ], + "default": "", + "title": "Tests" } }, - "additionalProperties": false - }, - "dimension": { - "type": "object", "required": [ - "name", - "type" + "name" ], + "title": "Source", + "type": "object" + }, + "StringOrArrayOfStrings": { "anyOf": [ { - "not": { - "$ref": "#/$defs/is-time-dimension" - } + "type": "string" }, { - "required": [ - "type_params" - ] + "$ref": "#/$defs/ArrayOfStrings" } ], + "title": "StringOrArrayOfStrings" + }, + "Table": { + "additionalProperties": false, "properties": { "name": { - "type": "string", - "pattern": "(?!.*__).*^[a-z][a-z0-9_]*[a-z0-9]$" + "description": "How you will identify the table in {{ source() }} calls. Unless `identifier` is also set, this will be the name of the table in the database.", + "title": "Name", + "type": "string" }, "description": { - "type": "string" + "anyOf": [ + { + "type": "string" + } + ], + "default": "", + "title": "Description" }, - "type": { - "enum": [ - "CATEGORICAL", - "TIME", - "categorical", - "time" - ] + "columns": { + "anyOf": [ + { + "items": { + "$ref": "#/$defs/ColumnProperties" + }, + "type": "array" + } + ], + "default": "", + "title": "Columns" }, - "expr": { - "type": [ - "string", - "boolean" - ] + "external": { + "anyOf": [ + { + "type": "object" + } + ], + "default": "", + "title": "External" }, - "is_partition": { - "type": "boolean" + "freshness": { + "$comment": "truly_nullable", + "anyOf": [ + { + "$ref": "#/$defs/FreshnessDefinition" + }, + { + "type": "null" + } + ], + "default": { + "warn_after": { + "count": 1.0, + "period": "hour" + }, + "error_after": { + "count": 1.0, + "period": "day" + }, + "filter": "" + } }, - "type_params": { - "$ref": "#/$defs/dimension_type_params" - } - }, - "additionalProperties": false - }, - "dimension_type_params": { - "type": "object", - "required": [ - "time_granularity" - ], - "properties": { - "time_granularity": { - "enum": [ - "NANOSECOND", - "MICROSECOND", - "MILLISECOND", - "SECOND", - "MINUTE", - "HOUR", - "DAY", - "WEEK", - "MONTH", - "QUARTER", - "YEAR", - "nanosecond", - "microsecond", - "millisecond", - "second", - "minute", - "hour", - "day", - "week", - "month", - "quarter", - "year" - ] + "identifier": { + "anyOf": [ + { + "type": "string" + } + ], + "default": null, + "description": "The table name as stored in the database. Only needed if you want to give the source a different name than what exists in the database (otherwise `name` is used by default)", + "title": "Identifier" }, - "validity_params": { - "$ref": "#/$defs/validity_params" - } - }, - "additionalProperties": false - }, - "docs_config": { - "title": "Docs config", - "description": "Configurations for the appearance of nodes in the dbt documentation.", - "type": "object", - "properties": { - "node_color": { - "description": "The color of the node on the DAG in the documentation. It must be an Hex code or a valid CSS color name.", - "type": "string", - "pattern": "^(#[a-fA-F0-9]{3}|#[a-fA-F0-9]{6}|[^#][a-zA-Z]*)$" + "loaded_at_field": { + "anyOf": [ + { + "type": "string" + } + ], + "default": null, + "description": "Which column to check during data freshness tests. Only needed if the table has a different loaded_at_field to the one defined on the source overall.", + "title": "Loaded At Field" }, - "show": { - "type": "boolean", - "default": true - } - }, - "additionalProperties": false - }, - "entity": { - "type": "object", - "required": [ - "name", - "type" - ], - "properties": { - "name": { - "type": "string", - "pattern": "(?!.*__).*^[a-z][a-z0-9_]*[a-z0-9]$" + "loader": { + "anyOf": [ + { + "type": "string" + } + ], + "default": "", + "title": "Loader" }, - "type": { - "enum": [ - "PRIMARY", - "UNIQUE", - "FOREIGN", - "NATURAL", - "primary", - "unique", - "foreign", - "natural" - ] + "meta": { + "anyOf": [ + { + "type": "object" + } + ], + "default": "", + "title": "Meta" }, - "entity": { - "type": "string" + "quoting": { + "anyOf": [ + { + "$ref": "#/$defs/Quoting" + } + ], + "default": "" }, - "expr": { - "type": [ - "string", - "boolean" - ] + "tags": { + "anyOf": [ + { + "$ref": "#/$defs/StringOrArrayOfStrings" + } + ], + "default": "" + }, + "tests": { + "anyOf": [ + { + "items": { + "$ref": "#/$defs/DataTests" + }, + "type": "array" + } + ], + "default": "", + "title": "Tests" } }, - "additionalProperties": false - }, - "export": { - "type": "object", "required": [ "name" ], + "title": "Table", + "type": "object" + }, + "TestConfigs": { "properties": { - "name": { - "type": "string" - }, - "config": { - "type": "object", - "properties": { - "alias": { - "type": "string" - }, - "export_as": { - "enum": [ - "table", - "view", - "cache" - ] - }, - "schema": { + "alias": { + "anyOf": [ + { "type": "string" } - }, - "additionalProperties": true - } - }, - "additionalProperties": false - }, - "freshness_definition": { - "default": { - "error_after": { - "count": 2, - "period": "day" + ], + "default": null, + "description": "Only relevant when `store_failures` is true", + "title": "Alias" }, - "warn_after": { - "count": 1, - "period": "day" - } - }, - "oneOf": [ - { - "type": "object", - "properties": { - "error_after": { - "$ref": "#/$defs/freshness_rules" - }, - "filter": { + "database": { + "anyOf": [ + { "type": "string" - }, - "warn_after": { - "$ref": "#/$defs/freshness_rules" } - }, - "additionalProperties": false - }, - { - "const": null - } - ] - }, - "freshness_rules": { - "type": "object", - "required": [ - "count", - "period" - ], - "properties": { - "count": { - "$ref": "#/$defs/number_or_jinja_string" - }, - "period": { - "type": "string", - "enum": [ - "minute", - "hour", - "day" - ] - } - }, - "additionalProperties": false - }, - "grants": { - "description": "grant config. each key is a database permission and the value is the grantee of that permission", - "type": "object", - "patternProperties": { - ".*": { - "$ref": "#/$defs/string_or_array_of_strings" - } - }, - "additionalProperties": false - }, - "group": { - "type": "string" - }, - "include_exclude": { - "type": "object", - "properties": { - "exclude": { - "$ref": "#/$defs/string_or_array_of_strings" - }, - "include": { - "$ref": "#/$defs/string_or_array_of_strings" - } - } - }, - "is-time-dimension": { - "required": [ - "type" - ], - "properties": { - "type": { - "enum": [ - "TIME", - "time" - ] - } - } - }, - "jinja_string": { - "type": "string", - "pattern": "\\{\\{.*\\}\\}" - }, - "measure": { - "type": "object", - "required": [ - "name", - "agg" - ], - "properties": { - "name": { - "type": "string", - "pattern": "(?!.*__).*^[a-z][a-z0-9_]*[a-z0-9]$" + ], + "default": null, + "description": "Only relevant when `store_failures` is true", + "title": "Database" }, - "description": { - "type": "string" + "enabled": { + "anyOf": [ + { + "$ref": "#/$defs/BooleanOrJinjaString" + } + ], + "default": false }, - "agg": { - "enum": [ - "SUM", - "MIN", - "MAX", - "AVERAGE", - "COUNT_DISTINCT", - "SUM_BOOLEAN", - "COUNT", - "PERCENTILE", - "MEDIAN", - "sum", - "min", - "max", - "average", - "count_distinct", - "sum_boolean", - "count", - "percentile", - "median" - ] + "error_if": { + "anyOf": [ + { + "type": "string" + } + ], + "default": "", + "title": "Error If" }, - "agg_params": { - "$ref": "#/$defs/aggregation_type_params" + "fail_calc": { + "anyOf": [ + { + "type": "string" + } + ], + "default": "", + "title": "Fail Calc" }, - "agg_time_dimension": { - "type": "string", - "pattern": "(?!.*__).*^[a-z][a-z0-9_]*[a-z0-9]$" + "limit": { + "anyOf": [ + { + "type": "number" + } + ], + "default": 20, + "title": "Limit" }, - "create_metric": { - "type": "boolean" + "schema": { + "anyOf": [ + { + "type": "string" + } + ], + "default": null, + "description": "Only relevant when `store_failures` is true", + "title": "Schema" }, - "create_metric_display_name": { - "type": "string" + "severity": { + "anyOf": [ + { + "$ref": "#/$defs/JinjaString" + }, + { + "$ref": "#/$defs/Severity" + } + ], + "default": "warn", + "title": "Severity" }, - "expr": { - "type": [ - "string", - "integer", - "boolean" - ] + "store_failures": { + "anyOf": [ + { + "$ref": "#/$defs/BooleanOrJinjaString" + } + ], + "default": true }, - "label": { - "type": "string" + "tags": { + "anyOf": [ + { + "$ref": "#/$defs/StringOrArrayOfStrings" + } + ], + "default": "" }, - "non_additive_dimension": { - "$ref": "#/$defs/non_additive_dimension" + "warn_if": { + "anyOf": [ + { + "type": "string" + } + ], + "default": "", + "title": "Warn If" } }, - "additionalProperties": false + "title": "TestConfigs", + "type": "object" }, - "metric_input_measure": { - "type": "object", + "TimeDimension": { + "additionalProperties": false, "properties": { "name": { + "pattern": "(?!.*__).*^[a-z][a-z0-9_]*[a-z0-9]$", + "title": "Name", "type": "string" }, - "fill_nulls_with": { + "description": { + "anyOf": [ + { + "type": "string" + } + ], + "default": "", + "title": "Description" + }, + "expr": { "anyOf": [ { "type": "string" }, { - "type": "integer" + "type": "boolean" } - ] + ], + "default": "", + "title": "Expr" }, - "filter": { - "type": "string" + "is_partition": { + "anyOf": [ + { + "type": "boolean" + } + ], + "default": true, + "title": "Is Partition" }, - "join_to_timespine": { - "type": "boolean" + "type": { + "$ref": "#/$defs/TimeDimensionType" + }, + "type_params": { + "$ref": "#/$defs/DimensionTypeParams" } }, - "additionalProperties": false + "required": [ + "name", + "type", + "type_params" + ], + "title": "TimeDimension", + "type": "object" + }, + "TimeDimensionType": { + "enum": [ + "TIME", + "time" + ], + "title": "TimeDimensionType", + "type": "string" + }, + "TimeGranularity": { + "enum": [ + "NANOSECOND", + "MICROSECOND", + "MILLISECOND", + "SECOND", + "MINUTE", + "HOUR", + "DAY", + "WEEK", + "MONTH", + "QUARTER", + "YEAR", + "nanosecond", + "microsecond", + "millisecond", + "second", + "minute", + "hour", + "day", + "week", + "month", + "quarter", + "year" + ], + "title": "TimeGranularity", + "type": "string" + }, + "Type": { + "enum": [ + "dashboard", + "notebook", + "analysis", + "ml", + "application" + ], + "title": "Type", + "type": "string" }, - "metric_input_schema": { - "type": "object", + "Unique": { "properties": { "name": { - "type": "string" - }, - "alias": { - "type": "string" + "anyOf": [ + { + "type": "string" + } + ], + "default": "", + "title": "Name" }, - "filter": { - "type": "string" + "config": { + "anyOf": [ + { + "$ref": "#/$defs/TestConfigs" + } + ], + "default": "" }, - "offset_window": { - "type": "string" + "where": { + "anyOf": [ + { + "type": "string" + } + ], + "default": "", + "title": "Where" } }, - "additionalProperties": false + "title": "Unique", + "type": "object" }, - "model_configs": { - "type": "object", + "UniqueTest": { "properties": { - "auto_refresh": { - "$ref": "#/$defs/boolean_or_jinja_string" - }, - "backup": { - "$ref": "#/$defs/boolean_or_jinja_string" - }, - "contract": { - "type": "object", - "properties": { - "enforced": { - "$ref": "#/$defs/boolean_or_jinja_string" + "unique": { + "anyOf": [ + { + "$ref": "#/$defs/Unique" } - } - }, - "file_format": { + ], + "default": "" + } + }, + "title": "UniqueTest", + "type": "object" + }, + "UnitTest": { + "additionalProperties": false, + "properties": { + "name": { + "title": "Name", "type": "string" }, - "grant_access_to": { - "title": "Authorized views", - "description": "Configuration, specific to BigQuery adapter, used to setup authorized views.", - "type": "array", - "items": { - "type": "object", - "required": [ - "database", - "project" - ], - "properties": { - "database": { - "type": "string" - }, - "project": { - "type": "string" - } - }, - "additionalProperties": false - } - }, - "grants": { - "$ref": "#/$defs/grants" - }, - "hours_to_expiration": { - "description": "Configuration specific to BigQuery adapter used to set an expiration delay (in hours) to a table.", - "type": "number" - }, - "kms_key_name": { - "description": "Configuration of the KMS key name, specific to BigQuery adapter.", - "type": "string", - "pattern": "projects/[a-zA-Z0-9_-]*/locations/[a-zA-Z0-9_-]*/keyRings/.*/cryptoKeys/.*" - }, - "labels": { - "title": "Label configs", - "description": "Configuration specific to BigQuery adapter used to add labels and tags to tables/views created by dbt.", - "type": "object", - "patternProperties": { - "^[a-z][a-z0-9_-]{0,62}$": { - "type": "string", - "pattern": "^[a-z0-9_-]{0,63}$" + "description": { + "anyOf": [ + { + "type": "string" } - }, - "additionalProperties": false - }, - "location": { - "type": "string" - }, - "materialized": { - "type": "string" + ], + "default": "", + "title": "Description" }, - "on_configuration_change": { - "type": "string", - "enum": [ - "apply", - "continue", - "fail" - ] + "config": { + "anyOf": [ + { + "$ref": "#/$defs/UnitTestConfig" + } + ], + "default": null, + "title": "Unit Test Config" }, - "on_schema_change": { - "type": "string", - "enum": [ - "append_new_columns", - "fail", - "ignore", - "sync_all_columns" - ] + "expect": { + "anyOf": [ + { + "$ref": "#/$defs/UnitTestExpectDict" + }, + { + "$ref": "#/$defs/UnitTestExpectCSV" + }, + { + "$ref": "#/$defs/UnitTestExpectSQL" + } + ], + "title": "Expect" }, - "snowflake_warehouse": { - "type": "string" + "given": { + "anyOf": [ + { + "items": { + "anyOf": [ + { + "$ref": "#/$defs/UnitTestGivenDict" + }, + { + "$ref": "#/$defs/UnitTestGivenCSV" + }, + { + "$ref": "#/$defs/UnitTestGivenSQL" + } + ] + }, + "type": "array" + } + ], + "default": [ + { + "format": "dict", + "rows": [ + { + "col1": "value1", + "col2": "value2" + } + ], + "input": "" + } + ], + "title": "Given" }, - "sql_header": { + "model": { + "description": "The name of the model whose behaviour you are testing. Does not need to be wrapped in a ref.", + "examples": [ + "my_model" + ], + "title": "Model", "type": "string" }, - "target_lag": { - "type": "string", - "pattern": "^(?:downstream|\\d+\\s*(?:seconds|minutes|hours|days))$" + "overrides": { + "anyOf": [ + { + "$ref": "#/$defs/Overrides" + } + ], + "default": "" } - } - }, - "non_additive_dimension": { - "type": "object", + }, "required": [ - "name" + "name", + "expect", + "model" ], + "title": "UnitTest", + "type": "object" + }, + "UnitTestConfig": { + "additionalProperties": false, "properties": { - "name": { - "type": "string" - }, - "window_choice": { - "enum": [ - "MIN", - "MAX", - "min", - "max" - ] + "meta": { + "anyOf": [ + { + "type": "object" + } + ], + "default": "", + "title": "Meta" }, - "window_groupings": { - "type": "array", - "items": { - "type": "string" - } + "tags": { + "anyOf": [ + { + "$ref": "#/$defs/StringOrArrayOfStrings" + } + ], + "default": "" } }, - "additionalProperties": false - }, - "number_or_jinja_string": { - "oneOf": [ - { - "$ref": "#/$defs/jinja_string" - }, - { - "type": "number" - } - ], - "additionalProperties": false + "title": "UnitTestConfig", + "type": "object" }, - "persist_docs_config": { - "title": "Persist docs config", - "description": "Configurations for the persistence of the dbt documentation.", - "type": "object", + "UnitTestExpectCSV": { "properties": { - "columns": { - "$ref": "#/$defs/boolean_or_jinja_string", - "default": true + "format": { + "const": "csv", + "default": "csv", + "enum": [ + "csv" + ], + "title": "Format", + "type": "string" + }, + "rows": { + "anyOf": [ + { + "type": "string" + } + ], + "default": "", + "description": "When `format` is csv or sql, a string containing comma-separated headers and values. Alternatively specify the `fixture` property. Use the pipe character | to create a multi-line string in YAML.", + "title": "Rows" }, - "relation": { - "$ref": "#/$defs/boolean_or_jinja_string", - "default": true + "fixture": { + "anyOf": [ + { + "type": "string" + } + ], + "default": "", + "description": "Specify the name of a fixture instead of providing `rows`. Does not need to be wrapped in ref.", + "title": "Fixture" } }, - "additionalProperties": false + "title": "UnitTestExpectCSV", + "type": "object" }, - "ratio_metric_type_params": { - "type": "object", + "UnitTestExpectDict": { "properties": { - "denominator": { - "$ref": "#/$defs/metric_input_schema" - }, - "filter": { + "format": { + "const": "dict", + "default": "dict", + "enum": [ + "dict" + ], + "title": "Format", "type": "string" }, - "numerator": { - "$ref": "#/$defs/metric_input_schema" + "rows": { + "description": "When `format` is `dict`, each item should be a dictionary containing a key-value pair for each column and its value, e.g. `{id: 1, code: 'ABC'}`", + "items": { + "type": "object" + }, + "title": "Rows", + "type": "array" } }, - "additionalProperties": false + "required": [ + "rows" + ], + "title": "UnitTestExpectDict", + "type": "object" }, - "simple_metric_type_params": { - "type": "object", + "UnitTestExpectSQL": { "properties": { - "measure": { - "$ref": "#/$defs/metric_input_measure" - } - }, - "additionalProperties": false - }, - "string_or_array_of_strings": { - "oneOf": [ - { + "format": { + "const": "sql", + "default": "sql", + "enum": [ + "sql" + ], + "title": "Format", "type": "string" }, - { - "$ref": "#/$defs/array_of_strings" + "rows": { + "anyOf": [ + { + "type": "string" + } + ], + "default": "", + "description": "When `format` is csv or sql, a string containing comma-separated headers and values. Alternatively specify the `fixture` property. Use the pipe character | to create a multi-line string in YAML.", + "title": "Rows" + }, + "fixture": { + "anyOf": [ + { + "type": "string" + } + ], + "default": "", + "description": "Specify the name of a fixture instead of providing `rows`. Does not need to be wrapped in ref.", + "title": "Fixture" } - ] + }, + "title": "UnitTestExpectSQL", + "type": "object" }, - "test_configs": { - "title": "Test configs", - "description": "Configurations set here will override configs set in dbt_project.yml.", - "type": "object", + "UnitTestGivenCSV": { + "additionalProperties": false, "properties": { - "alias": { - "description": "Only relevant when `store_failures` is true", - "type": "string" - }, - "database": { - "description": "Only relevant when `store_failures` is true", + "format": { + "const": "csv", + "default": "csv", + "enum": [ + "csv" + ], + "title": "Format", "type": "string" }, - "enabled": { - "$ref": "#/$defs/boolean_or_jinja_string" + "rows": { + "anyOf": [ + { + "type": "string" + } + ], + "default": "", + "description": "When `format` is csv or sql, a string containing comma-separated headers and values. Alternatively specify the `fixture` property. Use the pipe character | to create a multi-line string in YAML.", + "title": "Rows" }, - "error_if": { + "fixture": { + "anyOf": [ + { + "type": "string" + } + ], + "default": "", + "description": "Specify the name of a fixture instead of providing `rows`. Does not need to be wrapped in ref.", + "title": "Fixture" + }, + "input": { + "default": "ref('')", + "description": "The Relation whose input you want to mock", + "title": "Input", "type": "string" - }, - "fail_calc": { + } + }, + "title": "UnitTestGivenCSV", + "type": "object" + }, + "UnitTestGivenDict": { + "additionalProperties": false, + "properties": { + "format": { + "const": "dict", + "default": "dict", + "enum": [ + "dict" + ], + "title": "Format", "type": "string" }, - "limit": { - "type": "number" + "rows": { + "description": "When `format` is `dict`, each item should be a dictionary containing a key-value pair for each column and its value, e.g. `{id: 1, code: 'ABC'}`", + "items": { + "type": "object" + }, + "title": "Rows", + "type": "array" }, - "schema": { - "description": "Only relevant when `store_failures` is true", + "input": { + "default": "ref('')", + "description": "The Relation whose input you want to mock", + "title": "Input", + "type": "string" + } + }, + "required": [ + "rows" + ], + "title": "UnitTestGivenDict", + "type": "object" + }, + "UnitTestGivenSQL": { + "additionalProperties": false, + "properties": { + "format": { + "const": "sql", + "default": "sql", + "enum": [ + "sql" + ], + "title": "Format", "type": "string" }, - "severity": { - "oneOf": [ - { - "$ref": "#/$defs/jinja_string" - }, + "rows": { + "anyOf": [ { - "type": "string", - "enum": [ - "warn", - "error" - ] + "type": "string" } - ] - }, - "store_failures": { - "$ref": "#/$defs/boolean_or_jinja_string" - }, - "tags": { - "$ref": "#/$defs/string_or_array_of_strings" + ], + "default": "", + "description": "When `format` is csv or sql, a string containing comma-separated headers and values. Alternatively specify the `fixture` property. Use the pipe character | to create a multi-line string in YAML.", + "title": "Rows" }, - "warn_if": { + "fixture": { + "anyOf": [ + { + "type": "string" + } + ], + "default": "", + "description": "Specify the name of a fixture instead of providing `rows`. Does not need to be wrapped in ref.", + "title": "Fixture" + }, + "input": { + "default": "ref('')", + "description": "The Relation whose input you want to mock", + "title": "Input", "type": "string" } - } + }, + "title": "UnitTestGivenSQL", + "type": "object" }, - "validity_params": { - "type": "object", + "ValidityParams": { + "additionalProperties": false, "properties": { "is_end": { - "type": "boolean" + "anyOf": [ + { + "type": "boolean" + } + ], + "default": "", + "title": "Is End" }, "is_start": { - "type": "boolean" + "anyOf": [ + { + "type": "boolean" + } + ], + "default": "", + "title": "Is Start" + } + }, + "title": "ValidityParams", + "type": "object" + }, + "Version": { + "properties": { + "columns": { + "anyOf": [ + { + "items": { + "anyOf": [ + { + "$ref": "#/$defs/IncludeExclude" + }, + { + "$ref": "#/$defs/ColumnProperties" + } + ] + }, + "type": "array" + } + ], + "default": {}, + "title": "Columns" + }, + "config": { + "anyOf": [ + { + "$ref": "#/$defs/ModelConfigs" + } + ], + "default": {} + }, + "v": { + "default": 1, + "title": "V", + "type": "number" } }, - "additionalProperties": false + "title": "Version", + "type": "object" + }, + "WindowChoice": { + "enum": [ + "MIN", + "MAX", + "min", + "max" + ], + "title": "WindowChoice", + "type": "string" + } + }, + "additionalProperties": false, + "properties": { + "version": { + "const": 2, + "default": 2, + "enum": [ + 2 + ], + "title": "Version", + "type": "integer" + }, + "analyses": { + "anyOf": [ + { + "items": { + "$ref": "#/$defs/Analysis" + }, + "type": "array" + } + ], + "default": "", + "title": "Analyses" + }, + "exposures": { + "anyOf": [ + { + "items": { + "$ref": "#/$defs/Exposure" + }, + "type": "array" + } + ], + "default": "", + "title": "Exposures" + }, + "groups": { + "anyOf": [ + { + "items": { + "$ref": "#/$defs/Group" + }, + "type": "array" + } + ], + "default": "", + "title": "Groups" + }, + "macros": { + "anyOf": [ + { + "items": { + "$ref": "#/$defs/Macro" + }, + "type": "array" + } + ], + "default": "", + "title": "Macros" + }, + "metrics": { + "anyOf": [ + { + "items": { + "anyOf": [ + { + "$ref": "#/$defs/SimpleMetric" + }, + { + "$ref": "#/$defs/DerivedMetric" + }, + { + "$ref": "#/$defs/CumulativeMetric" + }, + { + "$ref": "#/$defs/ConversionMetric" + }, + { + "$ref": "#/$defs/RatioMetric" + } + ] + }, + "type": "array" + } + ], + "default": "", + "title": "Metrics" + }, + "models": { + "anyOf": [ + { + "items": { + "$ref": "#/$defs/Model" + }, + "type": "array" + } + ], + "default": "", + "title": "Models" + }, + "saved_queries": { + "anyOf": [ + { + "items": { + "$ref": "#/$defs/SavedQuery" + }, + "type": "array" + } + ], + "default": "", + "title": "Saved Queries" + }, + "seeds": { + "anyOf": [ + { + "items": { + "$ref": "#/$defs/Seed" + }, + "type": "array" + } + ], + "default": "", + "title": "Seeds" + }, + "semantic_models": { + "anyOf": [ + { + "items": { + "$ref": "#/$defs/SemanticModel" + }, + "type": "array" + } + ], + "default": "", + "title": "Semantic Models" + }, + "snapshots": { + "anyOf": [ + { + "items": { + "$ref": "#/$defs/Snapshot" + }, + "type": "array" + } + ], + "default": "", + "title": "Snapshots" + }, + "sources": { + "anyOf": [ + { + "items": { + "$ref": "#/$defs/Source" + }, + "type": "array" + } + ], + "default": "", + "title": "Sources" + }, + "unit_tests": { + "anyOf": [ + { + "items": { + "$ref": "#/$defs/UnitTest" + }, + "type": "array" + } + ], + "default": "", + "title": "Unit Tests" } - } + }, + "title": "DbtYmlFiles", + "type": "object", + "$schema": "http://json-schema.org/draft-07/schema#" } \ No newline at end of file diff --git a/schemas/latest/dependencies-latest.json b/schemas/latest/dependencies-latest.json index b17802a..8cf299c 100644 --- a/schemas/latest/dependencies-latest.json +++ b/schemas/latest/dependencies-latest.json @@ -1,83 +1,155 @@ { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "title": "dependencies", - "properties": { - "projects": { - "type": "array", - "items": { - "type": "object", - "required": ["name"], - "properties": { - "name": { - "type": "string" - } + "$defs": { + "GitPackages": { + "additionalProperties": false, + "properties": { + "git": { + "title": "Git URL", + "type": "string" + }, + "revision": { + "anyOf": [ + { + "type": "string" + } + ], + "default": null, + "description": "Pin your package to a specific release by specifying a release name", + "title": "Revision" + }, + "subdirectory": { + "anyOf": [ + { + "type": "string" + } + ], + "default": null, + "description": "Only required if the package is nested in a subdirectory of the git project", + "title": "Subdirectory" + } + }, + "required": [ + "git" + ], + "title": "GitPackages", + "type": "object" + }, + "HubPackages": { + "additionalProperties": false, + "properties": { + "version": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "number" + }, + { + "items": {}, + "type": "array" + } + ], + "description": "A semantic version string or range, such as [\">=1.0.0\", \"<2.0.0\"]", + "title": "Package version" }, - "additionalProperties": false - } + "install-prerelease": { + "anyOf": [ + { + "type": "boolean" + } + ], + "default": null, + "description": "Opt in to prerelease versions of a package", + "title": "Install Prerelease" + }, + "package": { + "description": "Must be in format `org_name/package_name`. Refer to hub.getdbt.com for installation instructions", + "examples": [ + "dbt-labs/dbt_utils" + ], + "pattern": "^[\\w\\-\\.]+/[\\w\\-\\.]+$", + "title": "Package identifier", + "type": "string" + } + }, + "required": [ + "version", + "package" + ], + "title": "HubPackages", + "type": "object" }, + "LocalPackage": { + "additionalProperties": false, + "properties": { + "local": { + "anyOf": [ + { + "type": "string" + } + ], + "default": null, + "title": "Local" + } + }, + "title": "LocalPackage", + "type": "object" + }, + "Project": { + "additionalProperties": false, + "properties": { + "name": { + "title": "Name", + "type": "string" + } + }, + "required": [ + "name" + ], + "title": "Project", + "type": "object" + } + }, + "additionalProperties": false, + "properties": { "packages": { - "type": "array", - "items": { - "anyOf": [ - { - "type": "object", - "required": ["package", "version"], - "properties": { - "version": { - "title": "Package version", - "type": ["string", "number", "array"], - "description": "A semantic version string or range, such as [\">=1.0.0\", \"<2.0.0\"]" + "anyOf": [ + { + "items": { + "anyOf": [ + { + "$ref": "#/$defs/HubPackages" }, - "install-prerelease": { - "title": "Install Prerelease", - "type": "boolean", - "description": "Opt in to prerelease versions of a package" + { + "$ref": "#/$defs/GitPackages" }, - "package": { - "title": "Package identifier", - "type": "string", - "description": "Must be in format `org_name/package_name`. Refer to hub.getdbt.com for installation instructions", - "examples": ["dbt-labs/dbt_utils"], - "pattern": "^[\\w\\-\\.]+/[\\w\\-\\.]+$" + { + "$ref": "#/$defs/LocalPackage" } - }, - "additionalProperties": false + ] }, - { - "type": "object", - "required": ["git"], - "properties": { - "git": { - "title": "Git URL", - "type": "string" - }, - "revision": { - "title": "Revision", - "type": "string", - "description": "Pin your package to a specific release by specifying a release name" - }, - "subdirectory": { - "title": "Subdirectory", - "type": "string", - "description": "Only required if the package is nested in a subdirectory of the git project" - } - }, - "additionalProperties": false + "minItems": 1, + "type": "array" + } + ], + "default": null, + "title": "Packages" + }, + "projects": { + "anyOf": [ + { + "items": { + "$ref": "#/$defs/Project" }, - { - "type": "object", - "properties": { - "local": { - "type": "string" - } - }, - "additionalProperties": false - } - ] - }, - "minItems": 1 + "type": "array" + } + ], + "default": null, + "title": "Projects" } }, - "additionalProperties": false -} + "title": "Dependencies", + "type": "object", + "$schema": "http://json-schema.org/draft-07/schema#" +} \ No newline at end of file diff --git a/schemas/latest/packages-latest.json b/schemas/latest/packages-latest.json index 86cc8a9..1a7d610 100644 --- a/schemas/latest/packages-latest.json +++ b/schemas/latest/packages-latest.json @@ -1,84 +1,129 @@ { - "title": "packages", - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "required": [ - "packages" - ], - "properties": { - "packages": { - "type": "array", - "items": { - "anyOf": [ - { - "type": "object", - "required": [ - "package", - "version" - ], - "properties": { - "version": { - "title": "Package version", - "type": [ - "string", - "number", - "array" - ], - "description": "A semantic version string or range, such as [\">=1.0.0\", \"<2.0.0\"]" - }, - "install-prerelease": { - "title": "Install Prerelease", - "type": "boolean", - "description": "Opt in to prerelease versions of a package" - }, - "package": { - "title": "Package identifier", - "type": "string", - "description": "Must be in format `org_name/package_name`. Refer to hub.getdbt.com for installation instructions", - "examples": [ - "dbt-labs/dbt_utils" - ], - "pattern": "^[\\w\\-\\.]+/[\\w\\-\\.]+$" - } - }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "git" - ], - "properties": { - "git": { - "title": "Git URL", - "type": "string" - }, - "revision": { - "title": "Revision", - "type": "string", - "description": "Pin your package to a specific release by specifying a release name" - }, - "subdirectory": { - "title": "Subdirectory", - "type": "string", - "description": "Only required if the package is nested in a subdirectory of the git project" - } - }, - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "local": { - "type": "string" - } - }, - "additionalProperties": false - } - ] + "$defs": { + "GitPackages": { + "additionalProperties": false, + "properties": { + "git": { + "title": "Git URL", + "type": "string" + }, + "revision": { + "anyOf": [ + { + "type": "string" + } + ], + "default": null, + "description": "Pin your package to a specific release by specifying a release name", + "title": "Revision" + }, + "subdirectory": { + "anyOf": [ + { + "type": "string" + } + ], + "default": null, + "description": "Only required if the package is nested in a subdirectory of the git project", + "title": "Subdirectory" + } + }, + "required": [ + "git" + ], + "title": "GitPackages", + "type": "object" + }, + "HubPackages": { + "additionalProperties": false, + "properties": { + "version": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "number" }, - "minItems": 1 + { + "items": {}, + "type": "array" + } + ], + "description": "A semantic version string or range, such as [\">=1.0.0\", \"<2.0.0\"]", + "title": "Package version" + }, + "install-prerelease": { + "anyOf": [ + { + "type": "boolean" + } + ], + "default": null, + "description": "Opt in to prerelease versions of a package", + "title": "Install Prerelease" + }, + "package": { + "description": "Must be in format `org_name/package_name`. Refer to hub.getdbt.com for installation instructions", + "examples": [ + "dbt-labs/dbt_utils" + ], + "pattern": "^[\\w\\-\\.]+/[\\w\\-\\.]+$", + "title": "Package identifier", + "type": "string" } + }, + "required": [ + "version", + "package" + ], + "title": "HubPackages", + "type": "object" }, - "additionalProperties": false -} + "LocalPackage": { + "additionalProperties": false, + "properties": { + "local": { + "anyOf": [ + { + "type": "string" + } + ], + "default": null, + "title": "Local" + } + }, + "title": "LocalPackage", + "type": "object" + } + }, + "additionalProperties": false, + "properties": { + "packages": { + "anyOf": [ + { + "items": { + "anyOf": [ + { + "$ref": "#/$defs/HubPackages" + }, + { + "$ref": "#/$defs/GitPackages" + }, + { + "$ref": "#/$defs/LocalPackage" + } + ] + }, + "minItems": 1, + "type": "array" + } + ], + "default": null, + "title": "Packages" + } + }, + "title": "Packages", + "type": "object", + "$schema": "http://json-schema.org/draft-07/schema#" +} \ No newline at end of file diff --git a/schemas/latest/selectors-latest.json b/schemas/latest/selectors-latest.json index 7c818d7..e739e41 100644 --- a/schemas/latest/selectors-latest.json +++ b/schemas/latest/selectors-latest.json @@ -1,153 +1,237 @@ { - "title": "selectors", - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "required": [ - "selectors" - ], - "properties": { - "selectors": { - "type": "array", - "items": { - "type": "object", - "properties": { - "name": { - "type": "string" - }, - "description": { - "type": "string" - }, - "default": { - "oneOf": [ - { - "type": "string", - "pattern": "\\{\\{.*\\}\\}" - }, - { - "type": "boolean" - } - ], - "additionalProperties": false - }, - "definition": { - "oneOf": [ - { - "$ref": "#/$defs/definition_block" - }, - { - "type": "string" - }, - { - "$ref": "#/$defs/union_block" - } - ] - } - }, - "additionalProperties": false - }, - "minItems": 1 + "$defs": { + "BooleanOrJinjaString": { + "anyOf": [ + { + "$ref": "#/$defs/JinjaString" + }, + { + "type": "boolean" } + ], + "title": "BooleanOrJinjaString" + }, + "Default": { + "pattern": "\\{\\{.*\\}\\}", + "title": "Default", + "type": "string" }, - "additionalProperties": false, - "$defs": { - "boolean_or_jinja_string": { - "oneOf": [ + "DefinitionBlock": { + "additionalProperties": true, + "properties": { + "method": { + "anyOf": [ + { + "$ref": "#/$defs/Method" + } + ], + "default": null + }, + "value": { + "anyOf": [ + { + "type": "string" + } + ], + "default": null, + "title": "Value" + }, + "children": { + "anyOf": [ + { + "$ref": "#/$defs/BooleanOrJinjaString" + } + ], + "default": null + }, + "parents": { + "anyOf": [ + { + "$ref": "#/$defs/BooleanOrJinjaString" + } + ], + "default": null + }, + "children_depth": { + "anyOf": [ + { + "type": "number" + } + ], + "default": null, + "title": "Children Depth" + }, + "parents_depth": { + "anyOf": [ + { + "type": "number" + } + ], + "default": null, + "title": "Parents Depth" + }, + "childrens_parents": { + "anyOf": [ + { + "$ref": "#/$defs/BooleanOrJinjaString" + } + ], + "default": null + }, + "indirect_selection": { + "anyOf": [ + { + "$ref": "#/$defs/IndirectSelection" + } + ], + "default": null + } + }, + "title": "DefinitionBlock", + "type": "object" + }, + "ExcludeBlock": { + "items": { + "anyOf": [ { - "$ref": "#/$defs/jinja_string" + "$ref": "#/$defs/IntersectionBlock" }, { - "type": "boolean" + "$ref": "#/$defs/DefinitionBlock" } - ], - "additionalProperties": false + ] }, - "definition_block": { - "type": "object", - "properties": { - "method": { - "type": "string", - "enum": [ - "tag", - "source", - "path", - "file", - "fqn", - "package", - "config", - "test_type", - "test_name", - "state", - "exposure", - "metric", - "result", - "source_status", - "group", - "wildcard" - ] - }, - "value": { - "type": "string" - }, - "children": { - "$ref": "#/$defs/boolean_or_jinja_string" - }, - "parents": { - "$ref": "#/$defs/boolean_or_jinja_string" - }, - "children_depth": { - "type": "number" - }, - "parents_depth": { - "type": "number" - }, - "childrens_parents": { - "$ref": "#/$defs/boolean_or_jinja_string" - }, - "indirect_selection": { - "type": "string", - "enum": ["buildable", "cautious", "eager"] - } - }, - "additionalProperties": true - }, - "exclude_block": { - "type": "array", - "items": { - "anyOf": [ - { - "$ref": "#/$defs/intersection_block" - }, - { - "$ref": "#/$defs/definition_block" - } - ] - } - }, - "intersection_block": { - "type": "array", - "items": { - "$ref": "#/$defs/definition_block" - } - }, - "jinja_string": { - "type": "string", - "pattern": "\\{\\{.*\\}\\}" + "title": "ExcludeBlock", + "type": "array" + }, + "IndirectSelection": { + "enum": [ + "buildable", + "cautious", + "eager" + ], + "title": "IndirectSelection", + "type": "string" + }, + "IntersectionBlock": { + "items": { + "$ref": "#/$defs/DefinitionBlock" }, - "union_block": { - "type": "array", - "items": { + "title": "IntersectionBlock", + "type": "array" + }, + "JinjaString": { + "pattern": "\\{\\{.*\\}\\}", + "title": "JinjaString", + "type": "string" + }, + "Method": { + "enum": [ + "tag", + "source", + "path", + "file", + "fqn", + "package", + "config", + "test_type", + "test_name", + "state", + "exposure", + "metric", + "result", + "source_status", + "group", + "wildcard" + ], + "title": "Method", + "type": "string" + }, + "Selector": { + "additionalProperties": false, + "properties": { + "name": { + "anyOf": [ + { + "type": "string" + } + ], + "default": null, + "title": "Name" + }, + "description": { + "anyOf": [ + { + "type": "string" + } + ], + "default": null, + "title": "Description" + }, + "default": { + "anyOf": [ + { + "$ref": "#/$defs/Default" + }, + { + "type": "boolean" + } + ], + "default": null, + "title": "Default" + }, + "definition": { "anyOf": [ { - "$ref": "#/$defs/intersection_block" + "$ref": "#/$defs/DefinitionBlock" }, { - "$ref": "#/$defs/definition_block" + "type": "string" }, { - "$ref": "#/$defs/exclude_block" + "$ref": "#/$defs/UnionBlock" } - ] + ], + "default": null, + "title": "Definition" } - } + }, + "title": "Selector", + "type": "object" + }, + "UnionBlock": { + "items": { + "anyOf": [ + { + "$ref": "#/$defs/IntersectionBlock" + }, + { + "$ref": "#/$defs/DefinitionBlock" + }, + { + "$ref": "#/$defs/ExcludeBlock" + } + ] + }, + "title": "UnionBlock", + "type": "array" + } + }, + "additionalProperties": false, + "properties": { + "selectors": { + "items": { + "$ref": "#/$defs/Selector" + }, + "minItems": 1, + "title": "Selectors", + "type": "array" } -} + }, + "required": [ + "selectors" + ], + "title": "Selectors", + "type": "object", + "$schema": "http://json-schema.org/draft-07/schema#" +} \ No newline at end of file diff --git a/src/generate.py b/src/generate.py new file mode 100644 index 0000000..b34cccd --- /dev/null +++ b/src/generate.py @@ -0,0 +1,29 @@ +import json +import os + +from latest.dbt_cloud import DbtCloud +from latest.dbt_project import DbtProject +from latest.dbt_yml_files import DbtYmlFiles +from latest.dependencies import Dependencies, Packages +from latest.selectors import Selectors + +if __name__ == "__main__": + files = { + "dbt_yml_files": DbtYmlFiles, + "dependencies": Dependencies, + "packages": Packages, + "selectors": Selectors, + "dbt_project": DbtProject, + "dbt_cloud": DbtCloud, + + } + output_directory = os.path.join( + os.path.dirname(__file__), "../", f"schemas/latest-generated" + ) + for file_name, model in files.items(): + file_path = os.path.join( + output_directory, f"{file_name}-latest-generated.json" + ) + schema = model.model_json_schema(mode="validation") + with open(file_path, "w") as file: + json.dump(schema, file, indent=2) diff --git a/src/latest/dbt_cloud.py b/src/latest/dbt_cloud.py new file mode 100644 index 0000000..fc4c3df --- /dev/null +++ b/src/latest/dbt_cloud.py @@ -0,0 +1,17 @@ +# generated by datamodel-codegen: +# filename: dbt_cloud-latest.json +# timestamp: 2024-08-05T22:16:27+00:00 + +from __future__ import annotations + +from typing import Optional + +from pydantic import BaseModel, ConfigDict, Field + + +class DbtCloud(BaseModel): + model_config = ConfigDict( + extra='forbid', + ) + project_id: str = Field(..., alias='project-id') + defer_env_id: Optional[str] = Field(None, alias='defer-env-id') diff --git a/src/latest/dbt_yml_files.py b/src/latest/dbt_yml_files.py new file mode 100644 index 0000000..432e8d0 --- /dev/null +++ b/src/latest/dbt_yml_files.py @@ -0,0 +1,1009 @@ +# generated by datamodel-codegen: +# filename: dbt_yml_files-latest.json +# timestamp: 2024-07-25T00:00:09+00:00 + +from __future__ import annotations + +from enum import Enum +from typing import Any, Dict, List, Literal, Optional, Union + +from pydantic import BaseModel, ConfigDict, Field, RootModel + + +class Column(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + name: str + description: Optional[str] = "" + data_type: Optional[str] = "" + + +class Type(Enum): + dashboard = "dashboard" + notebook = "notebook" + analysis = "analysis" + ml = "ml" + application = "application" + + +class Maturity(Enum): + high = "high" + medium = "medium" + low = "low" + + +class Argument(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + name: str + description: Optional[str] = "" + type: Optional[str] = "" + + +class Access(Enum): + private = "private" + protected = "protected" + public = "public" + + +class Defaults(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + agg_time_dimension: Optional[str] = "" + + +class Format(Enum): + csv = "csv" + dict = "dict" + sql = "sql" + + +class UnitTestExpectDict(BaseModel): + format: Literal["dict"] = Field("dict") + rows: List[Dict[str, Any]] = Field( + ..., + description="When `format` is `dict`, each item should be a dictionary containing a key-value pair for each column and its value, e.g. `{id: 1, code: 'ABC'}`", + ) + +class UnitTestGivenDict(UnitTestExpectDict): + model_config = ConfigDict( + extra="forbid", + ) + input: str = Field("ref('')", description="The Relation whose input you want to mock") + +class UnitTestExpectCSV(BaseModel): + format: Literal["csv"] = Field("csv") + rows: Optional[str] = Field( + "", + description="When `format` is csv or sql, a string containing comma-separated headers and values. Alternatively specify the `fixture` property. Use the pipe character | to create a multi-line string in YAML.", + ) + fixture: Optional[str] = Field( + "", + description="Specify the name of a fixture instead of providing `rows`. Does not need to be wrapped in ref.", + ) + +class UnitTestGivenCSV(UnitTestExpectCSV): + model_config = ConfigDict( + extra="forbid", + ) + input: str = Field("ref('')", description="The Relation whose input you want to mock") + + +class UnitTestExpectSQL(BaseModel): + format: Literal["sql"] = Field("sql") + rows: Optional[str] = Field( + "", + description="When `format` is csv or sql, a string containing comma-separated headers and values. Alternatively specify the `fixture` property. Use the pipe character | to create a multi-line string in YAML.", + ) + fixture: Optional[str] = Field( + "", + description="Specify the name of a fixture instead of providing `rows`. Does not need to be wrapped in ref.", + ) + +class UnitTestGivenSQL(UnitTestExpectSQL): + model_config = ConfigDict( + extra="forbid", + ) + input: str = Field("ref('')", description="The Relation whose input you want to mock") + + +Expect = Union[UnitTestExpectDict, UnitTestExpectCSV, UnitTestExpectSQL] +Given = Union[UnitTestGivenDict, UnitTestGivenCSV, UnitTestGivenSQL] + + +class Overrides(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + env_vars: Optional[Dict[str, Any]] = {"ENV_VAR_NAME": "value"} + macros: Optional[Dict[str, Any]] = Field( + None, examples=[{"is_incremental": "true"}] + ) + vars: Optional[Dict[str, Any]] = {"var_name": "value"} + + +class AggregationTypeParams(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + percentile: Optional[float] = "" + use_approximate_percentile: Optional[bool] = "" + use_discrete_percentile: Optional[bool] = "" + + +class ArrayOfStrings(RootModel[List[str]]): + root: List[str] + + +class Calculation(Enum): + conversions = "conversions" + conversion_rate = "conversion_rate" + CONVERSIONS = "CONVERSIONS" + CONVERSION_RATE = "CONVERSION_RATE" + + +class ConstantProperty(BaseModel): + base_property: str = Field(..., description="DIMENSION or ENTITY") + conversion_property: str = Field(..., description="DIMENSION or ENTITY") + +class TimeGranularity(Enum): + NANOSECOND = "NANOSECOND" + MICROSECOND = "MICROSECOND" + MILLISECOND = "MILLISECOND" + SECOND = "SECOND" + MINUTE = "MINUTE" + HOUR = "HOUR" + DAY = "DAY" + WEEK = "WEEK" + MONTH = "MONTH" + QUARTER = "QUARTER" + YEAR = "YEAR" + nanosecond = "nanosecond" + microsecond = "microsecond" + millisecond = "millisecond" + second = "second" + minute = "minute" + hour = "hour" + day = "day" + week = "week" + month = "month" + quarter = "quarter" + year = "year" + +class DocsConfig(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + node_color: Optional[str] = Field( + None, + description="The color of the node on the DAG in the documentation. It must be an Hex code or a valid CSS color name.", + pattern="^(#[a-fA-F0-9]{3}|#[a-fA-F0-9]{6}|[^#][a-zA-Z]*)$", + ) + show: Optional[bool] = True + + +class EntityType(Enum): + PRIMARY = "PRIMARY" + UNIQUE = "UNIQUE" + FOREIGN = "FOREIGN" + NATURAL = "NATURAL" + primary = "primary" + unique = "unique" + foreign = "foreign" + natural = "natural" + + +class Entity(BaseModel): + model_config = ConfigDict( + extra="forbid", + regex_engine="python-re", + ) + name: str = Field(..., pattern="(?!.*__).*^[a-z][a-z0-9_]*[a-z0-9]$") + type: EntityType = Field(..., title="Entity Type") + entity: Optional[str] = "" + expr: Optional[str] = Field("", description="The field that denotes the entity. Defaults to name if unspecified") + + +class ExportAs(Enum): + table = "table" + view = "view" + cache = "cache" + + +class ExportConfig(BaseModel): + model_config = ConfigDict( + extra="allow", + ) + alias: Optional[str] = "" + export_as: Optional[ExportAs] = "" + schema_: Optional[str] = Field("", alias="schema") + + +class Export(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + name: str + config: Optional[ExportConfig] = Field(title="Export Config") + + +class FreshnessPeriod(Enum): + minute = "minute" + hour = "hour" + day = "day" + + +class GroupName(RootModel[str]): + root: str + + +class JinjaString(RootModel[str]): + root: str = Field(..., pattern="\\{\\{.+\\}\\}") + + +class Agg(Enum): + SUM = "SUM" + MIN = "MIN" + MAX = "MAX" + AVG = "AVG" + COUNT_DISTINCT = "COUNT_DISTINCT" + SUM_BOOLEAN = "SUM_BOOLEAN" + COUNT = "COUNT" + PERCENTILE = "PERCENTILE" + MEDIAN = "MEDIAN" + sum = "sum" + min = "min" + max = "max" + avg = "avg" + count_distinct = "count_distinct" + sum_boolean = "sum_boolean" + count = "count" + percentile = "percentile" + median = "median" + + +class MetricInputMeasure(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + name: Optional[str] = "" + fill_nulls_with: Optional[Union[str, int]] = 0 + filter: Optional[str] = "" + join_to_timespine: Optional[bool] = Field(True, description="Indicates if the aggregated measure should be joined to the time spine table to fill in missing dates") + + +class MetricInputSchema(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + name: Optional[str] = "" + alias: Optional[str] = "" + filter: Optional[str] = "" + offset_window: Optional[str] = "" + + +class AuthorizedView(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + database: str + project: str + + +class OnConfigurationChange(Enum): + apply = "apply" + continue_ = "continue" + fail = "fail" + + +class OnSchemaChange(Enum): + append_new_columns = "append_new_columns" + fail = "fail" + ignore = "ignore" + sync_all_columns = "sync_all_columns" + + +class OwnerWithEmail(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + email: str + + +class OwnerWithName(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + name: str + + +Owner = Union[OwnerWithEmail, OwnerWithName] + + +class WindowChoice(Enum): + MIN = "MIN" + MAX = "MAX" + min = "min" + max = "max" + + +class NonAdditiveDimension(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + name: str = Field("", description="The name of the time dimension (that has already been defined in the data source) that the measure should not be aggregated over.") + window_choice: WindowChoice = Field(WindowChoice.min, description="`min` and `max` reflect the beginning and end of the time period respectively.") + window_groupings: Optional[List[str]] = Field([], description="Provide the entities that you would like to group by.") + + +class NumberOrJinjaString(RootModel[Union[JinjaString, float]]): + root: Union[JinjaString, float] + + +class RatioMetricTypeParams(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + denominator: Optional[MetricInputSchema] = "" + filter: Optional[str] = "" + numerator: Optional[MetricInputSchema] = "" + + +class SimpleMetricTypeParams(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + measure: Optional[MetricInputMeasure] = "" + + +class StringOrArrayOfStrings(RootModel[Union[str, ArrayOfStrings]]): + root: Union[str, ArrayOfStrings] + + +class Severity(Enum): + warn = "warn" + error = "error" + + +class ValidityParams(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + is_end: Optional[bool] = "" + is_start: Optional[bool] = "" + + +class Config(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + tags: Optional[StringOrArrayOfStrings] = "" + + +class Analysis(BaseModel): + name: str + description: Optional[str] = "" + columns: Optional[List[Column]] = "" + config: Optional[Config] = "" + docs: Optional[DocsConfig] = "" + group: Optional[GroupName] = "" + + +class Exposure(BaseModel): + name: str + description: Optional[str] = "" + type: Type + depends_on: List[str] + label: Optional[str] = "" + maturity: Optional[Maturity] = Maturity.medium + meta: Optional[Dict[str, Any]] = "" + owner: Owner + tags: Optional[StringOrArrayOfStrings] = "" + url: Optional[str] = "" + + +class Group(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + name: str + owner: Owner + + +class Macro(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + name: str + description: Optional[str] = "" + arguments: Optional[List[Argument]] = "" + docs: Optional[DocsConfig] = "" + + +class SimpleMetricType(Enum): + SIMPLE = "SIMPLE" + simple = "simple" + + +class DerivedMetricType(Enum): + DERIVED = "DERIVED" + derived = "derived" + + +class CumulativeMetricType(Enum): + CUMULATIVE = "CUMULATIVE" + cumulative = "cumulative" + + +class ConversionMetricType(Enum): + CONVERSION = "CONVERSION" + conversion = "conversion" + + +class RatioMetricType(Enum): + RATIO = "RATIO" + ratio = "ratio" + + +class MetricBase(BaseModel): + model_config = ConfigDict( + extra="forbid", + regex_engine="python-re", + ) + name: str = Field(..., pattern="(?!.*__).*^[a-z][a-z0-9_]*[a-z0-9]$") + description: Optional[str] = "" + filter: Optional[str] = "" + group: Optional[GroupName] = "" + label: str + time_granularity: Optional[TimeGranularity] = "" + + +class SimpleMetric(MetricBase): + type: SimpleMetricType + type_params: SimpleMetricTypeParams + + +class DerivedMetric(MetricBase): + type: DerivedMetricType + type_params: DerivedMetricTypeParams + + +class CumulativeMetric(MetricBase): + type: CumulativeMetricType + type_params: CumulativeMetricTypeParams + + +class ConversionMetric(MetricBase): + type: ConversionMetricType + type_params: ConversionMetricTypeParams + + +class RatioMetric(MetricBase): + type: RatioMetricType + type_params: RatioMetricTypeParams + + +Metric = Union[ + SimpleMetric, DerivedMetric, CumulativeMetric, ConversionMetric, RatioMetric +] + + +class QueryParams(BaseModel): + dimensions: Optional[ArrayOfStrings] = "" + metrics: Optional[ArrayOfStrings] = "" + where: Optional[ArrayOfStrings] = "" + + +class SavedQuery(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + name: str + description: str + exports: Optional[List[Export]] = "" + label: str + query_params: QueryParams + + +class UnitTestConfig(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + meta: Optional[Dict[str, Any]] = "" + tags: Optional[StringOrArrayOfStrings] = "" + + +class UnitTest(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + name: str + description: Optional[str] = "" + config: Optional[UnitTestConfig] = Field(None, title="Unit Test Config") + expect: Expect + given: Optional[List[Given]] = [UnitTestGivenDict(input="", rows=[{"col1": "value1", "col2": "value2"}])] + model: str = Field( + ..., + description="The name of the model whose behaviour you are testing. Does not need to be wrapped in a ref.", + examples=["my_model"], + ) + overrides: Optional[Overrides] = "" + + +class BooleanOrJinjaString(RootModel[Union[JinjaString, bool]]): + root: Union[JinjaString, bool] + + +class Constraint(BaseModel): + name: Optional[str] = "" + type: str + columns: Optional[StringOrArrayOfStrings] = "" + expression: Optional[str] = "" + warn_unenforced: Optional[BooleanOrJinjaString] = "" + warn_unsupported: Optional[BooleanOrJinjaString] = "" + + +class Constraints(RootModel[List[Constraint]]): + root: List[Constraint] + + +class ConversionTypeParams(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + base_measure: MetricInputMeasure + calculation: Optional[Calculation] = Calculation.conversion_rate + constant_properties: Optional[List[ConstantProperty]] = "" + conversion_measure: MetricInputMeasure + entity: str = Field(..., description="The entity to calculate over") + window: Optional[str] = "" + + +class ConversionMetricTypeParams(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + conversion_type_params: Optional[ConversionTypeParams] = "" + + +class CumulativeMetricTypeParams(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + grain_to_date: Optional[TimeGranularity] = TimeGranularity.month + measure: Optional[MetricInputMeasure] = "" + window: Optional[str] = "" + + +class DerivedMetricTypeParams(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + expr: Optional[str] = "" + metrics: Optional[List[MetricInputSchema]] = "" + + +class DimensionTypeParams(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + time_granularity: TimeGranularity + validity_params: Optional[ValidityParams] = "" + + +class FreshnessRules(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + count: NumberOrJinjaString + period: FreshnessPeriod + + +class Grants(RootModel[Dict[str, StringOrArrayOfStrings]]): + root: Dict[str, StringOrArrayOfStrings] = Field( + ..., + description="grant config. each key is a database permission and the value is the grantee of that permission", + ) + + +class IncludeExclude(BaseModel): + exclude: Optional[StringOrArrayOfStrings] = "" + include: Optional[StringOrArrayOfStrings] = "" + + +class Measure(BaseModel): + model_config = ConfigDict( + extra="forbid", + regex_engine="python-re", + ) + name: str = Field(..., pattern="(?!.*__).*^[a-z][a-z0-9_]*[a-z0-9]$") + description: Optional[str] = "" + agg: Agg + agg_params: Optional[AggregationTypeParams] = "" + agg_time_dimension: Optional[str] = Field( + None, pattern="(?!.*__).*^[a-z][a-z0-9_]*[a-z0-9]$" + ) + create_metric: Optional[bool] = True + create_metric_display_name: Optional[str] = "" + expr: Optional[Union[str, int, bool]] = "" + label: Optional[str] = "" + non_additive_dimension: Optional[NonAdditiveDimension] = Field(NonAdditiveDimension(), description="Specify dimensions that the measure should not be aggregated over.") + + +class Contract(BaseModel): + enforced: Optional[BooleanOrJinjaString] = True + + +class ModelConfigs(BaseModel): + auto_refresh: Optional[BooleanOrJinjaString] = True + backup: Optional[BooleanOrJinjaString] = True + contract: Optional[Contract] = Field(Contract(enforced=True)) + file_format: Optional[str] = "" + grant_access_to: Optional[List[AuthorizedView]] = Field( + None, + description="Configuration, specific to BigQuery adapter, used to setup authorized views.", + title="Authorized views", + ) + grants: Optional[Grants] = {"select": ["reporter_role", "bi_user"]} + hours_to_expiration: Optional[float] = Field( + 1, + description="Configuration specific to BigQuery adapter used to set an expiration delay (in hours) to a table.", + ) + kms_key_name: Optional[str] = Field( + "", + description="Configuration of the KMS key name, specific to BigQuery adapter.", + pattern="projects/[a-zA-Z0-9_-]*/locations/[a-zA-Z0-9_-]*/keyRings/.*/cryptoKeys/.*", + ) + labels: Optional[Dict[str, str]] = Field( + {"key": "value"}, + description="Configuration specific to BigQuery adapter used to add labels and tags to tables/views created by dbt.", + title="Label configs", + ) + location: Optional[str] = "" + materialized: Optional[str] = "" + on_configuration_change: Optional[OnConfigurationChange] = "" + on_schema_change: Optional[OnSchemaChange] = "" + snowflake_warehouse: Optional[str] = "" + sql_header: Optional[str] = "" + target_lag: Optional[str] = Field( + None, pattern="^(?:downstream|\\d+\\s*(?:seconds|minutes|hours|days))$" + ) + + +class PersistDocsConfig(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + columns: Optional[BooleanOrJinjaString] = Field( + default_factory=lambda: BooleanOrJinjaString.model_validate(True) + ) + relation: Optional[BooleanOrJinjaString] = Field( + default_factory=lambda: BooleanOrJinjaString.model_validate(True) + ) + + +class TestConfigs(BaseModel): + alias: Optional[str] = Field( + None, description="Only relevant when `store_failures` is true" + ) + database: Optional[str] = Field( + None, description="Only relevant when `store_failures` is true" + ) + enabled: Optional[BooleanOrJinjaString] = False + error_if: Optional[str] = "" + fail_calc: Optional[str] = "" + limit: Optional[float] = 20 + schema_: Optional[str] = Field( + None, alias="schema", description="Only relevant when `store_failures` is true" + ) + severity: Optional[Union[JinjaString, Severity]] = Severity.warn + store_failures: Optional[BooleanOrJinjaString] = True + tags: Optional[StringOrArrayOfStrings] = "" + warn_if: Optional[str] = "" + + +class SnapshotConfig(BaseModel): + alias: Optional[str] = "" + check_cols: Optional[StringOrArrayOfStrings] = "" + enabled: Optional[BooleanOrJinjaString] = False + grants: Optional[Grants] = {"select": ["reporter_role", "bi_user"]} + persist_docs: Optional[PersistDocsConfig] = "" + post_hook: Optional[ArrayOfStrings] = Field("", alias="post-hook") + pre_hook: Optional[ArrayOfStrings] = Field("", alias="pre-hook") + quote_columns: Optional[BooleanOrJinjaString] = "" + strategy: Optional[str] = "" + tags: Optional[StringOrArrayOfStrings] = "" + target_database: Optional[str] = "" + target_schema: Optional[str] = "" + unique_key: Optional[StringOrArrayOfStrings] = "" + updated_at: Optional[str] = "" + + +class Quoting(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + database: Optional[BooleanOrJinjaString] = "" + identifier: Optional[BooleanOrJinjaString] = "" + schema_: Optional[BooleanOrJinjaString] = Field("", alias="schema") + + +class Relationships(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + name: Optional[str] = "" + config: Optional[TestConfigs] = "" + field: str = Field( + ..., description="The foreign key column", title="Relationships: Field" + ) + to: str = Field( + ..., examples=["ref('parent_model')", "source('parent_schema', 'parent_table')"] + ) + where: Optional[str] = "" + + +class RelationshipsTest(BaseModel): + relationships: Optional[Relationships] = "" + + +class AcceptedValues(BaseModel): + name: Optional[str] = "" + config: Optional[TestConfigs] = "" + quote: Optional[bool] = "" + values: List[str] + where: Optional[str] = "" + + +class AcceptedValuesTest(BaseModel): + accepted_values: Optional[AcceptedValues] = AcceptedValues(values=[]) + + +class NotNull(BaseModel): + name: Optional[str] = "" + config: Optional[TestConfigs] = "" + where: Optional[str] = "" + + +class NotNullTest(BaseModel): + not_null: Optional[NotNull] = "" + + +class Unique(BaseModel): + name: Optional[str] = "" + config: Optional[TestConfigs] = "" + where: Optional[str] = "" + + +class UniqueTest(BaseModel): + unique: Optional[Unique] = "" + + +class DataTests( + RootModel[ + Union[str, RelationshipsTest, AcceptedValuesTest, NotNullTest, UniqueTest] + ] +): + root: Union[str, RelationshipsTest, AcceptedValuesTest, NotNullTest, UniqueTest] + + +class DimensionBase(BaseModel): + model_config = ConfigDict( + extra="forbid", + regex_engine="python-re", + ) + name: str = Field(..., pattern="(?!.*__).*^[a-z][a-z0-9_]*[a-z0-9]$") + description: Optional[str] = "" + expr: Optional[Union[str, bool]] = "" + is_partition: Optional[bool] = True + + +class TimeDimensionType(Enum): + TIME = "TIME" + time = "time" + + +class CategoricalDimensionType(Enum): + CATEGORICAL = "CATEGORICAL" + categorical = "categorical" + + +class CategoricalDimension(DimensionBase): + type: CategoricalDimensionType + + +class TimeDimension(DimensionBase): + type: TimeDimensionType + type_params: DimensionTypeParams + + +class Dimension(RootModel[Union[CategoricalDimension, TimeDimension]]): + root: Union[CategoricalDimension, TimeDimension] + + +class FreshnessDefinition(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + warn_after: Optional[FreshnessRules] = FreshnessRules(count=1, period=FreshnessPeriod.hour) + error_after: Optional[FreshnessRules] = FreshnessRules(count=1, period=FreshnessPeriod.day) + filter: Optional[str] = "" + +class SeedConfig(BaseModel): + column_types: Optional[Dict[str, Any]] = "" + copy_grants: Optional[BooleanOrJinjaString] = True + data_tests: Optional[List[DataTests]] = "" + database: Optional[str] = "" + enabled: Optional[BooleanOrJinjaString] = False + grants: Optional[Grants] = {"select": ["reporter_role", "bi_user"]} + quote_columns: Optional[BooleanOrJinjaString] = "" + schema_: Optional[str] = Field(None, alias="schema") + + +class SemanticModel(BaseModel): + model_config = ConfigDict( + extra="forbid", + regex_engine="python-re", + ) + name: str = Field(..., pattern="(?!.*__).*^[a-z][a-z0-9_]*[a-z0-9]$") + description: Optional[str] = "" + defaults: Optional[Defaults] = "" + dimensions: Optional[List[Dimension]] = "" + entities: Optional[List[Entity]] = "" + measures: Optional[List[Measure]] = "" + model: str + primary_entity: Optional[str] = "" + + +class ColumnProperties(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + name: str + description: Optional[str] = "" + constraints: Optional[Constraints] = "" + data_tests: Optional[List[DataTests]] = "" + data_type: Optional[str] = "" + meta: Optional[Dict[str, Any]] = "" + policy_tags: Optional[List[str]] = Field( + None, + description="Configurations, specific to BigQuery adapter, used to set policy tags on specific columns, enabling column-level security. Only relevant when `persist_docs.columns` is true.", + title="Policy tags", + ) + quote: Optional[BooleanOrJinjaString] = "" + tags: Optional[StringOrArrayOfStrings] = "" + tests: Optional[List[DataTests]] = "" + + +class Version(BaseModel): + columns: Optional[List[Union[IncludeExclude, ColumnProperties]]] = {} + config: Optional[ModelConfigs] = {} + v: float = 1 + + +class Model(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + name: str + description: Optional[str] = "" + access: Optional[Access] = Access.private + columns: Optional[List[ColumnProperties]] = "" + config: Optional[ModelConfigs] = "" + constraints: Optional[Constraints] = "" + data_tests: Optional[List[DataTests]] = "" + deprecation_date: Optional[str] = "" + docs: Optional[DocsConfig] = "" + group: Optional[GroupName] = "" + latest_version: Optional[float] = "" + meta: Optional[Dict[str, Any]] = "" + tests: Optional[List[DataTests]] = "" + versions: Optional[List[Version]] = "" + + +class Seed(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + name: str + description: Optional[str] = "" + columns: Optional[List[ColumnProperties]] = "" + config: Optional[SeedConfig] = Field("", title="Seed Config") + docs: Optional[DocsConfig] = "" + group: Optional[GroupName] = "" + tests: Optional[List[DataTests]] = "" + + +class Snapshot(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + name: str + description: Optional[str] = "" + columns: Optional[List[ColumnProperties]] = "" + config: Optional[SnapshotConfig] = Field("", title="Snapshot Config") + data_tests: Optional[List[DataTests]] = "" + docs: Optional[DocsConfig] = "" + group: Optional[GroupName] = "" + meta: Optional[Dict[str, Any]] = "" + tests: Optional[List[DataTests]] = "" + + +class Table(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + name: str = Field( + ..., + description="How you will identify the table in {{ source() }} calls. Unless `identifier` is also set, this will be the name of the table in the database.", + title="Name", + ) + description: Optional[str] = "" + columns: Optional[List[ColumnProperties]] = "" + external: Optional[Dict[str, Any]] = "" + freshness: Optional[FreshnessDefinition] = Field(FreshnessDefinition(), json_schema_extra={"$comment": "truly_nullable"}) + identifier: Optional[str] = Field( + None, + description="The table name as stored in the database. Only needed if you want to give the source a different name than what exists in the database (otherwise `name` is used by default)", + title="Identifier", + ) + loaded_at_field: Optional[str] = Field( + None, + description="Which column to check during data freshness tests. Only needed if the table has a different loaded_at_field to the one defined on the source overall.", + ) + loader: Optional[str] = "" + meta: Optional[Dict[str, Any]] = "" + quoting: Optional[Quoting] = "" + tags: Optional[StringOrArrayOfStrings] = "" + tests: Optional[List[DataTests]] = "" + + +class Source(BaseModel): + name: str = Field( + ..., + description="How you will identify the schema in {{ source() }} calls. Unless `schema` is also set, this will be the name of the schema in the database.", + ) + description: Optional[str] = "" + config: Optional[Dict[str, Any]] = "" + data_tests: Optional[List[DataTests]] = "" + database: Optional[str] = "" + freshness: Optional[FreshnessDefinition] = Field(FreshnessDefinition(), json_schema_extra={"$comment": "truly_nullable"}) + loaded_at_field: Optional[str] = "" + loader: Optional[str] = "" + meta: Optional[Dict[str, Any]] = "" + overrides: Optional[str] = Field( + None, + description="The name of another package installed in your project. If that package has a source with the same name as this one, its properties will be applied on top of the base properties of the overridden source. https://docs.getdbt.com/reference/resource-properties/overrides", + title="Package to Override", + ) + quoting: Optional[Quoting] = "" + schema_: Optional[str] = Field( + None, + alias="schema", + description="The schema name as stored in the database. Only needed if you want to use a different `name` than what exists in the database (otherwise `name` is used by default)", + ) + tables: Optional[List[Table]] = "" + tags: Optional[StringOrArrayOfStrings] = "" + tests: Optional[List[DataTests]] = "" + + +class DbtYmlFiles(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + version: Literal[2] = 2 + analyses: Optional[List[Analysis]] = "" + exposures: Optional[List[Exposure]] = "" + groups: Optional[List[Group]] = "" + macros: Optional[List[Macro]] = "" + metrics: Optional[List[Metric]] = "" + models: Optional[List[Model]] = "" + saved_queries: Optional[List[SavedQuery]] = "" + seeds: Optional[List[Seed]] = "" + semantic_models: Optional[List[SemanticModel]] = "" + snapshots: Optional[List[Snapshot]] = "" + sources: Optional[List[Source]] = "" + unit_tests: Optional[List[UnitTest]] = "" diff --git a/src/latest/dependencies.py b/src/latest/dependencies.py new file mode 100644 index 0000000..48b1e11 --- /dev/null +++ b/src/latest/dependencies.py @@ -0,0 +1,76 @@ +# generated by datamodel-codegen: +# filename: dependencies-latest.json +# timestamp: 2024-08-05T21:14:54+00:00 + +from __future__ import annotations + +from typing import Any, List, Optional, Union + +from pydantic import BaseModel, ConfigDict, Field + + +class Project(BaseModel): + model_config = ConfigDict( + extra='forbid', + ) + name: str + + +class HubPackages(BaseModel): + model_config = ConfigDict( + extra='forbid', + ) + version: Union[str, float, List[Any]] = Field( + ..., + description='A semantic version string or range, such as [">=1.0.0", "<2.0.0"]', + title='Package version', + ) + install_prerelease: Optional[bool] = Field( + None, + alias='install-prerelease', + description='Opt in to prerelease versions of a package', + title='Install Prerelease', + ) + package: str = Field( + ..., + description='Must be in format `org_name/package_name`. Refer to hub.getdbt.com for installation instructions', + examples=['dbt-labs/dbt_utils'], + pattern='^[\\w\\-\\.]+/[\\w\\-\\.]+$', + title='Package identifier', + ) + + +class GitPackages(BaseModel): + model_config = ConfigDict( + extra='forbid', + ) + git: str = Field(..., title='Git URL') + revision: Optional[str] = Field( + None, + description='Pin your package to a specific release by specifying a release name', + title='Revision', + ) + subdirectory: Optional[str] = Field( + None, + description='Only required if the package is nested in a subdirectory of the git project', + title='Subdirectory', + ) + + +class LocalPackage(BaseModel): + model_config = ConfigDict( + extra='forbid', + ) + local: Optional[str] = None + + +class Packages(BaseModel): + model_config = ConfigDict( + extra='forbid', + ) + packages: Optional[List[Union[HubPackages, GitPackages, LocalPackage]]] = Field( + None, min_length=1 + ) + +class Dependencies(Packages): + projects: Optional[List[Project]] = None \ No newline at end of file diff --git a/src/latest/selectors.py b/src/latest/selectors.py new file mode 100644 index 0000000..859ffba --- /dev/null +++ b/src/latest/selectors.py @@ -0,0 +1,92 @@ +# generated by datamodel-codegen: +# filename: selectors-latest.json +# timestamp: 2024-08-05T21:30:57+00:00 + +from __future__ import annotations + +from enum import Enum +from typing import List, Optional, Union + +from pydantic import BaseModel, ConfigDict, Field, RootModel + + +class Default(RootModel[str]): + root: str = Field(..., pattern='\\{\\{.*\\}\\}') + + +class Method(Enum): + tag = 'tag' + source = 'source' + path = 'path' + file = 'file' + fqn = 'fqn' + package = 'package' + config = 'config' + test_type = 'test_type' + test_name = 'test_name' + state = 'state' + exposure = 'exposure' + metric = 'metric' + result = 'result' + source_status = 'source_status' + group = 'group' + wildcard = 'wildcard' + + +class IndirectSelection(Enum): + buildable = 'buildable' + cautious = 'cautious' + eager = 'eager' + + +class JinjaString(RootModel[str]): + root: str = Field(..., pattern='\\{\\{.*\\}\\}') + + +class BooleanOrJinjaString(RootModel[Union[JinjaString, bool]]): + root: Union[JinjaString, bool] + + +class DefinitionBlock(BaseModel): + model_config = ConfigDict( + extra='allow', + ) + method: Optional[Method] = None + value: Optional[str] = None + children: Optional[BooleanOrJinjaString] = None + parents: Optional[BooleanOrJinjaString] = None + children_depth: Optional[float] = None + parents_depth: Optional[float] = None + childrens_parents: Optional[BooleanOrJinjaString] = None + indirect_selection: Optional[IndirectSelection] = None + + +class IntersectionBlock(RootModel[List[DefinitionBlock]]): + root: List[DefinitionBlock] + + +class ExcludeBlock(RootModel[List[Union[IntersectionBlock, DefinitionBlock]]]): + root: List[Union[IntersectionBlock, DefinitionBlock]] + + +class UnionBlock( + RootModel[List[Union[IntersectionBlock, DefinitionBlock, ExcludeBlock]]] +): + root: List[Union[IntersectionBlock, DefinitionBlock, ExcludeBlock]] + + +class Selector(BaseModel): + model_config = ConfigDict( + extra='forbid', + ) + name: Optional[str] = None + description: Optional[str] = None + default: Optional[Union[Default, bool]] = None + definition: Optional[Union[DefinitionBlock, str, UnionBlock]] = None + + +class Selectors(BaseModel): + model_config = ConfigDict( + extra='forbid', + ) + selectors: List[Selector] = Field(..., min_length=1) diff --git a/tests/latest/valid/dbt_yml_files.yml b/tests/latest/valid/dbt_yml_files.yml index 1b07fe1..7ec00a4 100644 --- a/tests/latest/valid/dbt_yml_files.yml +++ b/tests/latest/valid/dbt_yml_files.yml @@ -289,3 +289,28 @@ saved_queries: alias: my_export_alias export_as: table schema: my_export_schema_name + + +sources: + - name: jaffle_shop + database: raw + + freshness: # default freshness + warn_after: {count: 12, period: hour} + error_after: {count: 24, period: hour} + + loaded_at_field: _etl_loaded_at + + tables: + - name: customers # this will use the freshness defined above + + - name: orders + freshness: # make this a little more strict + warn_after: {count: 6, period: hour} + error_after: {count: 12, period: hour} + # Apply a where clause in the freshness query + filter: datediff('day', _etl_loaded_at, current_timestamp) < 2 + + + - name: product_skus + freshness: # do not check freshness for this table \ No newline at end of file diff --git a/tests/latest/valid/dependencies.yml b/tests/latest/valid/dependencies.yml index 19c88c5..c088a26 100644 --- a/tests/latest/valid/dependencies.yml +++ b/tests/latest/valid/dependencies.yml @@ -1,6 +1,10 @@ projects: - name: my_dbt_project + - name: other_project packages: - package: dbt-labs/dbt-utils - version: 1.0.0 \ No newline at end of file + version: 1.0.0 + - local: ../my_local_package + - git: "https://github.com/dbt-labs/dbt-utils.git" + revision: 0.9.2 \ No newline at end of file