diff --git a/.changes/unreleased/Features-20240506-175642.yaml b/.changes/unreleased/Features-20240506-175642.yaml new file mode 100644 index 00000000000..308be95b4d6 --- /dev/null +++ b/.changes/unreleased/Features-20240506-175642.yaml @@ -0,0 +1,6 @@ +kind: Features +body: serialize inferred primary key +time: 2024-05-06T17:56:42.757673-05:00 +custom: + Author: dave-connors-3 + Issue: "9824" diff --git a/core/dbt/artifacts/README.md b/core/dbt/artifacts/README.md index ce06ce4d74e..0cb2ea96e25 100644 --- a/core/dbt/artifacts/README.md +++ b/core/dbt/artifacts/README.md @@ -39,6 +39,15 @@ Freely make incremental, non-breaking changes in-place to the latest major versi These types of minor, non-breaking changes are tested by [tests/unit/artifacts/test_base_resource.py::TestMinorSchemaChange](https://github.com/dbt-labs/dbt-core/blob/main/tests/unit/artifacts/test_base_resource.py). + +#### Updating [schemas.getdbt.com](https://schemas.getdbt.com) +Non-breaking changes to artifact schemas require an update to the corresponding jsonschemas published to [schemas.getdbt.com](https://schemas.getdbt.com), which are defined in https://github.com/dbt-labs/schemas.getdbt.com. To do so: +1. Create a PR in https://github.com/dbt-labs/schemas.getdbt.com which reflects the schema changes to the artifact. The schema can be updated in-place for non-breaking changes. Example PR: https://github.com/dbt-labs/schemas.getdbt.com/pull/39 +2. Merge the https://github.com/dbt-labs/schemas.getdbt.com PR +3. Observe the `Artifact Schema Check` CI check pass on the `dbt-core` PR that updates the artifact schemas, and merge the `dbt-core` PR! + +Note: Although `jsonschema` validation using the schemas in [schemas.getdbt.com](https://schemas.getdbt.com) is not encouraged or formally supported, `jsonschema` validation should still continue to work once the schemas are updated because they are forward-compatible and can therefore be used to validate previous minor versions of the schema. + ### Breaking changes A breaking change is anything that: * Deletes a required field diff --git a/core/dbt/artifacts/resources/v1/model.py b/core/dbt/artifacts/resources/v1/model.py index ed88bb34f8b..821d04f147f 100644 --- a/core/dbt/artifacts/resources/v1/model.py +++ b/core/dbt/artifacts/resources/v1/model.py @@ -31,6 +31,7 @@ class Model(CompiledResource): latest_version: Optional[NodeVersion] = None deprecation_date: Optional[datetime] = None defer_relation: Optional[DeferRelation] = None + primary_key: List[str] = field(default_factory=list) def __post_serialize__(self, dct: Dict, context: Optional[Dict] = None): dct = super().__post_serialize__(dct, context) diff --git a/core/dbt/parser/manifest.py b/core/dbt/parser/manifest.py index 0ab35110a66..ca21ae3039f 100644 --- a/core/dbt/parser/manifest.py +++ b/core/dbt/parser/manifest.py @@ -50,6 +50,7 @@ ) from dbt.contracts.graph.nodes import ( Exposure, + GenericTestNode, Macro, ManifestNode, Metric, @@ -466,6 +467,7 @@ def load(self) -> Manifest: self.process_docs(self.root_project) self.process_metrics(self.root_project) self.process_saved_queries(self.root_project) + self.process_model_inferred_primary_keys() self.check_valid_group_config() self.check_valid_access_property() @@ -1149,6 +1151,15 @@ def process_saved_queries(self, config: RuntimeConfig): # 2. process `group_by` of SavedQuery for `depends_on`` _process_metrics_for_node(self.manifest, current_project, saved_query) + def process_model_inferred_primary_keys(self): + """Processes Model nodes to populate their `primary_key`.""" + for node in self.manifest.nodes.values(): + if not isinstance(node, ModelNode): + continue + generic_tests = self._get_generic_tests_for_model(node) + primary_key = node.infer_primary_key(generic_tests) + node.primary_key = sorted(primary_key) + def update_semantic_model(self, semantic_model) -> None: # This has to be done at the end of parsing because the referenced model # might have alias/schema/database fields that are updated by yaml config. @@ -1344,6 +1355,24 @@ def write_perf_info(self, target_path: str): write_file(path, json.dumps(self._perf_info, cls=dbt.utils.JSONEncoder, indent=4)) fire_event(ParsePerfInfoPath(path=path)) + def _get_generic_tests_for_model( + self, + model: ModelNode, + ) -> List[GenericTestNode]: + """Return a list of generic tests that are attached to the given model, including disabled tests""" + tests = [] + for _, node in self.manifest.nodes.items(): + if isinstance(node, GenericTestNode) and node.attached_node == model.unique_id: + tests.append(node) + for _, nodes in self.manifest.disabled.items(): + for disabled_node in nodes: + if ( + isinstance(disabled_node, GenericTestNode) + and disabled_node.attached_node == model.unique_id + ): + tests.append(disabled_node) + return tests + def invalid_target_fail_unless_test( node, diff --git a/schemas/dbt/manifest/v12.json b/schemas/dbt/manifest/v12.json index 6c4040ea2f6..6da1edee266 100644 --- a/schemas/dbt/manifest/v12.json +++ b/schemas/dbt/manifest/v12.json @@ -13,7 +13,7 @@ }, "dbt_version": { "type": "string", - "default": "1.8.0a1" + "default": "1.8.0b3" }, "generated_at": { "type": "string" @@ -108,7 +108,7 @@ "anyOf": [ { "type": "object", - "title": "AnalysisNode", + "title": "Seed", "properties": { "database": { "anyOf": [ @@ -127,7 +127,7 @@ "type": "string" }, "resource_type": { - "const": "analysis" + "const": "seed" }, "package_name": { "type": "string" @@ -169,7 +169,7 @@ }, "config": { "type": "object", - "title": "NodeConfig", + "title": "SeedConfig", "properties": { "_extra": { "type": "object", @@ -246,7 +246,7 @@ }, "materialized": { "type": "string", - "default": "view" + "default": "seed" }, "incremental_strategy": { "anyOf": [ @@ -433,16 +433,25 @@ } }, "additionalProperties": false + }, + "delimiter": { + "type": "string", + "default": "," + }, + "quote_columns": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "default": null } }, "additionalProperties": true }, - "_event_status": { - "type": "object", - "propertyNames": { - "type": "string" - } - }, "tags": { "type": "array", "items": { @@ -630,10 +639,6 @@ ], "default": null }, - "deferred": { - "type": "boolean", - "default": false - }, "unrendered_config": { "type": "object", "propertyNames": { @@ -664,580 +669,432 @@ "type": "string", "default": "" }, - "language": { - "type": "string", - "default": "sql" - }, - "refs": { - "type": "array", - "items": { - "type": "object", - "title": "RefArgs", - "properties": { - "name": { - "type": "string" - }, - "package": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null - }, - "version": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "number" - }, - { - "type": "null" - } - ], - "default": null - } - }, - "additionalProperties": false, - "required": [ - "name" - ] - } - }, - "sources": { - "type": "array", - "items": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "metrics": { - "type": "array", - "items": { - "type": "array", - "items": { + "root_path": { + "anyOf": [ + { "type": "string" + }, + { + "type": "null" } - } + ], + "default": null }, "depends_on": { "type": "object", - "title": "DependsOn", + "title": "MacroDependsOn", "properties": { "macros": { "type": "array", "items": { "type": "string" } - }, - "nodes": { - "type": "array", - "items": { - "type": "string" - } } }, "additionalProperties": false }, - "compiled_path": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null - }, - "compiled": { - "type": "boolean", - "default": false - }, - "compiled_code": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null - }, - "extra_ctes_injected": { - "type": "boolean", - "default": false - }, - "extra_ctes": { - "type": "array", - "items": { - "type": "object", - "title": "InjectedCTE", - "properties": { - "id": { - "type": "string" - }, - "sql": { - "type": "string" - } - }, - "additionalProperties": false, - "required": [ - "id", - "sql" - ] - } - }, - "_pre_injected_sql": { + "defer_relation": { "anyOf": [ { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null - }, - "contract": { - "type": "object", - "title": "Contract", - "properties": { - "enforced": { - "type": "boolean", - "default": false - }, - "alias_types": { - "type": "boolean", - "default": true - }, - "checksum": { - "anyOf": [ - { + "type": "object", + "title": "DeferRelation", + "properties": { + "database": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "schema": { "type": "string" }, - { - "type": "null" - } - ], - "default": null - } - }, - "additionalProperties": false - } - }, - "additionalProperties": false, - "required": [ - "database", - "schema", - "name", - "resource_type", - "package_name", - "path", - "original_file_path", - "unique_id", - "fqn", - "alias", - "checksum" - ] - }, - { - "type": "object", - "title": "SingularTestNode", - "properties": { - "database": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "schema": { - "type": "string" - }, - "name": { - "type": "string" - }, - "resource_type": { - "const": "test" - }, - "package_name": { - "type": "string" - }, - "path": { - "type": "string" - }, - "original_file_path": { - "type": "string" - }, - "unique_id": { - "type": "string" - }, - "fqn": { - "type": "array", - "items": { - "type": "string" - } - }, - "alias": { - "type": "string" - }, - "checksum": { - "type": "object", - "title": "FileHash", - "properties": { - "name": { - "type": "string" - }, - "checksum": { - "type": "string" - } - }, - "additionalProperties": false, - "required": [ - "name", - "checksum" - ] - }, - "config": { - "type": "object", - "title": "TestConfig", - "properties": { - "_extra": { - "type": "object", - "propertyNames": { - "type": "string" - } - }, - "enabled": { - "type": "boolean", - "default": true - }, - "alias": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null - }, - "schema": { - "anyOf": [ - { + "alias": { "type": "string" }, - { - "type": "null" - } - ], - "default": "dbt_test__audit" - }, - "database": { - "anyOf": [ - { - "type": "string" + "relation_name": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] }, - { - "type": "null" - } - ], - "default": null - }, - "tags": { - "anyOf": [ - { - "type": "array", - "items": { - "type": "string" - } + "resource_type": { + "enum": [ + "model", + "analysis", + "test", + "snapshot", + "operation", + "seed", + "rpc", + "sql_operation", + "doc", + "source", + "macro", + "exposure", + "metric", + "group", + "saved_query", + "semantic_model", + "unit_test", + "fixture" + ] }, - { - "type": "string" - } - ] - }, - "meta": { - "type": "object", - "propertyNames": { - "type": "string" - } - }, - "group": { - "anyOf": [ - { + "name": { "type": "string" }, - { - "type": "null" - } - ], - "default": null - }, - "materialized": { - "type": "string", - "default": "test" - }, - "severity": { - "type": "string", - "default": "ERROR", - "pattern": "^([Ww][Aa][Rr][Nn]|[Ee][Rr][Rr][Oo][Rr])$" - }, - "store_failures": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "null" - } - ], - "default": null - }, - "store_failures_as": { - "anyOf": [ - { + "description": { "type": "string" }, - { - "type": "null" - } - ], - "default": null - }, - "where": { - "anyOf": [ - { - "type": "string" + "compiled_code": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] }, - { - "type": "null" - } - ], - "default": null - }, - "limit": { - "anyOf": [ - { - "type": "integer" + "meta": { + "type": "object", + "propertyNames": { + "type": "string" + } }, - { - "type": "null" - } - ], - "default": null - }, - "fail_calc": { - "type": "string", - "default": "count(*)" - }, - "warn_if": { - "type": "string", - "default": "!= 0" - }, - "error_if": { - "type": "string", - "default": "!= 0" - } - }, - "additionalProperties": true - }, - "_event_status": { - "type": "object", - "propertyNames": { - "type": "string" - } - }, - "tags": { - "type": "array", - "items": { - "type": "string" - } - }, - "description": { - "type": "string", - "default": "" - }, - "columns": { - "type": "object", - "additionalProperties": { - "type": "object", - "title": "ColumnInfo", - "properties": { - "name": { - "type": "string" - }, - "description": { - "type": "string", - "default": "" - }, - "meta": { - "type": "object", - "propertyNames": { - "type": "string" - } - }, - "data_type": { - "anyOf": [ - { + "tags": { + "type": "array", + "items": { "type": "string" - }, - { - "type": "null" } - ], - "default": null - }, - "constraints": { - "type": "array", - "items": { - "type": "object", - "title": "ColumnLevelConstraint", - "properties": { - "type": { - "enum": [ - "check", - "not_null", - "unique", - "primary_key", - "foreign_key", - "custom" - ] - }, - "name": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null - }, - "expression": { - "anyOf": [ - { - "type": "string" + }, + "config": { + "anyOf": [ + { + "type": "object", + "title": "NodeConfig", + "properties": { + "_extra": { + "type": "object", + "propertyNames": { + "type": "string" + } }, - { - "type": "null" + "enabled": { + "type": "boolean", + "default": true + }, + "alias": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "database": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "tags": { + "anyOf": [ + { + "type": "array", + "items": { + "type": "string" + } + }, + { + "type": "string" + } + ] + }, + "meta": { + "type": "object", + "propertyNames": { + "type": "string" + } + }, + "group": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "materialized": { + "type": "string", + "default": "view" + }, + "incremental_strategy": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "persist_docs": { + "type": "object", + "propertyNames": { + "type": "string" + } + }, + "post-hook": { + "type": "array", + "items": { + "type": "object", + "title": "Hook", + "properties": { + "sql": { + "type": "string" + }, + "transaction": { + "type": "boolean", + "default": true + }, + "index": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "default": null + } + }, + "additionalProperties": false, + "required": [ + "sql" + ] + } + }, + "pre-hook": { + "type": "array", + "items": { + "type": "object", + "title": "Hook", + "properties": { + "sql": { + "type": "string" + }, + "transaction": { + "type": "boolean", + "default": true + }, + "index": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "default": null + } + }, + "additionalProperties": false, + "required": [ + "sql" + ] + } + }, + "quoting": { + "type": "object", + "propertyNames": { + "type": "string" + } + }, + "column_types": { + "type": "object", + "propertyNames": { + "type": "string" + } + }, + "full_refresh": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "default": null + }, + "unique_key": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + }, + { + "type": "null" + } + ], + "default": null + }, + "on_schema_change": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": "ignore" + }, + "on_configuration_change": { + "enum": [ + "apply", + "continue", + "fail" + ] + }, + "grants": { + "type": "object", + "propertyNames": { + "type": "string" + } + }, + "packages": { + "type": "array", + "items": { + "type": "string" + } + }, + "docs": { + "type": "object", + "title": "Docs", + "properties": { + "show": { + "type": "boolean", + "default": true + }, + "node_color": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + } + }, + "additionalProperties": false + }, + "contract": { + "type": "object", + "title": "ContractConfig", + "properties": { + "enforced": { + "type": "boolean", + "default": false + }, + "alias_types": { + "type": "boolean", + "default": true + } + }, + "additionalProperties": false } - ], - "default": null - }, - "warn_unenforced": { - "type": "boolean", - "default": true + }, + "additionalProperties": true }, - "warn_unsupported": { - "type": "boolean", - "default": true + { + "type": "null" } - }, - "additionalProperties": false, - "required": [ - "type" ] } }, - "quote": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "null" - } - ], - "default": null - }, - "tags": { - "type": "array", - "items": { - "type": "string" - } - }, - "_extra": { - "type": "object", - "propertyNames": { - "type": "string" - } - } - }, - "additionalProperties": true, - "required": [ - "name" - ] - }, - "propertyNames": { - "type": "string" - } - }, - "meta": { - "type": "object", - "propertyNames": { - "type": "string" - } - }, - "group": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null - }, - "docs": { - "type": "object", - "title": "Docs", - "properties": { - "show": { - "type": "boolean", - "default": true - }, - "node_color": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null - } - }, - "additionalProperties": false - }, - "patch_path": { - "anyOf": [ - { - "type": "string" + "additionalProperties": false, + "required": [ + "database", + "schema", + "alias", + "relation_name", + "resource_type", + "name", + "description", + "compiled_code", + "meta", + "tags", + "config" + ] }, { "type": "null" } ], "default": null - }, - "build_path": { + } + }, + "additionalProperties": false, + "required": [ + "database", + "schema", + "name", + "resource_type", + "package_name", + "path", + "original_file_path", + "unique_id", + "fqn", + "alias", + "checksum" + ] + }, + { + "type": "object", + "title": "Analysis", + "properties": { + "database": { "anyOf": [ { "type": "string" @@ -1245,313 +1102,79 @@ { "type": "null" } - ], - "default": null + ] }, - "deferred": { - "type": "boolean", - "default": false + "schema": { + "type": "string" }, - "unrendered_config": { - "type": "object", - "propertyNames": { - "type": "string" - } + "name": { + "type": "string" }, - "created_at": { - "type": "number" + "resource_type": { + "const": "analysis" }, - "config_call_dict": { - "type": "object", - "propertyNames": { - "type": "string" - } + "package_name": { + "type": "string" }, - "relation_name": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null + "path": { + "type": "string" }, - "raw_code": { - "type": "string", - "default": "" + "original_file_path": { + "type": "string" }, - "language": { - "type": "string", - "default": "sql" + "unique_id": { + "type": "string" }, - "refs": { + "fqn": { "type": "array", "items": { - "type": "object", - "title": "RefArgs", - "properties": { - "name": { - "type": "string" - }, - "package": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null - }, - "version": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "number" - }, - { - "type": "null" - } - ], - "default": null - } - }, - "additionalProperties": false, - "required": [ - "name" - ] + "type": "string" } }, - "sources": { - "type": "array", - "items": { - "type": "array", - "items": { - "type": "string" - } - } + "alias": { + "type": "string" }, - "metrics": { - "type": "array", - "items": { - "type": "array", - "items": { + "checksum": { + "type": "object", + "title": "FileHash", + "properties": { + "name": { + "type": "string" + }, + "checksum": { "type": "string" } - } + }, + "additionalProperties": false, + "required": [ + "name", + "checksum" + ] }, - "depends_on": { + "config": { "type": "object", - "title": "DependsOn", + "title": "NodeConfig", "properties": { - "macros": { - "type": "array", - "items": { + "_extra": { + "type": "object", + "propertyNames": { "type": "string" } }, - "nodes": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "additionalProperties": false - }, - "compiled_path": { - "anyOf": [ - { - "type": "string" + "enabled": { + "type": "boolean", + "default": true }, - { - "type": "null" - } - ], - "default": null - }, - "compiled": { - "type": "boolean", - "default": false - }, - "compiled_code": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null - }, - "extra_ctes_injected": { - "type": "boolean", - "default": false - }, - "extra_ctes": { - "type": "array", - "items": { - "type": "object", - "title": "InjectedCTE", - "properties": { - "id": { - "type": "string" - }, - "sql": { - "type": "string" - } - }, - "additionalProperties": false, - "required": [ - "id", - "sql" - ] - } - }, - "_pre_injected_sql": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null - }, - "contract": { - "type": "object", - "title": "Contract", - "properties": { - "enforced": { - "type": "boolean", - "default": false - }, - "alias_types": { - "type": "boolean", - "default": true - }, - "checksum": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null - } - }, - "additionalProperties": false - } - }, - "additionalProperties": false, - "required": [ - "database", - "schema", - "name", - "resource_type", - "package_name", - "path", - "original_file_path", - "unique_id", - "fqn", - "alias", - "checksum" - ] - }, - { - "type": "object", - "title": "HookNode", - "properties": { - "database": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "schema": { - "type": "string" - }, - "name": { - "type": "string" - }, - "resource_type": { - "const": "operation" - }, - "package_name": { - "type": "string" - }, - "path": { - "type": "string" - }, - "original_file_path": { - "type": "string" - }, - "unique_id": { - "type": "string" - }, - "fqn": { - "type": "array", - "items": { - "type": "string" - } - }, - "alias": { - "type": "string" - }, - "checksum": { - "type": "object", - "title": "FileHash", - "properties": { - "name": { - "type": "string" - }, - "checksum": { - "type": "string" - } - }, - "additionalProperties": false, - "required": [ - "name", - "checksum" - ] - }, - "config": { - "type": "object", - "title": "NodeConfig", - "properties": { - "_extra": { - "type": "object", - "propertyNames": { - "type": "string" - } - }, - "enabled": { - "type": "boolean", - "default": true - }, - "alias": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null + "alias": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null }, "schema": { "anyOf": [ @@ -1798,12 +1421,6 @@ }, "additionalProperties": true }, - "_event_status": { - "type": "object", - "propertyNames": { - "type": "string" - } - }, "tags": { "type": "array", "items": { @@ -1991,10 +1608,6 @@ ], "default": null }, - "deferred": { - "type": "boolean", - "default": false - }, "unrendered_config": { "type": "object", "propertyNames": { @@ -2193,17 +1806,6 @@ } }, "additionalProperties": false - }, - "index": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "default": null } }, "additionalProperties": false, @@ -2223,7 +1825,7 @@ }, { "type": "object", - "title": "ModelNode", + "title": "SingularTest", "properties": { "database": { "anyOf": [ @@ -2242,7 +1844,7 @@ "type": "string" }, "resource_type": { - "const": "model" + "const": "test" }, "package_name": { "type": "string" @@ -2284,7 +1886,7 @@ }, "config": { "type": "object", - "title": "ModelConfig", + "title": "TestConfig", "properties": { "_extra": { "type": "object", @@ -2316,7 +1918,7 @@ "type": "null" } ], - "default": null + "default": "dbt_test__audit" }, "database": { "anyOf": [ @@ -2361,12 +1963,17 @@ }, "materialized": { "type": "string", - "default": "view" + "default": "test" }, - "incremental_strategy": { + "severity": { + "type": "string", + "default": "ERROR", + "pattern": "^([Ww][Aa][Rr][Nn]|[Ee][Rr][Rr][Oo][Rr])$" + }, + "store_failures": { "anyOf": [ { - "type": "string" + "type": "boolean" }, { "type": "null" @@ -2374,107 +1981,32 @@ ], "default": null }, - "persist_docs": { - "type": "object", - "propertyNames": { - "type": "string" - } + "store_failures_as": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null }, - "post-hook": { - "type": "array", - "items": { - "type": "object", - "title": "Hook", - "properties": { - "sql": { - "type": "string" - }, - "transaction": { - "type": "boolean", - "default": true - }, - "index": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "default": null - } + "where": { + "anyOf": [ + { + "type": "string" }, - "additionalProperties": false, - "required": [ - "sql" - ] - } + { + "type": "null" + } + ], + "default": null }, - "pre-hook": { - "type": "array", - "items": { - "type": "object", - "title": "Hook", - "properties": { - "sql": { - "type": "string" - }, - "transaction": { - "type": "boolean", - "default": true - }, - "index": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "default": null - } - }, - "additionalProperties": false, - "required": [ - "sql" - ] - } - }, - "quoting": { - "type": "object", - "propertyNames": { - "type": "string" - } - }, - "column_types": { - "type": "object", - "propertyNames": { - "type": "string" - } - }, - "full_refresh": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "null" - } - ], - "default": null - }, - "unique_key": { + "limit": { "anyOf": [ { - "type": "string" - }, - { - "type": "array", - "items": { - "type": "string" - } + "type": "integer" }, { "type": "null" @@ -2482,90 +2014,21 @@ ], "default": null }, - "on_schema_change": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": "ignore" - }, - "on_configuration_change": { - "enum": [ - "apply", - "continue", - "fail" - ] - }, - "grants": { - "type": "object", - "propertyNames": { - "type": "string" - } - }, - "packages": { - "type": "array", - "items": { - "type": "string" - } - }, - "docs": { - "type": "object", - "title": "Docs", - "properties": { - "show": { - "type": "boolean", - "default": true - }, - "node_color": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null - } - }, - "additionalProperties": false + "fail_calc": { + "type": "string", + "default": "count(*)" }, - "contract": { - "type": "object", - "title": "ContractConfig", - "properties": { - "enforced": { - "type": "boolean", - "default": false - }, - "alias_types": { - "type": "boolean", - "default": true - } - }, - "additionalProperties": false + "warn_if": { + "type": "string", + "default": "!= 0" }, - "access": { - "enum": [ - "private", - "protected", - "public" - ], - "default": "protected" + "error_if": { + "type": "string", + "default": "!= 0" } }, "additionalProperties": true }, - "_event_status": { - "type": "object", - "propertyNames": { - "type": "string" - } - }, "tags": { "type": "array", "items": { @@ -2753,10 +2216,6 @@ ], "default": null }, - "deferred": { - "type": "boolean", - "default": false - }, "unrendered_config": { "type": "object", "propertyNames": { @@ -2955,189 +2414,36 @@ } }, "additionalProperties": false - }, - "access": { - "enum": [ - "private", - "protected", - "public" - ], - "default": "protected" - }, - "constraints": { - "type": "array", - "items": { - "type": "object", - "title": "ModelLevelConstraint", - "properties": { - "type": { - "enum": [ - "check", - "not_null", - "unique", - "primary_key", - "foreign_key", - "custom" - ] - }, - "name": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null - }, - "expression": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null - }, - "warn_unenforced": { - "type": "boolean", - "default": true - }, - "warn_unsupported": { - "type": "boolean", - "default": true - }, - "columns": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "additionalProperties": false, - "required": [ - "type" - ] - } - }, - "version": { + } + }, + "additionalProperties": false, + "required": [ + "database", + "schema", + "name", + "resource_type", + "package_name", + "path", + "original_file_path", + "unique_id", + "fqn", + "alias", + "checksum" + ] + }, + { + "type": "object", + "title": "HookNode", + "properties": { + "database": { "anyOf": [ { "type": "string" }, - { - "type": "number" - }, { "type": "null" } - ], - "default": null - }, - "latest_version": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "number" - }, - { - "type": "null" - } - ], - "default": null - }, - "deprecation_date": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null - }, - "defer_relation": { - "anyOf": [ - { - "type": "object", - "title": "DeferRelation", - "properties": { - "database": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "schema": { - "type": "string" - }, - "alias": { - "type": "string" - }, - "relation_name": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - } - }, - "additionalProperties": false, - "required": [ - "database", - "schema", - "alias", - "relation_name" - ] - }, - { - "type": "null" - } - ], - "default": null - } - }, - "additionalProperties": false, - "required": [ - "database", - "schema", - "name", - "resource_type", - "package_name", - "path", - "original_file_path", - "unique_id", - "fqn", - "alias", - "checksum" - ] - }, - { - "type": "object", - "title": "RPCNode", - "properties": { - "database": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] + ] }, "schema": { "type": "string" @@ -3146,7 +2452,7 @@ "type": "string" }, "resource_type": { - "const": "rpc" + "const": "operation" }, "package_name": { "type": "string" @@ -3456,12 +2762,6 @@ }, "additionalProperties": true }, - "_event_status": { - "type": "object", - "propertyNames": { - "type": "string" - } - }, "tags": { "type": "array", "items": { @@ -3649,10 +2949,6 @@ ], "default": null }, - "deferred": { - "type": "boolean", - "default": false - }, "unrendered_config": { "type": "object", "propertyNames": { @@ -3851,6 +3147,17 @@ } }, "additionalProperties": false + }, + "index": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "default": null } }, "additionalProperties": false, @@ -3870,7 +3177,7 @@ }, { "type": "object", - "title": "SqlNode", + "title": "Model", "properties": { "database": { "anyOf": [ @@ -3889,7 +3196,7 @@ "type": "string" }, "resource_type": { - "const": "sql_operation" + "const": "model" }, "package_name": { "type": "string" @@ -3931,7 +3238,7 @@ }, "config": { "type": "object", - "title": "NodeConfig", + "title": "ModelConfig", "properties": { "_extra": { "type": "object", @@ -4195,16 +3502,18 @@ } }, "additionalProperties": false + }, + "access": { + "enum": [ + "private", + "protected", + "public" + ], + "default": "protected" } }, "additionalProperties": true }, - "_event_status": { - "type": "object", - "propertyNames": { - "type": "string" - } - }, "tags": { "type": "array", "items": { @@ -4392,10 +3701,6 @@ ], "default": null }, - "deferred": { - "type": "boolean", - "default": false - }, "unrendered_config": { "type": "object", "propertyNames": { @@ -4594,684 +3899,504 @@ } }, "additionalProperties": false - } - }, - "additionalProperties": false, - "required": [ - "database", - "schema", - "name", - "resource_type", - "package_name", - "path", - "original_file_path", - "unique_id", - "fqn", - "alias", - "checksum" - ] - }, - { - "type": "object", - "title": "GenericTestNode", - "properties": { - "test_metadata": { - "type": "object", - "title": "TestMetadata", - "properties": { - "name": { - "type": "string" - }, - "kwargs": { - "type": "object", - "propertyNames": { - "type": "string" - } - }, - "namespace": { - "anyOf": [ - { + }, + "access": { + "enum": [ + "private", + "protected", + "public" + ], + "default": "protected" + }, + "constraints": { + "type": "array", + "items": { + "type": "object", + "title": "ModelLevelConstraint", + "properties": { + "type": { + "enum": [ + "check", + "not_null", + "unique", + "primary_key", + "foreign_key", + "custom" + ] + }, + "name": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "expression": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "warn_unenforced": { + "type": "boolean", + "default": true + }, + "warn_unsupported": { + "type": "boolean", + "default": true + }, + "columns": { + "type": "array", + "items": { "type": "string" - }, - { - "type": "null" } - ], - "default": null - } - }, - "additionalProperties": false, - "required": [ - "name" - ] + } + }, + "additionalProperties": false, + "required": [ + "type" + ] + } }, - "database": { + "version": { "anyOf": [ { "type": "string" }, + { + "type": "number" + }, { "type": "null" } - ] - }, - "schema": { - "type": "string" + ], + "default": null }, - "name": { - "type": "string" - }, - "resource_type": { - "const": "test" - }, - "package_name": { - "type": "string" - }, - "path": { - "type": "string" - }, - "original_file_path": { - "type": "string" - }, - "unique_id": { - "type": "string" - }, - "fqn": { - "type": "array", - "items": { - "type": "string" - } - }, - "alias": { - "type": "string" - }, - "checksum": { - "type": "object", - "title": "FileHash", - "properties": { - "name": { + "latest_version": { + "anyOf": [ + { "type": "string" }, - "checksum": { + { + "type": "number" + }, + { + "type": "null" + } + ], + "default": null + }, + "deprecation_date": { + "anyOf": [ + { "type": "string" + }, + { + "type": "null" } - }, - "additionalProperties": false, - "required": [ - "name", - "checksum" - ] + ], + "default": null }, - "config": { - "type": "object", - "title": "TestConfig", - "properties": { - "_extra": { + "defer_relation": { + "anyOf": [ + { "type": "object", - "propertyNames": { - "type": "string" - } - }, - "enabled": { - "type": "boolean", - "default": true - }, - "alias": { - "anyOf": [ - { - "type": "string" + "title": "DeferRelation", + "properties": { + "database": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] }, - { - "type": "null" - } - ], - "default": null - }, - "schema": { - "anyOf": [ - { + "schema": { "type": "string" }, - { - "type": "null" - } - ], - "default": "dbt_test__audit" - }, - "database": { - "anyOf": [ - { + "alias": { "type": "string" }, - { - "type": "null" - } - ], - "default": null - }, - "tags": { - "anyOf": [ - { - "type": "array", - "items": { - "type": "string" - } - }, - { - "type": "string" - } - ] - }, - "meta": { - "type": "object", - "propertyNames": { - "type": "string" - } - }, - "group": { - "anyOf": [ - { - "type": "string" + "relation_name": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] }, - { - "type": "null" - } - ], - "default": null - }, - "materialized": { - "type": "string", - "default": "test" - }, - "severity": { - "type": "string", - "default": "ERROR", - "pattern": "^([Ww][Aa][Rr][Nn]|[Ee][Rr][Rr][Oo][Rr])$" - }, - "store_failures": { - "anyOf": [ - { - "type": "boolean" + "resource_type": { + "enum": [ + "model", + "analysis", + "test", + "snapshot", + "operation", + "seed", + "rpc", + "sql_operation", + "doc", + "source", + "macro", + "exposure", + "metric", + "group", + "saved_query", + "semantic_model", + "unit_test", + "fixture" + ] }, - { - "type": "null" - } - ], - "default": null - }, - "store_failures_as": { - "anyOf": [ - { + "name": { "type": "string" }, - { - "type": "null" - } - ], - "default": null - }, - "where": { - "anyOf": [ - { + "description": { "type": "string" }, - { - "type": "null" - } - ], - "default": null - }, - "limit": { - "anyOf": [ - { - "type": "integer" + "compiled_code": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] }, - { - "type": "null" - } - ], - "default": null - }, - "fail_calc": { - "type": "string", - "default": "count(*)" - }, - "warn_if": { - "type": "string", - "default": "!= 0" - }, - "error_if": { - "type": "string", - "default": "!= 0" - } - }, - "additionalProperties": true - }, - "_event_status": { - "type": "object", - "propertyNames": { - "type": "string" - } - }, - "tags": { - "type": "array", - "items": { - "type": "string" - } - }, - "description": { - "type": "string", - "default": "" - }, - "columns": { - "type": "object", - "additionalProperties": { - "type": "object", - "title": "ColumnInfo", - "properties": { - "name": { - "type": "string" - }, - "description": { - "type": "string", - "default": "" - }, - "meta": { - "type": "object", - "propertyNames": { - "type": "string" - } - }, - "data_type": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null - }, - "constraints": { - "type": "array", - "items": { + "meta": { "type": "object", - "title": "ColumnLevelConstraint", - "properties": { - "type": { - "enum": [ - "check", - "not_null", - "unique", - "primary_key", - "foreign_key", - "custom" - ] - }, - "name": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null - }, - "expression": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null - }, - "warn_unenforced": { - "type": "boolean", - "default": true - }, - "warn_unsupported": { - "type": "boolean", - "default": true - } - }, - "additionalProperties": false, - "required": [ - "type" - ] - } - }, - "quote": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "null" - } - ], - "default": null - }, - "tags": { - "type": "array", - "items": { - "type": "string" - } - }, - "_extra": { - "type": "object", - "propertyNames": { - "type": "string" - } - } - }, - "additionalProperties": true, - "required": [ - "name" - ] - }, - "propertyNames": { - "type": "string" - } - }, - "meta": { - "type": "object", - "propertyNames": { - "type": "string" - } - }, - "group": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null - }, - "docs": { - "type": "object", - "title": "Docs", - "properties": { - "show": { - "type": "boolean", - "default": true - }, - "node_color": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null - } - }, - "additionalProperties": false - }, - "patch_path": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null - }, - "build_path": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null - }, - "deferred": { - "type": "boolean", - "default": false - }, - "unrendered_config": { - "type": "object", - "propertyNames": { - "type": "string" - } - }, - "created_at": { - "type": "number" - }, - "config_call_dict": { - "type": "object", - "propertyNames": { - "type": "string" - } - }, - "relation_name": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null - }, - "raw_code": { - "type": "string", - "default": "" - }, - "language": { - "type": "string", - "default": "sql" - }, - "refs": { - "type": "array", - "items": { - "type": "object", - "title": "RefArgs", - "properties": { - "name": { - "type": "string" - }, - "package": { - "anyOf": [ - { + "propertyNames": { "type": "string" - }, - { - "type": "null" } - ], - "default": null - }, - "version": { - "anyOf": [ - { + }, + "tags": { + "type": "array", + "items": { "type": "string" - }, - { - "type": "number" - }, - { - "type": "null" } - ], - "default": null - } - }, - "additionalProperties": false, - "required": [ - "name" - ] - } - }, - "sources": { - "type": "array", - "items": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "metrics": { - "type": "array", - "items": { - "type": "array", - "items": { - "type": "string" - } - } + }, + "config": { + "anyOf": [ + { + "type": "object", + "title": "NodeConfig", + "properties": { + "_extra": { + "type": "object", + "propertyNames": { + "type": "string" + } + }, + "enabled": { + "type": "boolean", + "default": true + }, + "alias": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "database": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "tags": { + "anyOf": [ + { + "type": "array", + "items": { + "type": "string" + } + }, + { + "type": "string" + } + ] + }, + "meta": { + "type": "object", + "propertyNames": { + "type": "string" + } + }, + "group": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "materialized": { + "type": "string", + "default": "view" + }, + "incremental_strategy": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "persist_docs": { + "type": "object", + "propertyNames": { + "type": "string" + } + }, + "post-hook": { + "type": "array", + "items": { + "type": "object", + "title": "Hook", + "properties": { + "sql": { + "type": "string" + }, + "transaction": { + "type": "boolean", + "default": true + }, + "index": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "default": null + } + }, + "additionalProperties": false, + "required": [ + "sql" + ] + } + }, + "pre-hook": { + "type": "array", + "items": { + "type": "object", + "title": "Hook", + "properties": { + "sql": { + "type": "string" + }, + "transaction": { + "type": "boolean", + "default": true + }, + "index": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "default": null + } + }, + "additionalProperties": false, + "required": [ + "sql" + ] + } + }, + "quoting": { + "type": "object", + "propertyNames": { + "type": "string" + } + }, + "column_types": { + "type": "object", + "propertyNames": { + "type": "string" + } + }, + "full_refresh": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "default": null + }, + "unique_key": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + }, + { + "type": "null" + } + ], + "default": null + }, + "on_schema_change": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": "ignore" + }, + "on_configuration_change": { + "enum": [ + "apply", + "continue", + "fail" + ] + }, + "grants": { + "type": "object", + "propertyNames": { + "type": "string" + } + }, + "packages": { + "type": "array", + "items": { + "type": "string" + } + }, + "docs": { + "type": "object", + "title": "Docs", + "properties": { + "show": { + "type": "boolean", + "default": true + }, + "node_color": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + } + }, + "additionalProperties": false + }, + "contract": { + "type": "object", + "title": "ContractConfig", + "properties": { + "enforced": { + "type": "boolean", + "default": false + }, + "alias_types": { + "type": "boolean", + "default": true + } + }, + "additionalProperties": false + } + }, + "additionalProperties": true + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": false, + "required": [ + "database", + "schema", + "alias", + "relation_name", + "resource_type", + "name", + "description", + "compiled_code", + "meta", + "tags", + "config" + ] + }, + { + "type": "null" + } + ], + "default": null }, - "depends_on": { - "type": "object", - "title": "DependsOn", - "properties": { - "macros": { + "primary_key": { + "anyOf": [ + { "type": "array", "items": { "type": "string" } }, - "nodes": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "additionalProperties": false - }, - "compiled_path": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null - }, - "compiled": { - "type": "boolean", - "default": false - }, - "compiled_code": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null - }, - "extra_ctes_injected": { - "type": "boolean", - "default": false - }, - "extra_ctes": { - "type": "array", - "items": { - "type": "object", - "title": "InjectedCTE", - "properties": { - "id": { - "type": "string" - }, - "sql": { - "type": "string" - } - }, - "additionalProperties": false, - "required": [ - "id", - "sql" - ] - } - }, - "_pre_injected_sql": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null - }, - "contract": { - "type": "object", - "title": "Contract", - "properties": { - "enforced": { - "type": "boolean", - "default": false - }, - "alias_types": { - "type": "boolean", - "default": true - }, - "checksum": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null - } - }, - "additionalProperties": false - }, - "column_name": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null - }, - "file_key_name": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null - }, - "attached_node": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" + { + "type": "null" } ], "default": null @@ -5279,7 +4404,6 @@ }, "additionalProperties": false, "required": [ - "test_metadata", "database", "schema", "name", @@ -5295,7 +4419,7 @@ }, { "type": "object", - "title": "SnapshotNode", + "title": "SqlOperation", "properties": { "database": { "anyOf": [ @@ -5314,7 +4438,7 @@ "type": "string" }, "resource_type": { - "const": "snapshot" + "const": "sql_operation" }, "package_name": { "type": "string" @@ -5356,7 +4480,7 @@ }, "config": { "type": "object", - "title": "SnapshotConfig", + "title": "NodeConfig", "properties": { "_extra": { "type": "object", @@ -5433,7 +4557,7 @@ }, "materialized": { "type": "string", - "default": "snapshot" + "default": "view" }, "incremental_strategy": { "anyOf": [ @@ -5542,6 +4666,12 @@ { "type": "string" }, + { + "type": "array", + "items": { + "type": "string" + } + }, { "type": "null" } @@ -5614,77 +4744,10 @@ } }, "additionalProperties": false - }, - "strategy": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null - }, - "target_schema": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null - }, - "target_database": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null - }, - "updated_at": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null - }, - "check_cols": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "type": "string" - } - }, - { - "type": "null" - } - ], - "default": null } }, "additionalProperties": true }, - "_event_status": { - "type": "object", - "propertyNames": { - "type": "string" - } - }, "tags": { "type": "array", "items": { @@ -5872,10 +4935,6 @@ ], "default": null }, - "deferred": { - "type": "boolean", - "default": false - }, "unrendered_config": { "type": "object", "propertyNames": { @@ -6074,53 +5133,6 @@ } }, "additionalProperties": false - }, - "defer_relation": { - "anyOf": [ - { - "type": "object", - "title": "DeferRelation", - "properties": { - "database": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "schema": { - "type": "string" - }, - "alias": { - "type": "string" - }, - "relation_name": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - } - }, - "additionalProperties": false, - "required": [ - "database", - "schema", - "alias", - "relation_name" - ] - }, - { - "type": "null" - } - ], - "default": null } }, "additionalProperties": false, @@ -6135,13 +5147,12 @@ "unique_id", "fqn", "alias", - "checksum", - "config" + "checksum" ] }, { "type": "object", - "title": "UnitTestNode", + "title": "GenericTest", "properties": { "database": { "anyOf": [ @@ -6160,7 +5171,7 @@ "type": "string" }, "resource_type": { - "const": "unit_test" + "const": "test" }, "package_name": { "type": "string" @@ -6202,7 +5213,7 @@ }, "config": { "type": "object", - "title": "UnitTestNodeConfig", + "title": "TestConfig", "properties": { "_extra": { "type": "object", @@ -6234,7 +5245,7 @@ "type": "null" } ], - "default": null + "default": "dbt_test__audit" }, "database": { "anyOf": [ @@ -6279,12 +5290,17 @@ }, "materialized": { "type": "string", - "default": "view" + "default": "test" }, - "incremental_strategy": { - "anyOf": [ - { - "type": "string" + "severity": { + "type": "string", + "default": "ERROR", + "pattern": "^([Ww][Aa][Rr][Nn]|[Ee][Rr][Rr][Oo][Rr])$" + }, + "store_failures": { + "anyOf": [ + { + "type": "boolean" }, { "type": "null" @@ -6292,90 +5308,10 @@ ], "default": null }, - "persist_docs": { - "type": "object", - "propertyNames": { - "type": "string" - } - }, - "post-hook": { - "type": "array", - "items": { - "type": "object", - "title": "Hook", - "properties": { - "sql": { - "type": "string" - }, - "transaction": { - "type": "boolean", - "default": true - }, - "index": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "default": null - } - }, - "additionalProperties": false, - "required": [ - "sql" - ] - } - }, - "pre-hook": { - "type": "array", - "items": { - "type": "object", - "title": "Hook", - "properties": { - "sql": { - "type": "string" - }, - "transaction": { - "type": "boolean", - "default": true - }, - "index": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "default": null - } - }, - "additionalProperties": false, - "required": [ - "sql" - ] - } - }, - "quoting": { - "type": "object", - "propertyNames": { - "type": "string" - } - }, - "column_types": { - "type": "object", - "propertyNames": { - "type": "string" - } - }, - "full_refresh": { + "store_failures_as": { "anyOf": [ { - "type": "boolean" + "type": "string" }, { "type": "null" @@ -6383,108 +5319,43 @@ ], "default": null }, - "unique_key": { + "where": { "anyOf": [ { "type": "string" }, - { - "type": "array", - "items": { - "type": "string" - } - }, { "type": "null" } ], "default": null }, - "on_schema_change": { + "limit": { "anyOf": [ { - "type": "string" + "type": "integer" }, { "type": "null" } ], - "default": "ignore" - }, - "on_configuration_change": { - "enum": [ - "apply", - "continue", - "fail" - ] - }, - "grants": { - "type": "object", - "propertyNames": { - "type": "string" - } - }, - "packages": { - "type": "array", - "items": { - "type": "string" - } + "default": null }, - "docs": { - "type": "object", - "title": "Docs", - "properties": { - "show": { - "type": "boolean", - "default": true - }, - "node_color": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null - } - }, - "additionalProperties": false + "fail_calc": { + "type": "string", + "default": "count(*)" }, - "contract": { - "type": "object", - "title": "ContractConfig", - "properties": { - "enforced": { - "type": "boolean", - "default": false - }, - "alias_types": { - "type": "boolean", - "default": true - } - }, - "additionalProperties": false + "warn_if": { + "type": "string", + "default": "!= 0" }, - "expected_rows": { - "type": "array", - "items": { - "type": "object", - "propertyNames": { - "type": "string" - } - } + "error_if": { + "type": "string", + "default": "!= 0" } }, "additionalProperties": true }, - "_event_status": { - "type": "object", - "propertyNames": { - "type": "string" - } - }, "tags": { "type": "array", "items": { @@ -6672,10 +5543,6 @@ ], "default": null }, - "deferred": { - "type": "boolean", - "default": false - }, "unrendered_config": { "type": "object", "propertyNames": { @@ -6875,7 +5742,7 @@ }, "additionalProperties": false }, - "tested_node_unique_id": { + "column_name": { "anyOf": [ { "type": "string" @@ -6886,7 +5753,7 @@ ], "default": null }, - "this_input_node_unique_id": { + "file_key_name": { "anyOf": [ { "type": "string" @@ -6897,38 +5764,44 @@ ], "default": null }, - "overrides": { + "attached_node": { "anyOf": [ { - "type": "object", - "title": "UnitTestOverrides", - "properties": { - "macros": { - "type": "object", - "propertyNames": { - "type": "string" - } - }, - "vars": { - "type": "object", - "propertyNames": { - "type": "string" - } - }, - "env_vars": { - "type": "object", - "propertyNames": { - "type": "string" - } - } - }, - "additionalProperties": false + "type": "string" }, { "type": "null" } ], "default": null + }, + "test_metadata": { + "type": "object", + "title": "TestMetadata", + "properties": { + "name": { + "type": "string", + "default": "test" + }, + "kwargs": { + "type": "object", + "propertyNames": { + "type": "string" + } + }, + "namespace": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + } + }, + "additionalProperties": false } }, "additionalProperties": false, @@ -6948,7 +5821,7 @@ }, { "type": "object", - "title": "SeedNode", + "title": "Snapshot", "properties": { "database": { "anyOf": [ @@ -6967,7 +5840,7 @@ "type": "string" }, "resource_type": { - "const": "seed" + "const": "snapshot" }, "package_name": { "type": "string" @@ -7009,7 +5882,7 @@ }, "config": { "type": "object", - "title": "SeedConfig", + "title": "SnapshotConfig", "properties": { "_extra": { "type": "object", @@ -7086,7 +5959,7 @@ }, "materialized": { "type": "string", - "default": "seed" + "default": "snapshot" }, "incremental_strategy": { "anyOf": [ @@ -7195,12 +6068,6 @@ { "type": "string" }, - { - "type": "array", - "items": { - "type": "string" - } - }, { "type": "null" } @@ -7274,14 +6141,60 @@ }, "additionalProperties": false }, - "delimiter": { - "type": "string", - "default": "," - }, - "quote_columns": { + "strategy": { "anyOf": [ { - "type": "boolean" + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "target_schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "target_database": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "updated_at": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "check_cols": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } }, { "type": "null" @@ -7292,12 +6205,6 @@ }, "additionalProperties": true }, - "_event_status": { - "type": "object", - "propertyNames": { - "type": "string" - } - }, "tags": { "type": "array", "items": { @@ -7485,10 +6392,6 @@ ], "default": null }, - "deferred": { - "type": "boolean", - "default": false - }, "unrendered_config": { "type": "object", "propertyNames": { @@ -7519,7 +6422,89 @@ "type": "string", "default": "" }, - "root_path": { + "language": { + "type": "string", + "default": "sql" + }, + "refs": { + "type": "array", + "items": { + "type": "object", + "title": "RefArgs", + "properties": { + "name": { + "type": "string" + }, + "package": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "version": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "number" + }, + { + "type": "null" + } + ], + "default": null + } + }, + "additionalProperties": false, + "required": [ + "name" + ] + } + }, + "sources": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "metrics": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "depends_on": { + "type": "object", + "title": "DependsOn", + "properties": { + "macros": { + "type": "array", + "items": { + "type": "string" + } + }, + "nodes": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false + }, + "compiled_path": { "anyOf": [ { "type": "string" @@ -7530,15 +6515,78 @@ ], "default": null }, - "depends_on": { - "type": "object", - "title": "MacroDependsOn", - "properties": { - "macros": { - "type": "array", - "items": { + "compiled": { + "type": "boolean", + "default": false + }, + "compiled_code": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "extra_ctes_injected": { + "type": "boolean", + "default": false + }, + "extra_ctes": { + "type": "array", + "items": { + "type": "object", + "title": "InjectedCTE", + "properties": { + "id": { + "type": "string" + }, + "sql": { "type": "string" } + }, + "additionalProperties": false, + "required": [ + "id", + "sql" + ] + } + }, + "_pre_injected_sql": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "contract": { + "type": "object", + "title": "Contract", + "properties": { + "enforced": { + "type": "boolean", + "default": false + }, + "alias_types": { + "type": "boolean", + "default": true + }, + "checksum": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null } }, "additionalProperties": false @@ -7574,438 +6622,36 @@ "type": "null" } ] - } - }, - "additionalProperties": false, - "required": [ - "database", - "schema", - "alias", - "relation_name" - ] - }, - { - "type": "null" - } - ], - "default": null - } - }, - "additionalProperties": false, - "required": [ - "database", - "schema", - "name", - "resource_type", - "package_name", - "path", - "original_file_path", - "unique_id", - "fqn", - "alias", - "checksum" - ] - } - ] - }, - "propertyNames": { - "type": "string" - } - }, - "sources": { - "type": "object", - "description": "The sources defined in the dbt project and its dependencies", - "additionalProperties": { - "type": "object", - "title": "SourceDefinition", - "properties": { - "database": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "schema": { - "type": "string" - }, - "name": { - "type": "string" - }, - "resource_type": { - "const": "source" - }, - "package_name": { - "type": "string" - }, - "path": { - "type": "string" - }, - "original_file_path": { - "type": "string" - }, - "unique_id": { - "type": "string" - }, - "fqn": { - "type": "array", - "items": { - "type": "string" - } - }, - "source_name": { - "type": "string" - }, - "source_description": { - "type": "string" - }, - "loader": { - "type": "string" - }, - "identifier": { - "type": "string" - }, - "_event_status": { - "type": "object", - "propertyNames": { - "type": "string" - } - }, - "quoting": { - "type": "object", - "title": "Quoting", - "properties": { - "database": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "null" - } - ], - "default": null - }, - "schema": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "null" - } - ], - "default": null - }, - "identifier": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "null" - } - ], - "default": null - }, - "column": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "null" - } - ], - "default": null - } - }, - "additionalProperties": false - }, - "loaded_at_field": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null - }, - "freshness": { - "anyOf": [ - { - "type": "object", - "title": "FreshnessThreshold", - "properties": { - "warn_after": { - "anyOf": [ - { - "type": "object", - "title": "Time", - "properties": { - "count": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "default": null - }, - "period": { - "anyOf": [ - { - "enum": [ - "minute", - "hour", - "day" - ] - }, - { - "type": "null" - } - ], - "default": null - } - }, - "additionalProperties": false - }, - { - "type": "null" - } - ] - }, - "error_after": { - "anyOf": [ - { - "type": "object", - "title": "Time", - "properties": { - "count": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "default": null - }, - "period": { - "anyOf": [ - { - "enum": [ - "minute", - "hour", - "day" - ] - }, - { - "type": "null" - } - ], - "default": null - } - }, - "additionalProperties": false }, - { - "type": "null" - } - ] - }, - "filter": { - "anyOf": [ - { - "type": "string" + "resource_type": { + "enum": [ + "model", + "analysis", + "test", + "snapshot", + "operation", + "seed", + "rpc", + "sql_operation", + "doc", + "source", + "macro", + "exposure", + "metric", + "group", + "saved_query", + "semantic_model", + "unit_test", + "fixture" + ] }, - { - "type": "null" - } - ], - "default": null - } - }, - "additionalProperties": false - }, - { - "type": "null" - } - ], - "default": null - }, - "external": { - "anyOf": [ - { - "type": "object", - "title": "ExternalTable", - "properties": { - "_extra": { - "type": "object", - "propertyNames": { - "type": "string" - } - }, - "location": { - "anyOf": [ - { + "name": { "type": "string" }, - { - "type": "null" - } - ], - "default": null - }, - "file_format": { - "anyOf": [ - { + "description": { "type": "string" }, - { - "type": "null" - } - ], - "default": null - }, - "row_format": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null - }, - "tbl_properties": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null - }, - "partitions": { - "anyOf": [ - { - "type": "array", - "items": { - "type": "string" - } - }, - { - "type": "array", - "items": { - "type": "object", - "title": "ExternalPartition", - "properties": { - "_extra": { - "type": "object", - "propertyNames": { - "type": "string" - } - }, - "name": { - "type": "string", - "default": "" - }, - "description": { - "type": "string", - "default": "" - }, - "data_type": { - "type": "string", - "default": "" - }, - "meta": { - "type": "object", - "propertyNames": { - "type": "string" - } - } - }, - "additionalProperties": true - } - }, - { - "type": "null" - } - ], - "default": null - } - }, - "additionalProperties": true - }, - { - "type": "null" - } - ], - "default": null - }, - "description": { - "type": "string", - "default": "" - }, - "columns": { - "type": "object", - "additionalProperties": { - "type": "object", - "title": "ColumnInfo", - "properties": { - "name": { - "type": "string" - }, - "description": { - "type": "string", - "default": "" - }, - "meta": { - "type": "object", - "propertyNames": { - "type": "string" - } - }, - "data_type": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null - }, - "constraints": { - "type": "array", - "items": { - "type": "object", - "title": "ColumnLevelConstraint", - "properties": { - "type": { - "enum": [ - "check", - "not_null", - "unique", - "primary_key", - "foreign_key", - "custom" - ] - }, - "name": { + "compiled_code": { "anyOf": [ { "type": "string" @@ -8013,1087 +6659,311 @@ { "type": "null" } - ], - "default": null + ] }, - "expression": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null + "meta": { + "type": "object", + "propertyNames": { + "type": "string" + } }, - "warn_unenforced": { - "type": "boolean", - "default": true + "tags": { + "type": "array", + "items": { + "type": "string" + } }, - "warn_unsupported": { - "type": "boolean", - "default": true - } - }, - "additionalProperties": false, - "required": [ - "type" - ] - } - }, - "quote": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "null" - } - ], - "default": null - }, - "tags": { - "type": "array", - "items": { - "type": "string" - } - }, - "_extra": { - "type": "object", - "propertyNames": { - "type": "string" - } - } - }, - "additionalProperties": true, - "required": [ - "name" - ] - }, - "propertyNames": { - "type": "string" - } - }, - "meta": { - "type": "object", - "propertyNames": { - "type": "string" - } - }, - "source_meta": { - "type": "object", - "propertyNames": { - "type": "string" - } - }, - "tags": { - "type": "array", - "items": { - "type": "string" - } - }, - "config": { - "type": "object", - "title": "SourceConfig", - "properties": { - "_extra": { - "type": "object", - "propertyNames": { - "type": "string" - } - }, - "enabled": { - "type": "boolean", - "default": true - } - }, - "additionalProperties": true - }, - "patch_path": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null - }, - "unrendered_config": { - "type": "object", - "propertyNames": { - "type": "string" - } - }, - "relation_name": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null - }, - "created_at": { - "type": "number" - } - }, - "additionalProperties": false, - "required": [ - "database", - "schema", - "name", - "resource_type", - "package_name", - "path", - "original_file_path", - "unique_id", - "fqn", - "source_name", - "source_description", - "loader", - "identifier" - ] - }, - "propertyNames": { - "type": "string" - } - }, - "macros": { - "type": "object", - "description": "The macros defined in the dbt project and its dependencies", - "additionalProperties": { - "type": "object", - "title": "Macro", - "properties": { - "name": { - "type": "string" - }, - "resource_type": { - "const": "macro" - }, - "package_name": { - "type": "string" - }, - "path": { - "type": "string" - }, - "original_file_path": { - "type": "string" - }, - "unique_id": { - "type": "string" - }, - "macro_sql": { - "type": "string" - }, - "depends_on": { - "type": "object", - "title": "MacroDependsOn", - "properties": { - "macros": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "additionalProperties": false - }, - "description": { - "type": "string", - "default": "" - }, - "meta": { - "type": "object", - "propertyNames": { - "type": "string" - } - }, - "docs": { - "type": "object", - "title": "Docs", - "properties": { - "show": { - "type": "boolean", - "default": true - }, - "node_color": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null - } - }, - "additionalProperties": false - }, - "patch_path": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null - }, - "arguments": { - "type": "array", - "items": { - "type": "object", - "title": "MacroArgument", - "properties": { - "name": { - "type": "string" - }, - "type": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null - }, - "description": { - "type": "string", - "default": "" - } - }, - "additionalProperties": false, - "required": [ - "name" - ] - } - }, - "created_at": { - "type": "number" - }, - "supported_languages": { - "anyOf": [ - { - "type": "array", - "items": { - "enum": [ - "python", - "sql" - ] - } - }, - { - "type": "null" - } - ], - "default": null - } - }, - "additionalProperties": false, - "required": [ - "name", - "resource_type", - "package_name", - "path", - "original_file_path", - "unique_id", - "macro_sql" - ] - }, - "propertyNames": { - "type": "string" - } - }, - "docs": { - "type": "object", - "description": "The docs defined in the dbt project and its dependencies", - "additionalProperties": { - "type": "object", - "title": "Documentation", - "properties": { - "name": { - "type": "string" - }, - "resource_type": { - "const": "doc" - }, - "package_name": { - "type": "string" - }, - "path": { - "type": "string" - }, - "original_file_path": { - "type": "string" - }, - "unique_id": { - "type": "string" - }, - "block_contents": { - "type": "string" - } - }, - "additionalProperties": false, - "required": [ - "name", - "resource_type", - "package_name", - "path", - "original_file_path", - "unique_id", - "block_contents" - ] - }, - "propertyNames": { - "type": "string" - } - }, - "exposures": { - "type": "object", - "description": "The exposures defined in the dbt project and its dependencies", - "additionalProperties": { - "type": "object", - "title": "Exposure", - "properties": { - "name": { - "type": "string" - }, - "resource_type": { - "const": "exposure" - }, - "package_name": { - "type": "string" - }, - "path": { - "type": "string" - }, - "original_file_path": { - "type": "string" - }, - "unique_id": { - "type": "string" - }, - "fqn": { - "type": "array", - "items": { - "type": "string" - } - }, - "type": { - "enum": [ - "dashboard", - "notebook", - "analysis", - "ml", - "application" - ] - }, - "owner": { - "type": "object", - "title": "Owner", - "properties": { - "_extra": { - "type": "object", - "propertyNames": { - "type": "string" - } - }, - "email": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null - }, - "name": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null - } - }, - "additionalProperties": true - }, - "description": { - "type": "string", - "default": "" - }, - "label": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null - }, - "maturity": { - "anyOf": [ - { - "enum": [ - "low", - "medium", - "high" - ] - }, - { - "type": "null" - } - ], - "default": null - }, - "meta": { - "type": "object", - "propertyNames": { - "type": "string" - } - }, - "tags": { - "type": "array", - "items": { - "type": "string" - } - }, - "config": { - "type": "object", - "title": "ExposureConfig", - "properties": { - "_extra": { - "type": "object", - "propertyNames": { - "type": "string" - } - }, - "enabled": { - "type": "boolean", - "default": true - } - }, - "additionalProperties": true - }, - "unrendered_config": { - "type": "object", - "propertyNames": { - "type": "string" - } - }, - "url": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null - }, - "depends_on": { - "type": "object", - "title": "DependsOn", - "properties": { - "macros": { - "type": "array", - "items": { - "type": "string" - } - }, - "nodes": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "additionalProperties": false - }, - "refs": { - "type": "array", - "items": { - "type": "object", - "title": "RefArgs", - "properties": { - "name": { - "type": "string" - }, - "package": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null - }, - "version": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "number" - }, - { - "type": "null" - } - ], - "default": null - } - }, - "additionalProperties": false, - "required": [ - "name" - ] - } - }, - "sources": { - "type": "array", - "items": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "metrics": { - "type": "array", - "items": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "created_at": { - "type": "number" - } - }, - "additionalProperties": false, - "required": [ - "name", - "resource_type", - "package_name", - "path", - "original_file_path", - "unique_id", - "fqn", - "type", - "owner" - ] - }, - "propertyNames": { - "type": "string" - } - }, - "metrics": { - "type": "object", - "description": "The metrics defined in the dbt project and its dependencies", - "additionalProperties": { - "type": "object", - "title": "Metric", - "properties": { - "name": { - "type": "string" - }, - "resource_type": { - "const": "metric" - }, - "package_name": { - "type": "string" - }, - "path": { - "type": "string" - }, - "original_file_path": { - "type": "string" - }, - "unique_id": { - "type": "string" - }, - "fqn": { - "type": "array", - "items": { - "type": "string" - } - }, - "description": { - "type": "string" - }, - "label": { - "type": "string" - }, - "type": { - "enum": [ - "simple", - "ratio", - "cumulative", - "derived", - "conversion" - ] - }, - "type_params": { - "type": "object", - "title": "MetricTypeParams", - "properties": { - "measure": { - "anyOf": [ - { - "type": "object", - "title": "MetricInputMeasure", - "properties": { - "name": { - "type": "string" - }, - "filter": { + "config": { "anyOf": [ { "type": "object", - "title": "WhereFilterIntersection", + "title": "NodeConfig", "properties": { - "where_filters": { - "type": "array", - "items": { - "type": "object", - "title": "WhereFilter", - "properties": { - "where_sql_template": { + "_extra": { + "type": "object", + "propertyNames": { + "type": "string" + } + }, + "enabled": { + "type": "boolean", + "default": true + }, + "alias": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "database": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "tags": { + "anyOf": [ + { + "type": "array", + "items": { "type": "string" } }, - "additionalProperties": false, - "required": [ - "where_sql_template" - ] - } - } - }, - "additionalProperties": false, - "required": [ - "where_filters" - ] - }, - { - "type": "null" - } - ], - "default": null - }, - "alias": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null - }, - "join_to_timespine": { - "type": "boolean", - "default": false - }, - "fill_nulls_with": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "default": null - } - }, - "additionalProperties": false, - "required": [ - "name" - ] - }, - { - "type": "null" - } - ], - "default": null - }, - "input_measures": { - "type": "array", - "items": { - "type": "object", - "title": "MetricInputMeasure", - "properties": { - "name": { - "type": "string" - }, - "filter": { - "anyOf": [ - { - "type": "object", - "title": "WhereFilterIntersection", - "properties": { - "where_filters": { - "type": "array", - "items": { - "type": "object", - "title": "WhereFilter", - "properties": { - "where_sql_template": { + { "type": "string" } - }, - "additionalProperties": false, - "required": [ - "where_sql_template" ] - } - } - }, - "additionalProperties": false, - "required": [ - "where_filters" - ] - }, - { - "type": "null" - } - ], - "default": null - }, - "alias": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null - }, - "join_to_timespine": { - "type": "boolean", - "default": false - }, - "fill_nulls_with": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "default": null - } - }, - "additionalProperties": false, - "required": [ - "name" - ] - } - }, - "numerator": { - "anyOf": [ - { - "type": "object", - "title": "MetricInput", - "properties": { - "name": { - "type": "string" - }, - "filter": { - "anyOf": [ - { - "type": "object", - "title": "WhereFilterIntersection", - "properties": { - "where_filters": { + }, + "meta": { + "type": "object", + "propertyNames": { + "type": "string" + } + }, + "group": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "materialized": { + "type": "string", + "default": "view" + }, + "incremental_strategy": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "persist_docs": { + "type": "object", + "propertyNames": { + "type": "string" + } + }, + "post-hook": { "type": "array", "items": { "type": "object", - "title": "WhereFilter", + "title": "Hook", "properties": { - "where_sql_template": { + "sql": { "type": "string" + }, + "transaction": { + "type": "boolean", + "default": true + }, + "index": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "default": null } }, "additionalProperties": false, "required": [ - "where_sql_template" + "sql" ] } - } - }, - "additionalProperties": false, - "required": [ - "where_filters" - ] - }, - { - "type": "null" - } - ], - "default": null - }, - "alias": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null - }, - "offset_window": { - "anyOf": [ - { - "type": "object", - "title": "MetricTimeWindow", - "properties": { - "count": { - "type": "integer" }, - "granularity": { - "enum": [ - "day", - "week", - "month", - "quarter", - "year" - ] - } - }, - "additionalProperties": false, - "required": [ - "count", - "granularity" - ] - }, - { - "type": "null" - } - ], - "default": null - }, - "offset_to_grain": { - "anyOf": [ - { - "enum": [ - "day", - "week", - "month", - "quarter", - "year" - ] - }, - { - "type": "null" - } - ], - "default": null - } - }, - "additionalProperties": false, - "required": [ - "name" - ] - }, - { - "type": "null" - } - ], - "default": null - }, - "denominator": { - "anyOf": [ - { - "type": "object", - "title": "MetricInput", - "properties": { - "name": { - "type": "string" - }, - "filter": { - "anyOf": [ - { - "type": "object", - "title": "WhereFilterIntersection", - "properties": { - "where_filters": { + "pre-hook": { "type": "array", "items": { "type": "object", - "title": "WhereFilter", + "title": "Hook", "properties": { - "where_sql_template": { + "sql": { "type": "string" + }, + "transaction": { + "type": "boolean", + "default": true + }, + "index": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "default": null } }, "additionalProperties": false, "required": [ - "where_sql_template" + "sql" ] } - } - }, - "additionalProperties": false, - "required": [ - "where_filters" - ] - }, - { - "type": "null" - } - ], - "default": null - }, - "alias": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null - }, - "offset_window": { - "anyOf": [ - { - "type": "object", - "title": "MetricTimeWindow", - "properties": { - "count": { - "type": "integer" }, - "granularity": { + "quoting": { + "type": "object", + "propertyNames": { + "type": "string" + } + }, + "column_types": { + "type": "object", + "propertyNames": { + "type": "string" + } + }, + "full_refresh": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "default": null + }, + "unique_key": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + }, + { + "type": "null" + } + ], + "default": null + }, + "on_schema_change": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": "ignore" + }, + "on_configuration_change": { "enum": [ - "day", - "week", - "month", - "quarter", - "year" + "apply", + "continue", + "fail" ] - } - }, - "additionalProperties": false, - "required": [ - "count", - "granularity" - ] - }, - { - "type": "null" - } - ], - "default": null - }, - "offset_to_grain": { - "anyOf": [ - { - "enum": [ - "day", - "week", - "month", - "quarter", - "year" - ] + }, + "grants": { + "type": "object", + "propertyNames": { + "type": "string" + } + }, + "packages": { + "type": "array", + "items": { + "type": "string" + } + }, + "docs": { + "type": "object", + "title": "Docs", + "properties": { + "show": { + "type": "boolean", + "default": true + }, + "node_color": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + } + }, + "additionalProperties": false + }, + "contract": { + "type": "object", + "title": "ContractConfig", + "properties": { + "enforced": { + "type": "boolean", + "default": false + }, + "alias_types": { + "type": "boolean", + "default": true + } + }, + "additionalProperties": false + } + }, + "additionalProperties": true }, { "type": "null" } - ], - "default": null - } - }, - "additionalProperties": false, - "required": [ - "name" - ] - }, - { - "type": "null" - } - ], - "default": null - }, - "expr": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null - }, - "window": { - "anyOf": [ - { - "type": "object", - "title": "MetricTimeWindow", - "properties": { - "count": { - "type": "integer" - }, - "granularity": { - "enum": [ - "day", - "week", - "month", - "quarter", - "year" ] } }, "additionalProperties": false, "required": [ - "count", - "granularity" - ] - }, - { - "type": "null" - } - ], - "default": null - }, - "grain_to_date": { - "anyOf": [ - { - "enum": [ - "day", - "week", - "month", - "quarter", - "year" + "database", + "schema", + "alias", + "relation_name", + "resource_type", + "name", + "description", + "compiled_code", + "meta", + "tags", + "config" ] }, { @@ -9101,117 +6971,94 @@ } ], "default": null + } + }, + "additionalProperties": false, + "required": [ + "database", + "schema", + "name", + "resource_type", + "package_name", + "path", + "original_file_path", + "unique_id", + "fqn", + "alias", + "checksum", + "config" + ] + } + ] + }, + "propertyNames": { + "type": "string" + } + }, + "sources": { + "type": "object", + "description": "The sources defined in the dbt project and its dependencies", + "additionalProperties": { + "type": "object", + "title": "SourceDefinition", + "properties": { + "database": { + "anyOf": [ + { + "type": "string" }, - "metrics": { - "anyOf": [ - { - "type": "array", - "items": { - "type": "object", - "title": "MetricInput", - "properties": { - "name": { - "type": "string" - }, - "filter": { - "anyOf": [ - { - "type": "object", - "title": "WhereFilterIntersection", - "properties": { - "where_filters": { - "type": "array", - "items": { - "type": "object", - "title": "WhereFilter", - "properties": { - "where_sql_template": { - "type": "string" - } - }, - "additionalProperties": false, - "required": [ - "where_sql_template" - ] - } - } - }, - "additionalProperties": false, - "required": [ - "where_filters" - ] - }, - { - "type": "null" - } - ], - "default": null - }, - "alias": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null - }, - "offset_window": { - "anyOf": [ - { - "type": "object", - "title": "MetricTimeWindow", - "properties": { - "count": { - "type": "integer" - }, - "granularity": { - "enum": [ - "day", - "week", - "month", - "quarter", - "year" - ] - } - }, - "additionalProperties": false, - "required": [ - "count", - "granularity" - ] - }, - { - "type": "null" - } - ], - "default": null - }, - "offset_to_grain": { - "anyOf": [ - { - "enum": [ - "day", - "week", - "month", - "quarter", - "year" - ] - }, - { - "type": "null" - } - ], - "default": null - } - }, - "additionalProperties": false, - "required": [ - "name" - ] - } + { + "type": "null" + } + ] + }, + "schema": { + "type": "string" + }, + "name": { + "type": "string" + }, + "resource_type": { + "const": "source" + }, + "package_name": { + "type": "string" + }, + "path": { + "type": "string" + }, + "original_file_path": { + "type": "string" + }, + "unique_id": { + "type": "string" + }, + "fqn": { + "type": "array", + "items": { + "type": "string" + } + }, + "source_name": { + "type": "string" + }, + "source_description": { + "type": "string" + }, + "loader": { + "type": "string" + }, + "identifier": { + "type": "string" + }, + "quoting": { + "type": "object", + "title": "Quoting", + "properties": { + "database": { + "anyOf": [ + { + "type": "boolean" }, { "type": "null" @@ -9219,46 +7066,69 @@ ], "default": null }, - "conversion_type_params": { + "schema": { "anyOf": [ { - "type": "object", - "title": "ConversionTypeParams", - "properties": { - "base_measure": { + "type": "boolean" + }, + { + "type": "null" + } + ], + "default": null + }, + "identifier": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "default": null + }, + "column": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "default": null + } + }, + "additionalProperties": false + }, + "loaded_at_field": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "freshness": { + "anyOf": [ + { + "type": "object", + "title": "FreshnessThreshold", + "properties": { + "warn_after": { + "anyOf": [ + { "type": "object", - "title": "MetricInputMeasure", + "title": "Time", "properties": { - "name": { - "type": "string" - }, - "filter": { + "count": { "anyOf": [ { - "type": "object", - "title": "WhereFilterIntersection", - "properties": { - "where_filters": { - "type": "array", - "items": { - "type": "object", - "title": "WhereFilter", - "properties": { - "where_sql_template": { - "type": "string" - } - }, - "additionalProperties": false, - "required": [ - "where_sql_template" - ] - } - } - }, - "additionalProperties": false, - "required": [ - "where_filters" - ] + "type": "integer" }, { "type": "null" @@ -9266,22 +7136,36 @@ ], "default": null }, - "alias": { + "period": { "anyOf": [ { - "type": "string" + "enum": [ + "minute", + "hour", + "day" + ] }, { "type": "null" } ], "default": null - }, - "join_to_timespine": { - "type": "boolean", - "default": false - }, - "fill_nulls_with": { + } + }, + "additionalProperties": false + }, + { + "type": "null" + } + ] + }, + "error_after": { + "anyOf": [ + { + "type": "object", + "title": "Time", + "properties": { + "count": { "anyOf": [ { "type": "integer" @@ -9291,120 +7175,217 @@ } ], "default": null - } - }, - "additionalProperties": false, - "required": [ - "name" - ] - }, - "conversion_measure": { - "type": "object", - "title": "MetricInputMeasure", - "properties": { - "name": { - "type": "string" }, - "filter": { + "period": { "anyOf": [ { - "type": "object", - "title": "WhereFilterIntersection", - "properties": { - "where_filters": { - "type": "array", - "items": { - "type": "object", - "title": "WhereFilter", - "properties": { - "where_sql_template": { - "type": "string" - } - }, - "additionalProperties": false, - "required": [ - "where_sql_template" - ] - } - } - }, - "additionalProperties": false, - "required": [ - "where_filters" + "enum": [ + "minute", + "hour", + "day" ] }, { "type": "null" } - ], - "default": null - }, - "alias": { - "anyOf": [ - { + ], + "default": null + } + }, + "additionalProperties": false + }, + { + "type": "null" + } + ] + }, + "filter": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + } + }, + "additionalProperties": false + }, + { + "type": "null" + } + ], + "default": null + }, + "external": { + "anyOf": [ + { + "type": "object", + "title": "ExternalTable", + "properties": { + "_extra": { + "type": "object", + "propertyNames": { + "type": "string" + } + }, + "location": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "file_format": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "row_format": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "tbl_properties": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "partitions": { + "anyOf": [ + { + "type": "array", + "items": { + "type": "string" + } + }, + { + "type": "array", + "items": { + "type": "object", + "title": "ExternalPartition", + "properties": { + "_extra": { + "type": "object", + "propertyNames": { + "type": "string" + } + }, + "name": { + "type": "string", + "default": "" + }, + "description": { + "type": "string", + "default": "" + }, + "data_type": { + "type": "string", + "default": "" + }, + "meta": { + "type": "object", + "propertyNames": { "type": "string" - }, - { - "type": "null" } - ], - "default": null - }, - "join_to_timespine": { - "type": "boolean", - "default": false + } }, - "fill_nulls_with": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "default": null - } - }, - "additionalProperties": false, - "required": [ - "name" - ] - }, - "entity": { - "type": "string" + "additionalProperties": true + } }, - "calculation": { + { + "type": "null" + } + ], + "default": null + } + }, + "additionalProperties": true + }, + { + "type": "null" + } + ], + "default": null + }, + "description": { + "type": "string", + "default": "" + }, + "columns": { + "type": "object", + "additionalProperties": { + "type": "object", + "title": "ColumnInfo", + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": "string", + "default": "" + }, + "meta": { + "type": "object", + "propertyNames": { + "type": "string" + } + }, + "data_type": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "constraints": { + "type": "array", + "items": { + "type": "object", + "title": "ColumnLevelConstraint", + "properties": { + "type": { "enum": [ - "conversions", - "conversion_rate" - ], - "default": "conversion_rate" + "check", + "not_null", + "unique", + "primary_key", + "foreign_key", + "custom" + ] }, - "window": { + "name": { "anyOf": [ { - "type": "object", - "title": "MetricTimeWindow", - "properties": { - "count": { - "type": "integer" - }, - "granularity": { - "enum": [ - "day", - "week", - "month", - "quarter", - "year" - ] - } - }, - "additionalProperties": false, - "required": [ - "count", - "granularity" - ] + "type": "string" }, { "type": "null" @@ -9412,41 +7393,413 @@ ], "default": null }, - "constant_properties": { + "expression": { "anyOf": [ { - "type": "array", - "items": { - "type": "object", - "title": "ConstantPropertyInput", - "properties": { - "base_property": { - "type": "string" - }, - "conversion_property": { - "type": "string" - } - }, - "additionalProperties": false, - "required": [ - "base_property", - "conversion_property" - ] - } + "type": "string" }, { "type": "null" } ], "default": null + }, + "warn_unenforced": { + "type": "boolean", + "default": true + }, + "warn_unsupported": { + "type": "boolean", + "default": true } }, - "additionalProperties": false, - "required": [ - "base_measure", - "conversion_measure", - "entity" - ] + "additionalProperties": false, + "required": [ + "type" + ] + } + }, + "quote": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "default": null + }, + "tags": { + "type": "array", + "items": { + "type": "string" + } + }, + "_extra": { + "type": "object", + "propertyNames": { + "type": "string" + } + } + }, + "additionalProperties": true, + "required": [ + "name" + ] + }, + "propertyNames": { + "type": "string" + } + }, + "meta": { + "type": "object", + "propertyNames": { + "type": "string" + } + }, + "source_meta": { + "type": "object", + "propertyNames": { + "type": "string" + } + }, + "tags": { + "type": "array", + "items": { + "type": "string" + } + }, + "config": { + "type": "object", + "title": "SourceConfig", + "properties": { + "_extra": { + "type": "object", + "propertyNames": { + "type": "string" + } + }, + "enabled": { + "type": "boolean", + "default": true + } + }, + "additionalProperties": true + }, + "patch_path": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "unrendered_config": { + "type": "object", + "propertyNames": { + "type": "string" + } + }, + "relation_name": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "created_at": { + "type": "number" + } + }, + "additionalProperties": false, + "required": [ + "database", + "schema", + "name", + "resource_type", + "package_name", + "path", + "original_file_path", + "unique_id", + "fqn", + "source_name", + "source_description", + "loader", + "identifier" + ] + }, + "propertyNames": { + "type": "string" + } + }, + "macros": { + "type": "object", + "description": "The macros defined in the dbt project and its dependencies", + "additionalProperties": { + "type": "object", + "title": "Macro", + "properties": { + "name": { + "type": "string" + }, + "resource_type": { + "const": "macro" + }, + "package_name": { + "type": "string" + }, + "path": { + "type": "string" + }, + "original_file_path": { + "type": "string" + }, + "unique_id": { + "type": "string" + }, + "macro_sql": { + "type": "string" + }, + "depends_on": { + "type": "object", + "title": "MacroDependsOn", + "properties": { + "macros": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false + }, + "description": { + "type": "string", + "default": "" + }, + "meta": { + "type": "object", + "propertyNames": { + "type": "string" + } + }, + "docs": { + "type": "object", + "title": "Docs", + "properties": { + "show": { + "type": "boolean", + "default": true + }, + "node_color": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + } + }, + "additionalProperties": false + }, + "patch_path": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "arguments": { + "type": "array", + "items": { + "type": "object", + "title": "MacroArgument", + "properties": { + "name": { + "type": "string" + }, + "type": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "description": { + "type": "string", + "default": "" + } + }, + "additionalProperties": false, + "required": [ + "name" + ] + } + }, + "created_at": { + "type": "number" + }, + "supported_languages": { + "anyOf": [ + { + "type": "array", + "items": { + "enum": [ + "python", + "sql" + ] + } + }, + { + "type": "null" + } + ], + "default": null + } + }, + "additionalProperties": false, + "required": [ + "name", + "resource_type", + "package_name", + "path", + "original_file_path", + "unique_id", + "macro_sql" + ] + }, + "propertyNames": { + "type": "string" + } + }, + "docs": { + "type": "object", + "description": "The docs defined in the dbt project and its dependencies", + "additionalProperties": { + "type": "object", + "title": "Documentation", + "properties": { + "name": { + "type": "string" + }, + "resource_type": { + "const": "doc" + }, + "package_name": { + "type": "string" + }, + "path": { + "type": "string" + }, + "original_file_path": { + "type": "string" + }, + "unique_id": { + "type": "string" + }, + "block_contents": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "name", + "resource_type", + "package_name", + "path", + "original_file_path", + "unique_id", + "block_contents" + ] + }, + "propertyNames": { + "type": "string" + } + }, + "exposures": { + "type": "object", + "description": "The exposures defined in the dbt project and its dependencies", + "additionalProperties": { + "type": "object", + "title": "Exposure", + "properties": { + "name": { + "type": "string" + }, + "resource_type": { + "const": "exposure" + }, + "package_name": { + "type": "string" + }, + "path": { + "type": "string" + }, + "original_file_path": { + "type": "string" + }, + "unique_id": { + "type": "string" + }, + "fqn": { + "type": "array", + "items": { + "type": "string" + } + }, + "type": { + "enum": [ + "dashboard", + "notebook", + "analysis", + "ml", + "application" + ] + }, + "owner": { + "type": "object", + "title": "Owner", + "properties": { + "_extra": { + "type": "object", + "propertyNames": { + "type": "string" + } + }, + "email": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "name": { + "anyOf": [ + { + "type": "string" }, { "type": "null" @@ -9455,35 +7808,16 @@ "default": null } }, - "additionalProperties": false + "additionalProperties": true }, - "filter": { + "description": { + "type": "string", + "default": "" + }, + "label": { "anyOf": [ { - "type": "object", - "title": "WhereFilterIntersection", - "properties": { - "where_filters": { - "type": "array", - "items": { - "type": "object", - "title": "WhereFilter", - "properties": { - "where_sql_template": { - "type": "string" - } - }, - "additionalProperties": false, - "required": [ - "where_sql_template" - ] - } - } - }, - "additionalProperties": false, - "required": [ - "where_filters" - ] + "type": "string" }, { "type": "null" @@ -9491,45 +7825,13 @@ ], "default": null }, - "metadata": { + "maturity": { "anyOf": [ { - "type": "object", - "title": "SourceFileMetadata", - "properties": { - "repo_file_path": { - "type": "string" - }, - "file_slice": { - "type": "object", - "title": "FileSlice", - "properties": { - "filename": { - "type": "string" - }, - "content": { - "type": "string" - }, - "start_line_number": { - "type": "integer" - }, - "end_line_number": { - "type": "integer" - } - }, - "additionalProperties": false, - "required": [ - "filename", - "content", - "start_line_number", - "end_line_number" - ] - } - }, - "additionalProperties": false, - "required": [ - "repo_file_path", - "file_slice" + "enum": [ + "low", + "medium", + "high" ] }, { @@ -9552,7 +7854,7 @@ }, "config": { "type": "object", - "title": "MetricConfig", + "title": "ExposureConfig", "properties": { "_extra": { "type": "object", @@ -9563,17 +7865,6 @@ "enabled": { "type": "boolean", "default": true - }, - "group": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null } }, "additionalProperties": true @@ -9584,14 +7875,16 @@ "type": "string" } }, - "sources": { - "type": "array", - "items": { - "type": "array", - "items": { + "url": { + "anyOf": [ + { "type": "string" + }, + { + "type": "null" } - } + ], + "default": null }, "depends_on": { "type": "object", @@ -9653,6 +7946,15 @@ ] } }, + "sources": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "string" + } + } + }, "metrics": { "type": "array", "items": { @@ -9664,17 +7966,6 @@ }, "created_at": { "type": "number" - }, - "group": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null } }, "additionalProperties": false, @@ -9686,28 +7977,26 @@ "original_file_path", "unique_id", "fqn", - "description", - "label", "type", - "type_params" + "owner" ] }, "propertyNames": { "type": "string" } }, - "groups": { + "metrics": { "type": "object", - "description": "The groups defined in the dbt project", + "description": "The metrics defined in the dbt project and its dependencies", "additionalProperties": { "type": "object", - "title": "Group", + "title": "Metric", "properties": { "name": { "type": "string" }, "resource_type": { - "const": "group" + "const": "metric" }, "package_name": { "type": "string" @@ -9721,20 +8010,105 @@ "unique_id": { "type": "string" }, - "owner": { + "fqn": { + "type": "array", + "items": { + "type": "string" + } + }, + "description": { + "type": "string" + }, + "label": { + "type": "string" + }, + "type": { + "enum": [ + "simple", + "ratio", + "cumulative", + "derived", + "conversion" + ] + }, + "type_params": { "type": "object", - "title": "Owner", - "properties": { - "_extra": { - "type": "object", - "propertyNames": { - "type": "string" - } - }, - "email": { + "title": "MetricTypeParams", + "properties": { + "measure": { "anyOf": [ { - "type": "string" + "type": "object", + "title": "MetricInputMeasure", + "properties": { + "name": { + "type": "string" + }, + "filter": { + "anyOf": [ + { + "type": "object", + "title": "WhereFilterIntersection", + "properties": { + "where_filters": { + "type": "array", + "items": { + "type": "object", + "title": "WhereFilter", + "properties": { + "where_sql_template": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "where_sql_template" + ] + } + } + }, + "additionalProperties": false, + "required": [ + "where_filters" + ] + }, + { + "type": "null" + } + ], + "default": null + }, + "alias": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "join_to_timespine": { + "type": "boolean", + "default": false + }, + "fill_nulls_with": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "default": null + } + }, + "additionalProperties": false, + "required": [ + "name" + ] }, { "type": "null" @@ -9742,289 +8116,407 @@ ], "default": null }, - "name": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null - } - }, - "additionalProperties": true - } - }, - "additionalProperties": false, - "required": [ - "name", - "resource_type", - "package_name", - "path", - "original_file_path", - "unique_id", - "owner" - ] - }, - "propertyNames": { - "type": "string" - } - }, - "selectors": { - "type": "object", - "description": "The selectors defined in selectors.yml", - "propertyNames": { - "type": "string" - } - }, - "disabled": { - "description": "A mapping of the disabled nodes in the target", - "anyOf": [ - { - "type": "object", - "additionalProperties": { - "type": "array", - "items": { - "anyOf": [ - { + "input_measures": { + "type": "array", + "items": { "type": "object", - "title": "AnalysisNode", + "title": "MetricInputMeasure", "properties": { - "database": { + "name": { + "type": "string" + }, + "filter": { "anyOf": [ { - "type": "string" + "type": "object", + "title": "WhereFilterIntersection", + "properties": { + "where_filters": { + "type": "array", + "items": { + "type": "object", + "title": "WhereFilter", + "properties": { + "where_sql_template": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "where_sql_template" + ] + } + } + }, + "additionalProperties": false, + "required": [ + "where_filters" + ] }, { "type": "null" } - ] - }, - "schema": { - "type": "string" - }, - "name": { - "type": "string" - }, - "resource_type": { - "const": "analysis" - }, - "package_name": { - "type": "string" - }, - "path": { - "type": "string" - }, - "original_file_path": { - "type": "string" - }, - "unique_id": { - "type": "string" - }, - "fqn": { - "type": "array", - "items": { - "type": "string" - } + ], + "default": null }, "alias": { - "type": "string" - }, - "checksum": { - "type": "object", - "title": "FileHash", - "properties": { - "name": { + "anyOf": [ + { "type": "string" }, - "checksum": { - "type": "string" + { + "type": "null" } - }, - "additionalProperties": false, - "required": [ - "name", - "checksum" - ] + ], + "default": null }, - "config": { - "type": "object", - "title": "NodeConfig", - "properties": { - "_extra": { - "type": "object", - "propertyNames": { - "type": "string" - } - }, - "enabled": { - "type": "boolean", - "default": true - }, - "alias": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null - }, - "schema": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null - }, - "database": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null + "join_to_timespine": { + "type": "boolean", + "default": false + }, + "fill_nulls_with": { + "anyOf": [ + { + "type": "integer" }, - "tags": { - "anyOf": [ - { - "type": "array", - "items": { - "type": "string" + { + "type": "null" + } + ], + "default": null + } + }, + "additionalProperties": false, + "required": [ + "name" + ] + } + }, + "numerator": { + "anyOf": [ + { + "type": "object", + "title": "MetricInput", + "properties": { + "name": { + "type": "string" + }, + "filter": { + "anyOf": [ + { + "type": "object", + "title": "WhereFilterIntersection", + "properties": { + "where_filters": { + "type": "array", + "items": { + "type": "object", + "title": "WhereFilter", + "properties": { + "where_sql_template": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "where_sql_template" + ] + } } }, - { - "type": "string" - } - ] - }, - "meta": { - "type": "object", - "propertyNames": { - "type": "string" + "additionalProperties": false, + "required": [ + "where_filters" + ] + }, + { + "type": "null" } - }, - "group": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null - }, - "materialized": { - "type": "string", - "default": "view" - }, - "incremental_strategy": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null - }, - "persist_docs": { - "type": "object", - "propertyNames": { + ], + "default": null + }, + "alias": { + "anyOf": [ + { "type": "string" + }, + { + "type": "null" } - }, - "post-hook": { - "type": "array", - "items": { + ], + "default": null + }, + "offset_window": { + "anyOf": [ + { "type": "object", - "title": "Hook", + "title": "MetricTimeWindow", "properties": { - "sql": { - "type": "string" - }, - "transaction": { - "type": "boolean", - "default": true + "count": { + "type": "integer" }, - "index": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "default": null + "granularity": { + "enum": [ + "day", + "week", + "month", + "quarter", + "year" + ] } }, "additionalProperties": false, "required": [ - "sql" + "count", + "granularity" ] + }, + { + "type": "null" } - }, - "pre-hook": { - "type": "array", - "items": { + ], + "default": null + }, + "offset_to_grain": { + "anyOf": [ + { + "enum": [ + "day", + "week", + "month", + "quarter", + "year" + ] + }, + { + "type": "null" + } + ], + "default": null + } + }, + "additionalProperties": false, + "required": [ + "name" + ] + }, + { + "type": "null" + } + ], + "default": null + }, + "denominator": { + "anyOf": [ + { + "type": "object", + "title": "MetricInput", + "properties": { + "name": { + "type": "string" + }, + "filter": { + "anyOf": [ + { "type": "object", - "title": "Hook", + "title": "WhereFilterIntersection", "properties": { - "sql": { - "type": "string" - }, - "transaction": { - "type": "boolean", - "default": true - }, - "index": { - "anyOf": [ - { - "type": "integer" + "where_filters": { + "type": "array", + "items": { + "type": "object", + "title": "WhereFilter", + "properties": { + "where_sql_template": { + "type": "string" + } }, - { - "type": "null" - } - ], - "default": null + "additionalProperties": false, + "required": [ + "where_sql_template" + ] + } + } + }, + "additionalProperties": false, + "required": [ + "where_filters" + ] + }, + { + "type": "null" + } + ], + "default": null + }, + "alias": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "offset_window": { + "anyOf": [ + { + "type": "object", + "title": "MetricTimeWindow", + "properties": { + "count": { + "type": "integer" + }, + "granularity": { + "enum": [ + "day", + "week", + "month", + "quarter", + "year" + ] } }, "additionalProperties": false, "required": [ - "sql" + "count", + "granularity" ] + }, + { + "type": "null" } - }, - "quoting": { - "type": "object", - "propertyNames": { - "type": "string" - } - }, - "column_types": { - "type": "object", - "propertyNames": { - "type": "string" + ], + "default": null + }, + "offset_to_grain": { + "anyOf": [ + { + "enum": [ + "day", + "week", + "month", + "quarter", + "year" + ] + }, + { + "type": "null" } + ], + "default": null + } + }, + "additionalProperties": false, + "required": [ + "name" + ] + }, + { + "type": "null" + } + ], + "default": null + }, + "expr": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "window": { + "anyOf": [ + { + "type": "object", + "title": "MetricTimeWindow", + "properties": { + "count": { + "type": "integer" + }, + "granularity": { + "enum": [ + "day", + "week", + "month", + "quarter", + "year" + ] + } + }, + "additionalProperties": false, + "required": [ + "count", + "granularity" + ] + }, + { + "type": "null" + } + ], + "default": null + }, + "grain_to_date": { + "anyOf": [ + { + "enum": [ + "day", + "week", + "month", + "quarter", + "year" + ] + }, + { + "type": "null" + } + ], + "default": null + }, + "metrics": { + "anyOf": [ + { + "type": "array", + "items": { + "type": "object", + "title": "MetricInput", + "properties": { + "name": { + "type": "string" }, - "full_refresh": { + "filter": { "anyOf": [ { - "type": "boolean" + "type": "object", + "title": "WhereFilterIntersection", + "properties": { + "where_filters": { + "type": "array", + "items": { + "type": "object", + "title": "WhereFilter", + "properties": { + "where_sql_template": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "where_sql_template" + ] + } + } + }, + "additionalProperties": false, + "required": [ + "where_filters" + ] }, { "type": "null" @@ -10032,132 +8524,118 @@ ], "default": null }, - "unique_key": { + "alias": { "anyOf": [ { "type": "string" }, - { - "type": "array", - "items": { - "type": "string" - } - }, { "type": "null" } ], "default": null }, - "on_schema_change": { + "offset_window": { "anyOf": [ { - "type": "string" + "type": "object", + "title": "MetricTimeWindow", + "properties": { + "count": { + "type": "integer" + }, + "granularity": { + "enum": [ + "day", + "week", + "month", + "quarter", + "year" + ] + } + }, + "additionalProperties": false, + "required": [ + "count", + "granularity" + ] }, { "type": "null" } ], - "default": "ignore" - }, - "on_configuration_change": { - "enum": [ - "apply", - "continue", - "fail" - ] - }, - "grants": { - "type": "object", - "propertyNames": { - "type": "string" - } - }, - "packages": { - "type": "array", - "items": { - "type": "string" - } - }, - "docs": { - "type": "object", - "title": "Docs", - "properties": { - "show": { - "type": "boolean", - "default": true - }, - "node_color": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null - } - }, - "additionalProperties": false + "default": null }, - "contract": { - "type": "object", - "title": "ContractConfig", - "properties": { - "enforced": { - "type": "boolean", - "default": false + "offset_to_grain": { + "anyOf": [ + { + "enum": [ + "day", + "week", + "month", + "quarter", + "year" + ] }, - "alias_types": { - "type": "boolean", - "default": true + { + "type": "null" } - }, - "additionalProperties": false + ], + "default": null } }, - "additionalProperties": true - }, - "_event_status": { - "type": "object", - "propertyNames": { - "type": "string" - } - }, - "tags": { - "type": "array", - "items": { - "type": "string" - } - }, - "description": { - "type": "string", - "default": "" - }, - "columns": { - "type": "object", - "additionalProperties": { + "additionalProperties": false, + "required": [ + "name" + ] + } + }, + { + "type": "null" + } + ], + "default": null + }, + "conversion_type_params": { + "anyOf": [ + { + "type": "object", + "title": "ConversionTypeParams", + "properties": { + "base_measure": { "type": "object", - "title": "ColumnInfo", + "title": "MetricInputMeasure", "properties": { "name": { "type": "string" }, - "description": { - "type": "string", - "default": "" - }, - "meta": { - "type": "object", - "propertyNames": { - "type": "string" - } - }, - "data_type": { + "filter": { "anyOf": [ { - "type": "string" + "type": "object", + "title": "WhereFilterIntersection", + "properties": { + "where_filters": { + "type": "array", + "items": { + "type": "object", + "title": "WhereFilter", + "properties": { + "where_sql_template": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "where_sql_template" + ] + } + } + }, + "additionalProperties": false, + "required": [ + "where_filters" + ] }, { "type": "null" @@ -10165,63 +8643,10 @@ ], "default": null }, - "constraints": { - "type": "array", - "items": { - "type": "object", - "title": "ColumnLevelConstraint", - "properties": { - "type": { - "enum": [ - "check", - "not_null", - "unique", - "primary_key", - "foreign_key", - "custom" - ] - }, - "name": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null - }, - "expression": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null - }, - "warn_unenforced": { - "type": "boolean", - "default": true - }, - "warn_unsupported": { - "type": "boolean", - "default": true - } - }, - "additionalProperties": false, - "required": [ - "type" - ] - } - }, - "quote": { + "alias": { "anyOf": [ { - "type": "boolean" + "type": "string" }, { "type": "null" @@ -10229,140 +8654,61 @@ ], "default": null }, - "tags": { - "type": "array", - "items": { - "type": "string" - } + "join_to_timespine": { + "type": "boolean", + "default": false }, - "_extra": { - "type": "object", - "propertyNames": { - "type": "string" - } - } - }, - "additionalProperties": true, - "required": [ - "name" - ] - }, - "propertyNames": { - "type": "string" - } - }, - "meta": { - "type": "object", - "propertyNames": { - "type": "string" - } - }, - "group": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null - }, - "docs": { - "type": "object", - "title": "Docs", - "properties": { - "show": { - "type": "boolean", - "default": true - }, - "node_color": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null - } - }, - "additionalProperties": false - }, - "patch_path": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null - }, - "build_path": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null - }, - "deferred": { - "type": "boolean", - "default": false - }, - "unrendered_config": { - "type": "object", - "propertyNames": { - "type": "string" - } - }, - "created_at": { - "type": "number" - }, - "config_call_dict": { - "type": "object", - "propertyNames": { - "type": "string" - } - }, - "relation_name": { - "anyOf": [ - { - "type": "string" + "fill_nulls_with": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "default": null + } }, - { - "type": "null" - } - ], - "default": null - }, - "raw_code": { - "type": "string", - "default": "" - }, - "language": { - "type": "string", - "default": "sql" - }, - "refs": { - "type": "array", - "items": { + "additionalProperties": false, + "required": [ + "name" + ] + }, + "conversion_measure": { "type": "object", - "title": "RefArgs", + "title": "MetricInputMeasure", "properties": { "name": { "type": "string" }, - "package": { + "filter": { "anyOf": [ { - "type": "string" + "type": "object", + "title": "WhereFilterIntersection", + "properties": { + "where_filters": { + "type": "array", + "items": { + "type": "object", + "title": "WhereFilter", + "properties": { + "where_sql_template": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "where_sql_template" + ] + } + } + }, + "additionalProperties": false, + "required": [ + "where_filters" + ] }, { "type": "null" @@ -10370,13 +8716,25 @@ ], "default": null }, - "version": { + "alias": { "anyOf": [ { "type": "string" }, { - "type": "number" + "type": "null" + } + ], + "default": null + }, + "join_to_timespine": { + "type": "boolean", + "default": false + }, + "fill_nulls_with": { + "anyOf": [ + { + "type": "integer" }, { "type": "null" @@ -10389,151 +8747,433 @@ "required": [ "name" ] - } - }, - "sources": { - "type": "array", - "items": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "metrics": { - "type": "array", - "items": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "depends_on": { - "type": "object", - "title": "DependsOn", - "properties": { - "macros": { - "type": "array", - "items": { - "type": "string" - } - }, - "nodes": { - "type": "array", - "items": { - "type": "string" + }, + "entity": { + "type": "string" + }, + "calculation": { + "enum": [ + "conversions", + "conversion_rate" + ], + "default": "conversion_rate" + }, + "window": { + "anyOf": [ + { + "type": "object", + "title": "MetricTimeWindow", + "properties": { + "count": { + "type": "integer" + }, + "granularity": { + "enum": [ + "day", + "week", + "month", + "quarter", + "year" + ] + } + }, + "additionalProperties": false, + "required": [ + "count", + "granularity" + ] + }, + { + "type": "null" } - } + ], + "default": null }, - "additionalProperties": false - }, - "compiled_path": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null - }, - "compiled": { - "type": "boolean", - "default": false - }, - "compiled_code": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null - }, - "extra_ctes_injected": { - "type": "boolean", - "default": false - }, - "extra_ctes": { - "type": "array", - "items": { - "type": "object", - "title": "InjectedCTE", - "properties": { - "id": { - "type": "string" + "constant_properties": { + "anyOf": [ + { + "type": "array", + "items": { + "type": "object", + "title": "ConstantPropertyInput", + "properties": { + "base_property": { + "type": "string" + }, + "conversion_property": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "base_property", + "conversion_property" + ] + } }, - "sql": { - "type": "string" + { + "type": "null" } - }, - "additionalProperties": false, - "required": [ - "id", - "sql" - ] + ], + "default": null } }, - "_pre_injected_sql": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null - }, - "contract": { + "additionalProperties": false, + "required": [ + "base_measure", + "conversion_measure", + "entity" + ] + }, + { + "type": "null" + } + ], + "default": null + } + }, + "additionalProperties": false + }, + "filter": { + "anyOf": [ + { + "type": "object", + "title": "WhereFilterIntersection", + "properties": { + "where_filters": { + "type": "array", + "items": { "type": "object", - "title": "Contract", + "title": "WhereFilter", "properties": { - "enforced": { - "type": "boolean", - "default": false - }, - "alias_types": { - "type": "boolean", - "default": true - }, - "checksum": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null + "where_sql_template": { + "type": "string" } }, - "additionalProperties": false + "additionalProperties": false, + "required": [ + "where_sql_template" + ] + } + } + }, + "additionalProperties": false, + "required": [ + "where_filters" + ] + }, + { + "type": "null" + } + ], + "default": null + }, + "metadata": { + "anyOf": [ + { + "type": "object", + "title": "SourceFileMetadata", + "properties": { + "repo_file_path": { + "type": "string" + }, + "file_slice": { + "type": "object", + "title": "FileSlice", + "properties": { + "filename": { + "type": "string" + }, + "content": { + "type": "string" + }, + "start_line_number": { + "type": "integer" + }, + "end_line_number": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "filename", + "content", + "start_line_number", + "end_line_number" + ] + } + }, + "additionalProperties": false, + "required": [ + "repo_file_path", + "file_slice" + ] + }, + { + "type": "null" + } + ], + "default": null + }, + "meta": { + "type": "object", + "propertyNames": { + "type": "string" + } + }, + "tags": { + "type": "array", + "items": { + "type": "string" + } + }, + "config": { + "type": "object", + "title": "MetricConfig", + "properties": { + "_extra": { + "type": "object", + "propertyNames": { + "type": "string" + } + }, + "enabled": { + "type": "boolean", + "default": true + }, + "group": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "meta": { + "type": "object", + "propertyNames": { + "type": "string" + } + } + }, + "additionalProperties": true + }, + "unrendered_config": { + "type": "object", + "propertyNames": { + "type": "string" + } + }, + "sources": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "depends_on": { + "type": "object", + "title": "DependsOn", + "properties": { + "macros": { + "type": "array", + "items": { + "type": "string" + } + }, + "nodes": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false + }, + "refs": { + "type": "array", + "items": { + "type": "object", + "title": "RefArgs", + "properties": { + "name": { + "type": "string" + }, + "package": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "version": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "number" + }, + { + "type": "null" } + ], + "default": null + } + }, + "additionalProperties": false, + "required": [ + "name" + ] + } + }, + "metrics": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "created_at": { + "type": "number" + }, + "group": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + } + }, + "additionalProperties": false, + "required": [ + "name", + "resource_type", + "package_name", + "path", + "original_file_path", + "unique_id", + "fqn", + "description", + "label", + "type", + "type_params" + ] + }, + "propertyNames": { + "type": "string" + } + }, + "groups": { + "type": "object", + "description": "The groups defined in the dbt project", + "additionalProperties": { + "type": "object", + "title": "Group", + "properties": { + "name": { + "type": "string" + }, + "resource_type": { + "const": "group" + }, + "package_name": { + "type": "string" + }, + "path": { + "type": "string" + }, + "original_file_path": { + "type": "string" + }, + "unique_id": { + "type": "string" + }, + "owner": { + "type": "object", + "title": "Owner", + "properties": { + "_extra": { + "type": "object", + "propertyNames": { + "type": "string" + } + }, + "email": { + "anyOf": [ + { + "type": "string" }, - "additionalProperties": false, - "required": [ - "database", - "schema", - "name", - "resource_type", - "package_name", - "path", - "original_file_path", - "unique_id", - "fqn", - "alias", - "checksum" - ] - }, + { + "type": "null" + } + ], + "default": null + }, + "name": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + } + }, + "additionalProperties": true + } + }, + "additionalProperties": false, + "required": [ + "name", + "resource_type", + "package_name", + "path", + "original_file_path", + "unique_id", + "owner" + ] + }, + "propertyNames": { + "type": "string" + } + }, + "selectors": { + "type": "object", + "description": "The selectors defined in selectors.yml", + "propertyNames": { + "type": "string" + } + }, + "disabled": { + "description": "A mapping of the disabled nodes in the target", + "anyOf": [ + { + "type": "object", + "additionalProperties": { + "type": "array", + "items": { + "anyOf": [ { "type": "object", - "title": "SingularTestNode", + "title": "Seed", "properties": { "database": { "anyOf": [ @@ -10552,7 +9192,7 @@ "type": "string" }, "resource_type": { - "const": "test" + "const": "seed" }, "package_name": { "type": "string" @@ -10594,7 +9234,7 @@ }, "config": { "type": "object", - "title": "TestConfig", + "title": "SeedConfig", "properties": { "_extra": { "type": "object", @@ -10602,14 +9242,172 @@ "type": "string" } }, - "enabled": { - "type": "boolean", - "default": true + "enabled": { + "type": "boolean", + "default": true + }, + "alias": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "database": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "tags": { + "anyOf": [ + { + "type": "array", + "items": { + "type": "string" + } + }, + { + "type": "string" + } + ] + }, + "meta": { + "type": "object", + "propertyNames": { + "type": "string" + } + }, + "group": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "materialized": { + "type": "string", + "default": "seed" + }, + "incremental_strategy": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "persist_docs": { + "type": "object", + "propertyNames": { + "type": "string" + } + }, + "post-hook": { + "type": "array", + "items": { + "type": "object", + "title": "Hook", + "properties": { + "sql": { + "type": "string" + }, + "transaction": { + "type": "boolean", + "default": true + }, + "index": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "default": null + } + }, + "additionalProperties": false, + "required": [ + "sql" + ] + } + }, + "pre-hook": { + "type": "array", + "items": { + "type": "object", + "title": "Hook", + "properties": { + "sql": { + "type": "string" + }, + "transaction": { + "type": "boolean", + "default": true + }, + "index": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "default": null + } + }, + "additionalProperties": false, + "required": [ + "sql" + ] + } + }, + "quoting": { + "type": "object", + "propertyNames": { + "type": "string" + } + }, + "column_types": { + "type": "object", + "propertyNames": { + "type": "string" + } }, - "alias": { + "full_refresh": { "anyOf": [ { - "type": "string" + "type": "boolean" }, { "type": "null" @@ -10617,18 +9415,24 @@ ], "default": null }, - "schema": { + "unique_key": { "anyOf": [ { "type": "string" }, + { + "type": "array", + "items": { + "type": "string" + } + }, { "type": "null" } ], - "default": "dbt_test__audit" + "default": null }, - "database": { + "on_schema_change": { "anyOf": [ { "type": "string" @@ -10637,112 +9441,82 @@ "type": "null" } ], - "default": null + "default": "ignore" }, - "tags": { - "anyOf": [ - { - "type": "array", - "items": { - "type": "string" - } - }, - { - "type": "string" - } + "on_configuration_change": { + "enum": [ + "apply", + "continue", + "fail" ] }, - "meta": { + "grants": { "type": "object", "propertyNames": { "type": "string" } }, - "group": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null - }, - "materialized": { - "type": "string", - "default": "test" - }, - "severity": { - "type": "string", - "default": "ERROR", - "pattern": "^([Ww][Aa][Rr][Nn]|[Ee][Rr][Rr][Oo][Rr])$" + "packages": { + "type": "array", + "items": { + "type": "string" + } }, - "store_failures": { - "anyOf": [ - { - "type": "boolean" + "docs": { + "type": "object", + "title": "Docs", + "properties": { + "show": { + "type": "boolean", + "default": true }, - { - "type": "null" + "node_color": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null } - ], - "default": null + }, + "additionalProperties": false }, - "store_failures_as": { - "anyOf": [ - { - "type": "string" + "contract": { + "type": "object", + "title": "ContractConfig", + "properties": { + "enforced": { + "type": "boolean", + "default": false }, - { - "type": "null" + "alias_types": { + "type": "boolean", + "default": true } - ], - "default": null + }, + "additionalProperties": false }, - "where": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null + "delimiter": { + "type": "string", + "default": "," }, - "limit": { + "quote_columns": { "anyOf": [ { - "type": "integer" + "type": "boolean" }, { "type": "null" } ], "default": null - }, - "fail_calc": { - "type": "string", - "default": "count(*)" - }, - "warn_if": { - "type": "string", - "default": "!= 0" - }, - "error_if": { - "type": "string", - "default": "!= 0" } }, "additionalProperties": true }, - "_event_status": { - "type": "object", - "propertyNames": { - "type": "string" - } - }, "tags": { "type": "array", "items": { @@ -10912,141 +9686,40 @@ "anyOf": [ { "type": "string" - }, - { - "type": "null" - } - ], - "default": null - }, - "build_path": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null - }, - "deferred": { - "type": "boolean", - "default": false - }, - "unrendered_config": { - "type": "object", - "propertyNames": { - "type": "string" - } - }, - "created_at": { - "type": "number" - }, - "config_call_dict": { - "type": "object", - "propertyNames": { - "type": "string" - } - }, - "relation_name": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null - }, - "raw_code": { - "type": "string", - "default": "" - }, - "language": { - "type": "string", - "default": "sql" - }, - "refs": { - "type": "array", - "items": { - "type": "object", - "title": "RefArgs", - "properties": { - "name": { - "type": "string" - }, - "package": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null - }, - "version": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "number" - }, - { - "type": "null" - } - ], - "default": null - } - }, - "additionalProperties": false, - "required": [ - "name" - ] - } - }, - "sources": { - "type": "array", - "items": { - "type": "array", - "items": { - "type": "string" + }, + { + "type": "null" } - } + ], + "default": null }, - "metrics": { - "type": "array", - "items": { - "type": "array", - "items": { + "build_path": { + "anyOf": [ + { "type": "string" + }, + { + "type": "null" } + ], + "default": null + }, + "unrendered_config": { + "type": "object", + "propertyNames": { + "type": "string" } }, - "depends_on": { + "created_at": { + "type": "number" + }, + "config_call_dict": { "type": "object", - "title": "DependsOn", - "properties": { - "macros": { - "type": "array", - "items": { - "type": "string" - } - }, - "nodes": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "additionalProperties": false + "propertyNames": { + "type": "string" + } }, - "compiled_path": { + "relation_name": { "anyOf": [ { "type": "string" @@ -11057,11 +9730,11 @@ ], "default": null }, - "compiled": { - "type": "boolean", - "default": false + "raw_code": { + "type": "string", + "default": "" }, - "compiled_code": { + "root_path": { "anyOf": [ { "type": "string" @@ -11072,66 +9745,399 @@ ], "default": null }, - "extra_ctes_injected": { - "type": "boolean", - "default": false - }, - "extra_ctes": { - "type": "array", - "items": { - "type": "object", - "title": "InjectedCTE", - "properties": { - "id": { + "depends_on": { + "type": "object", + "title": "MacroDependsOn", + "properties": { + "macros": { + "type": "array", + "items": { "type": "string" + } + } + }, + "additionalProperties": false + }, + "defer_relation": { + "anyOf": [ + { + "type": "object", + "title": "DeferRelation", + "properties": { + "database": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "schema": { + "type": "string" + }, + "alias": { + "type": "string" + }, + "relation_name": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "resource_type": { + "enum": [ + "model", + "analysis", + "test", + "snapshot", + "operation", + "seed", + "rpc", + "sql_operation", + "doc", + "source", + "macro", + "exposure", + "metric", + "group", + "saved_query", + "semantic_model", + "unit_test", + "fixture" + ] + }, + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "compiled_code": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "meta": { + "type": "object", + "propertyNames": { + "type": "string" + } + }, + "tags": { + "type": "array", + "items": { + "type": "string" + } + }, + "config": { + "anyOf": [ + { + "type": "object", + "title": "NodeConfig", + "properties": { + "_extra": { + "type": "object", + "propertyNames": { + "type": "string" + } + }, + "enabled": { + "type": "boolean", + "default": true + }, + "alias": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "database": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "tags": { + "anyOf": [ + { + "type": "array", + "items": { + "type": "string" + } + }, + { + "type": "string" + } + ] + }, + "meta": { + "type": "object", + "propertyNames": { + "type": "string" + } + }, + "group": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "materialized": { + "type": "string", + "default": "view" + }, + "incremental_strategy": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "persist_docs": { + "type": "object", + "propertyNames": { + "type": "string" + } + }, + "post-hook": { + "type": "array", + "items": { + "type": "object", + "title": "Hook", + "properties": { + "sql": { + "type": "string" + }, + "transaction": { + "type": "boolean", + "default": true + }, + "index": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "default": null + } + }, + "additionalProperties": false, + "required": [ + "sql" + ] + } + }, + "pre-hook": { + "type": "array", + "items": { + "type": "object", + "title": "Hook", + "properties": { + "sql": { + "type": "string" + }, + "transaction": { + "type": "boolean", + "default": true + }, + "index": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "default": null + } + }, + "additionalProperties": false, + "required": [ + "sql" + ] + } + }, + "quoting": { + "type": "object", + "propertyNames": { + "type": "string" + } + }, + "column_types": { + "type": "object", + "propertyNames": { + "type": "string" + } + }, + "full_refresh": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "default": null + }, + "unique_key": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + }, + { + "type": "null" + } + ], + "default": null + }, + "on_schema_change": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": "ignore" + }, + "on_configuration_change": { + "enum": [ + "apply", + "continue", + "fail" + ] + }, + "grants": { + "type": "object", + "propertyNames": { + "type": "string" + } + }, + "packages": { + "type": "array", + "items": { + "type": "string" + } + }, + "docs": { + "type": "object", + "title": "Docs", + "properties": { + "show": { + "type": "boolean", + "default": true + }, + "node_color": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + } + }, + "additionalProperties": false + }, + "contract": { + "type": "object", + "title": "ContractConfig", + "properties": { + "enforced": { + "type": "boolean", + "default": false + }, + "alias_types": { + "type": "boolean", + "default": true + } + }, + "additionalProperties": false + } + }, + "additionalProperties": true + }, + { + "type": "null" + } + ] + } }, - "sql": { - "type": "string" - } - }, - "additionalProperties": false, - "required": [ - "id", - "sql" - ] - } - }, - "_pre_injected_sql": { - "anyOf": [ - { - "type": "string" + "additionalProperties": false, + "required": [ + "database", + "schema", + "alias", + "relation_name", + "resource_type", + "name", + "description", + "compiled_code", + "meta", + "tags", + "config" + ] }, { "type": "null" } ], "default": null - }, - "contract": { - "type": "object", - "title": "Contract", - "properties": { - "enforced": { - "type": "boolean", - "default": false - }, - "alias_types": { - "type": "boolean", - "default": true - }, - "checksum": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null - } - }, - "additionalProperties": false } }, "additionalProperties": false, @@ -11151,7 +10157,7 @@ }, { "type": "object", - "title": "HookNode", + "title": "Analysis", "properties": { "database": { "anyOf": [ @@ -11170,7 +10176,7 @@ "type": "string" }, "resource_type": { - "const": "operation" + "const": "analysis" }, "package_name": { "type": "string" @@ -11480,12 +10486,6 @@ }, "additionalProperties": true }, - "_event_status": { - "type": "object", - "propertyNames": { - "type": "string" - } - }, "tags": { "type": "array", "items": { @@ -11673,10 +10673,6 @@ ], "default": null }, - "deferred": { - "type": "boolean", - "default": false - }, "unrendered_config": { "type": "object", "propertyNames": { @@ -11875,17 +10871,6 @@ } }, "additionalProperties": false - }, - "index": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "default": null } }, "additionalProperties": false, @@ -11905,7 +10890,7 @@ }, { "type": "object", - "title": "ModelNode", + "title": "SingularTest", "properties": { "database": { "anyOf": [ @@ -11924,7 +10909,7 @@ "type": "string" }, "resource_type": { - "const": "model" + "const": "test" }, "package_name": { "type": "string" @@ -11966,7 +10951,7 @@ }, "config": { "type": "object", - "title": "ModelConfig", + "title": "TestConfig", "properties": { "_extra": { "type": "object", @@ -11998,7 +10983,7 @@ "type": "null" } ], - "default": null + "default": "dbt_test__audit" }, "database": { "anyOf": [ @@ -12043,12 +11028,17 @@ }, "materialized": { "type": "string", - "default": "view" + "default": "test" }, - "incremental_strategy": { + "severity": { + "type": "string", + "default": "ERROR", + "pattern": "^([Ww][Aa][Rr][Nn]|[Ee][Rr][Rr][Oo][Rr])$" + }, + "store_failures": { "anyOf": [ { - "type": "string" + "type": "boolean" }, { "type": "null" @@ -12056,90 +11046,10 @@ ], "default": null }, - "persist_docs": { - "type": "object", - "propertyNames": { - "type": "string" - } - }, - "post-hook": { - "type": "array", - "items": { - "type": "object", - "title": "Hook", - "properties": { - "sql": { - "type": "string" - }, - "transaction": { - "type": "boolean", - "default": true - }, - "index": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "default": null - } - }, - "additionalProperties": false, - "required": [ - "sql" - ] - } - }, - "pre-hook": { - "type": "array", - "items": { - "type": "object", - "title": "Hook", - "properties": { - "sql": { - "type": "string" - }, - "transaction": { - "type": "boolean", - "default": true - }, - "index": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "default": null - } - }, - "additionalProperties": false, - "required": [ - "sql" - ] - } - }, - "quoting": { - "type": "object", - "propertyNames": { - "type": "string" - } - }, - "column_types": { - "type": "object", - "propertyNames": { - "type": "string" - } - }, - "full_refresh": { + "store_failures_as": { "anyOf": [ { - "type": "boolean" + "type": "string" }, { "type": "null" @@ -12147,107 +11057,43 @@ ], "default": null }, - "unique_key": { + "where": { "anyOf": [ { "type": "string" }, - { - "type": "array", - "items": { - "type": "string" - } - }, { "type": "null" } ], "default": null }, - "on_schema_change": { + "limit": { "anyOf": [ { - "type": "string" + "type": "integer" }, { "type": "null" } ], - "default": "ignore" - }, - "on_configuration_change": { - "enum": [ - "apply", - "continue", - "fail" - ] - }, - "grants": { - "type": "object", - "propertyNames": { - "type": "string" - } - }, - "packages": { - "type": "array", - "items": { - "type": "string" - } + "default": null }, - "docs": { - "type": "object", - "title": "Docs", - "properties": { - "show": { - "type": "boolean", - "default": true - }, - "node_color": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null - } - }, - "additionalProperties": false + "fail_calc": { + "type": "string", + "default": "count(*)" }, - "contract": { - "type": "object", - "title": "ContractConfig", - "properties": { - "enforced": { - "type": "boolean", - "default": false - }, - "alias_types": { - "type": "boolean", - "default": true - } - }, - "additionalProperties": false + "warn_if": { + "type": "string", + "default": "!= 0" }, - "access": { - "enum": [ - "private", - "protected", - "public" - ], - "default": "protected" + "error_if": { + "type": "string", + "default": "!= 0" } }, "additionalProperties": true }, - "_event_status": { - "type": "object", - "propertyNames": { - "type": "string" - } - }, "tags": { "type": "array", "items": { @@ -12435,10 +11281,6 @@ ], "default": null }, - "deferred": { - "type": "boolean", - "default": false - }, "unrendered_config": { "type": "object", "propertyNames": { @@ -12637,159 +11479,6 @@ } }, "additionalProperties": false - }, - "access": { - "enum": [ - "private", - "protected", - "public" - ], - "default": "protected" - }, - "constraints": { - "type": "array", - "items": { - "type": "object", - "title": "ModelLevelConstraint", - "properties": { - "type": { - "enum": [ - "check", - "not_null", - "unique", - "primary_key", - "foreign_key", - "custom" - ] - }, - "name": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null - }, - "expression": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null - }, - "warn_unenforced": { - "type": "boolean", - "default": true - }, - "warn_unsupported": { - "type": "boolean", - "default": true - }, - "columns": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "additionalProperties": false, - "required": [ - "type" - ] - } - }, - "version": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "number" - }, - { - "type": "null" - } - ], - "default": null - }, - "latest_version": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "number" - }, - { - "type": "null" - } - ], - "default": null - }, - "deprecation_date": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null - }, - "defer_relation": { - "anyOf": [ - { - "type": "object", - "title": "DeferRelation", - "properties": { - "database": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "schema": { - "type": "string" - }, - "alias": { - "type": "string" - }, - "relation_name": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - } - }, - "additionalProperties": false, - "required": [ - "database", - "schema", - "alias", - "relation_name" - ] - }, - { - "type": "null" - } - ], - "default": null } }, "additionalProperties": false, @@ -12809,7 +11498,7 @@ }, { "type": "object", - "title": "RPCNode", + "title": "HookNode", "properties": { "database": { "anyOf": [ @@ -12828,7 +11517,7 @@ "type": "string" }, "resource_type": { - "const": "rpc" + "const": "operation" }, "package_name": { "type": "string" @@ -13138,12 +11827,6 @@ }, "additionalProperties": true }, - "_event_status": { - "type": "object", - "propertyNames": { - "type": "string" - } - }, "tags": { "type": "array", "items": { @@ -13331,10 +12014,6 @@ ], "default": null }, - "deferred": { - "type": "boolean", - "default": false - }, "unrendered_config": { "type": "object", "propertyNames": { @@ -13533,6 +12212,17 @@ } }, "additionalProperties": false + }, + "index": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "default": null } }, "additionalProperties": false, @@ -13552,7 +12242,7 @@ }, { "type": "object", - "title": "SqlNode", + "title": "Model", "properties": { "database": { "anyOf": [ @@ -13571,7 +12261,7 @@ "type": "string" }, "resource_type": { - "const": "sql_operation" + "const": "model" }, "package_name": { "type": "string" @@ -13613,7 +12303,7 @@ }, "config": { "type": "object", - "title": "NodeConfig", + "title": "ModelConfig", "properties": { "_extra": { "type": "object", @@ -13877,16 +12567,18 @@ } }, "additionalProperties": false + }, + "access": { + "enum": [ + "private", + "protected", + "public" + ], + "default": "protected" } }, "additionalProperties": true }, - "_event_status": { - "type": "object", - "propertyNames": { - "type": "string" - } - }, "tags": { "type": "array", "items": { @@ -14074,10 +12766,6 @@ ], "default": null }, - "deferred": { - "type": "boolean", - "default": false - }, "unrendered_config": { "type": "object", "propertyNames": { @@ -14245,326 +12933,63 @@ { "type": "string" }, - { - "type": "null" - } - ], - "default": null - }, - "contract": { - "type": "object", - "title": "Contract", - "properties": { - "enforced": { - "type": "boolean", - "default": false - }, - "alias_types": { - "type": "boolean", - "default": true - }, - "checksum": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null - } - }, - "additionalProperties": false - } - }, - "additionalProperties": false, - "required": [ - "database", - "schema", - "name", - "resource_type", - "package_name", - "path", - "original_file_path", - "unique_id", - "fqn", - "alias", - "checksum" - ] - }, - { - "type": "object", - "title": "GenericTestNode", - "properties": { - "test_metadata": { - "type": "object", - "title": "TestMetadata", - "properties": { - "name": { - "type": "string" - }, - "kwargs": { - "type": "object", - "propertyNames": { - "type": "string" - } - }, - "namespace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null - } - }, - "additionalProperties": false, - "required": [ - "name" - ] - }, - "database": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "schema": { - "type": "string" - }, - "name": { - "type": "string" - }, - "resource_type": { - "const": "test" - }, - "package_name": { - "type": "string" - }, - "path": { - "type": "string" - }, - "original_file_path": { - "type": "string" - }, - "unique_id": { - "type": "string" - }, - "fqn": { - "type": "array", - "items": { - "type": "string" - } - }, - "alias": { - "type": "string" - }, - "checksum": { - "type": "object", - "title": "FileHash", - "properties": { - "name": { - "type": "string" - }, - "checksum": { - "type": "string" - } - }, - "additionalProperties": false, - "required": [ - "name", - "checksum" - ] - }, - "config": { - "type": "object", - "title": "TestConfig", - "properties": { - "_extra": { - "type": "object", - "propertyNames": { - "type": "string" - } - }, - "enabled": { - "type": "boolean", - "default": true - }, - "alias": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null - }, - "schema": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": "dbt_test__audit" - }, - "database": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null - }, - "tags": { - "anyOf": [ - { - "type": "array", - "items": { - "type": "string" - } - }, - { - "type": "string" - } - ] - }, - "meta": { - "type": "object", - "propertyNames": { - "type": "string" - } - }, - "group": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null - }, - "materialized": { - "type": "string", - "default": "test" - }, - "severity": { - "type": "string", - "default": "ERROR", - "pattern": "^([Ww][Aa][Rr][Nn]|[Ee][Rr][Rr][Oo][Rr])$" - }, - "store_failures": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "null" - } - ], - "default": null - }, - "store_failures_as": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null + { + "type": "null" + } + ], + "default": null + }, + "contract": { + "type": "object", + "title": "Contract", + "properties": { + "enforced": { + "type": "boolean", + "default": false }, - "where": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null + "alias_types": { + "type": "boolean", + "default": true }, - "limit": { + "checksum": { "anyOf": [ { - "type": "integer" + "type": "string" }, { "type": "null" } ], "default": null - }, - "fail_calc": { - "type": "string", - "default": "count(*)" - }, - "warn_if": { - "type": "string", - "default": "!= 0" - }, - "error_if": { - "type": "string", - "default": "!= 0" } }, - "additionalProperties": true + "additionalProperties": false }, - "_event_status": { - "type": "object", - "propertyNames": { - "type": "string" - } + "access": { + "enum": [ + "private", + "protected", + "public" + ], + "default": "protected" }, - "tags": { + "constraints": { "type": "array", "items": { - "type": "string" - } - }, - "description": { - "type": "string", - "default": "" - }, - "columns": { - "type": "object", - "additionalProperties": { "type": "object", - "title": "ColumnInfo", + "title": "ModelLevelConstraint", "properties": { - "name": { - "type": "string" - }, - "description": { - "type": "string", - "default": "" - }, - "meta": { - "type": "object", - "propertyNames": { - "type": "string" - } + "type": { + "enum": [ + "check", + "not_null", + "unique", + "primary_key", + "foreign_key", + "custom" + ] }, - "data_type": { + "name": { "anyOf": [ { "type": "string" @@ -14575,63 +13000,10 @@ ], "default": null }, - "constraints": { - "type": "array", - "items": { - "type": "object", - "title": "ColumnLevelConstraint", - "properties": { - "type": { - "enum": [ - "check", - "not_null", - "unique", - "primary_key", - "foreign_key", - "custom" - ] - }, - "name": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null - }, - "expression": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null - }, - "warn_unenforced": { - "type": "boolean", - "default": true - }, - "warn_unsupported": { - "type": "boolean", - "default": true - } - }, - "additionalProperties": false, - "required": [ - "type" - ] - } - }, - "quote": { + "expression": { "anyOf": [ { - "type": "boolean" + "type": "string" }, { "type": "null" @@ -14639,71 +13011,34 @@ ], "default": null }, - "tags": { + "warn_unenforced": { + "type": "boolean", + "default": true + }, + "warn_unsupported": { + "type": "boolean", + "default": true + }, + "columns": { "type": "array", "items": { "type": "string" } - }, - "_extra": { - "type": "object", - "propertyNames": { - "type": "string" - } } }, - "additionalProperties": true, + "additionalProperties": false, "required": [ - "name" + "type" ] - }, - "propertyNames": { - "type": "string" - } - }, - "meta": { - "type": "object", - "propertyNames": { - "type": "string" } }, - "group": { + "version": { "anyOf": [ { "type": "string" }, { - "type": "null" - } - ], - "default": null - }, - "docs": { - "type": "object", - "title": "Docs", - "properties": { - "show": { - "type": "boolean", - "default": true - }, - "node_color": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null - } - }, - "additionalProperties": false - }, - "patch_path": { - "anyOf": [ - { - "type": "string" + "type": "number" }, { "type": "null" @@ -14711,37 +13046,21 @@ ], "default": null }, - "build_path": { + "latest_version": { "anyOf": [ { "type": "string" }, + { + "type": "number" + }, { "type": "null" } ], "default": null }, - "deferred": { - "type": "boolean", - "default": false - }, - "unrendered_config": { - "type": "object", - "propertyNames": { - "type": "string" - } - }, - "created_at": { - "type": "number" - }, - "config_call_dict": { - "type": "object", - "propertyNames": { - "type": "string" - } - }, - "relation_name": { + "deprecation_date": { "anyOf": [ { "type": "string" @@ -14750,98 +13069,382 @@ "type": "null" } ], - "default": null - }, - "raw_code": { - "type": "string", - "default": "" - }, - "language": { - "type": "string", - "default": "sql" + "default": null }, - "refs": { - "type": "array", - "items": { - "type": "object", - "title": "RefArgs", - "properties": { - "name": { - "type": "string" - }, - "package": { - "anyOf": [ - { + "defer_relation": { + "anyOf": [ + { + "type": "object", + "title": "DeferRelation", + "properties": { + "database": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "schema": { + "type": "string" + }, + "alias": { + "type": "string" + }, + "relation_name": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "resource_type": { + "enum": [ + "model", + "analysis", + "test", + "snapshot", + "operation", + "seed", + "rpc", + "sql_operation", + "doc", + "source", + "macro", + "exposure", + "metric", + "group", + "saved_query", + "semantic_model", + "unit_test", + "fixture" + ] + }, + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "compiled_code": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "meta": { + "type": "object", + "propertyNames": { "type": "string" - }, - { - "type": "null" } - ], - "default": null + }, + "tags": { + "type": "array", + "items": { + "type": "string" + } + }, + "config": { + "anyOf": [ + { + "type": "object", + "title": "NodeConfig", + "properties": { + "_extra": { + "type": "object", + "propertyNames": { + "type": "string" + } + }, + "enabled": { + "type": "boolean", + "default": true + }, + "alias": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "database": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "tags": { + "anyOf": [ + { + "type": "array", + "items": { + "type": "string" + } + }, + { + "type": "string" + } + ] + }, + "meta": { + "type": "object", + "propertyNames": { + "type": "string" + } + }, + "group": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "materialized": { + "type": "string", + "default": "view" + }, + "incremental_strategy": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "persist_docs": { + "type": "object", + "propertyNames": { + "type": "string" + } + }, + "post-hook": { + "type": "array", + "items": { + "type": "object", + "title": "Hook", + "properties": { + "sql": { + "type": "string" + }, + "transaction": { + "type": "boolean", + "default": true + }, + "index": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "default": null + } + }, + "additionalProperties": false, + "required": [ + "sql" + ] + } + }, + "pre-hook": { + "type": "array", + "items": { + "type": "object", + "title": "Hook", + "properties": { + "sql": { + "type": "string" + }, + "transaction": { + "type": "boolean", + "default": true + }, + "index": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "default": null + } + }, + "additionalProperties": false, + "required": [ + "sql" + ] + } + }, + "quoting": { + "type": "object", + "propertyNames": { + "type": "string" + } + }, + "column_types": { + "type": "object", + "propertyNames": { + "type": "string" + } + }, + "full_refresh": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "default": null + }, + "unique_key": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + }, + { + "type": "null" + } + ], + "default": null + }, + "on_schema_change": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": "ignore" + }, + "on_configuration_change": { + "enum": [ + "apply", + "continue", + "fail" + ] + }, + "grants": { + "type": "object", + "propertyNames": { + "type": "string" + } + }, + "packages": { + "type": "array", + "items": { + "type": "string" + } + }, + "docs": { + "type": "object", + "title": "Docs", + "properties": { + "show": { + "type": "boolean", + "default": true + }, + "node_color": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + } + }, + "additionalProperties": false + }, + "contract": { + "type": "object", + "title": "ContractConfig", + "properties": { + "enforced": { + "type": "boolean", + "default": false + }, + "alias_types": { + "type": "boolean", + "default": true + } + }, + "additionalProperties": false + } + }, + "additionalProperties": true + }, + { + "type": "null" + } + ] + } }, - "version": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "number" - }, - { - "type": "null" - } - ], - "default": null - } - }, - "additionalProperties": false, - "required": [ - "name" - ] - } - }, - "sources": { - "type": "array", - "items": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "metrics": { - "type": "array", - "items": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "depends_on": { - "type": "object", - "title": "DependsOn", - "properties": { - "macros": { - "type": "array", - "items": { - "type": "string" - } - }, - "nodes": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "additionalProperties": false - }, - "compiled_path": { - "anyOf": [ - { - "type": "string" + "additionalProperties": false, + "required": [ + "database", + "schema", + "alias", + "relation_name", + "resource_type", + "name", + "description", + "compiled_code", + "meta", + "tags", + "config" + ] }, { "type": "null" @@ -14849,109 +13452,14 @@ ], "default": null }, - "compiled": { - "type": "boolean", - "default": false - }, - "compiled_code": { + "primary_key": { "anyOf": [ { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null - }, - "extra_ctes_injected": { - "type": "boolean", - "default": false - }, - "extra_ctes": { - "type": "array", - "items": { - "type": "object", - "title": "InjectedCTE", - "properties": { - "id": { - "type": "string" - }, - "sql": { + "type": "array", + "items": { "type": "string" } }, - "additionalProperties": false, - "required": [ - "id", - "sql" - ] - } - }, - "_pre_injected_sql": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null - }, - "contract": { - "type": "object", - "title": "Contract", - "properties": { - "enforced": { - "type": "boolean", - "default": false - }, - "alias_types": { - "type": "boolean", - "default": true - }, - "checksum": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null - } - }, - "additionalProperties": false - }, - "column_name": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null - }, - "file_key_name": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null - }, - "attached_node": { - "anyOf": [ - { - "type": "string" - }, { "type": "null" } @@ -14961,7 +13469,6 @@ }, "additionalProperties": false, "required": [ - "test_metadata", "database", "schema", "name", @@ -14977,7 +13484,7 @@ }, { "type": "object", - "title": "SnapshotNode", + "title": "SqlOperation", "properties": { "database": { "anyOf": [ @@ -14996,7 +13503,7 @@ "type": "string" }, "resource_type": { - "const": "snapshot" + "const": "sql_operation" }, "package_name": { "type": "string" @@ -15038,7 +13545,7 @@ }, "config": { "type": "object", - "title": "SnapshotConfig", + "title": "NodeConfig", "properties": { "_extra": { "type": "object", @@ -15115,7 +13622,7 @@ }, "materialized": { "type": "string", - "default": "snapshot" + "default": "view" }, "incremental_strategy": { "anyOf": [ @@ -15224,6 +13731,12 @@ { "type": "string" }, + { + "type": "array", + "items": { + "type": "string" + } + }, { "type": "null" } @@ -15288,85 +13801,18 @@ "properties": { "enforced": { "type": "boolean", - "default": false - }, - "alias_types": { - "type": "boolean", - "default": true - } - }, - "additionalProperties": false - }, - "strategy": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null - }, - "target_schema": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null - }, - "target_database": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null - }, - "updated_at": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null - }, - "check_cols": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "type": "string" - } + "default": false }, - { - "type": "null" + "alias_types": { + "type": "boolean", + "default": true } - ], - "default": null + }, + "additionalProperties": false } }, "additionalProperties": true }, - "_event_status": { - "type": "object", - "propertyNames": { - "type": "string" - } - }, "tags": { "type": "array", "items": { @@ -15554,10 +14000,6 @@ ], "default": null }, - "deferred": { - "type": "boolean", - "default": false - }, "unrendered_config": { "type": "object", "propertyNames": { @@ -15756,53 +14198,6 @@ } }, "additionalProperties": false - }, - "defer_relation": { - "anyOf": [ - { - "type": "object", - "title": "DeferRelation", - "properties": { - "database": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "schema": { - "type": "string" - }, - "alias": { - "type": "string" - }, - "relation_name": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - } - }, - "additionalProperties": false, - "required": [ - "database", - "schema", - "alias", - "relation_name" - ] - }, - { - "type": "null" - } - ], - "default": null } }, "additionalProperties": false, @@ -15817,13 +14212,12 @@ "unique_id", "fqn", "alias", - "checksum", - "config" + "checksum" ] }, { "type": "object", - "title": "UnitTestNode", + "title": "GenericTest", "properties": { "database": { "anyOf": [ @@ -15842,7 +14236,7 @@ "type": "string" }, "resource_type": { - "const": "unit_test" + "const": "test" }, "package_name": { "type": "string" @@ -15884,7 +14278,7 @@ }, "config": { "type": "object", - "title": "UnitTestNodeConfig", + "title": "TestConfig", "properties": { "_extra": { "type": "object", @@ -15916,7 +14310,7 @@ "type": "null" } ], - "default": null + "default": "dbt_test__audit" }, "database": { "anyOf": [ @@ -15961,12 +14355,17 @@ }, "materialized": { "type": "string", - "default": "view" + "default": "test" }, - "incremental_strategy": { + "severity": { + "type": "string", + "default": "ERROR", + "pattern": "^([Ww][Aa][Rr][Nn]|[Ee][Rr][Rr][Oo][Rr])$" + }, + "store_failures": { "anyOf": [ { - "type": "string" + "type": "boolean" }, { "type": "null" @@ -15974,90 +14373,10 @@ ], "default": null }, - "persist_docs": { - "type": "object", - "propertyNames": { - "type": "string" - } - }, - "post-hook": { - "type": "array", - "items": { - "type": "object", - "title": "Hook", - "properties": { - "sql": { - "type": "string" - }, - "transaction": { - "type": "boolean", - "default": true - }, - "index": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "default": null - } - }, - "additionalProperties": false, - "required": [ - "sql" - ] - } - }, - "pre-hook": { - "type": "array", - "items": { - "type": "object", - "title": "Hook", - "properties": { - "sql": { - "type": "string" - }, - "transaction": { - "type": "boolean", - "default": true - }, - "index": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "default": null - } - }, - "additionalProperties": false, - "required": [ - "sql" - ] - } - }, - "quoting": { - "type": "object", - "propertyNames": { - "type": "string" - } - }, - "column_types": { - "type": "object", - "propertyNames": { - "type": "string" - } - }, - "full_refresh": { + "store_failures_as": { "anyOf": [ { - "type": "boolean" + "type": "string" }, { "type": "null" @@ -16065,107 +14384,42 @@ ], "default": null }, - "unique_key": { + "where": { "anyOf": [ { "type": "string" }, - { - "type": "array", - "items": { - "type": "string" - } - }, { "type": "null" } ], "default": null }, - "on_schema_change": { + "limit": { "anyOf": [ { - "type": "string" + "type": "integer" }, { "type": "null" } ], - "default": "ignore" - }, - "on_configuration_change": { - "enum": [ - "apply", - "continue", - "fail" - ] - }, - "grants": { - "type": "object", - "propertyNames": { - "type": "string" - } - }, - "packages": { - "type": "array", - "items": { - "type": "string" - } + "default": null }, - "docs": { - "type": "object", - "title": "Docs", - "properties": { - "show": { - "type": "boolean", - "default": true - }, - "node_color": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null - } - }, - "additionalProperties": false + "fail_calc": { + "type": "string", + "default": "count(*)" }, - "contract": { - "type": "object", - "title": "ContractConfig", - "properties": { - "enforced": { - "type": "boolean", - "default": false - }, - "alias_types": { - "type": "boolean", - "default": true - } - }, - "additionalProperties": false + "warn_if": { + "type": "string", + "default": "!= 0" }, - "expected_rows": { - "type": "array", - "items": { - "type": "object", - "propertyNames": { - "type": "string" - } - } + "error_if": { + "type": "string", + "default": "!= 0" } }, - "additionalProperties": true - }, - "_event_status": { - "type": "object", - "propertyNames": { - "type": "string" - } + "additionalProperties": true }, "tags": { "type": "array", @@ -16354,10 +14608,6 @@ ], "default": null }, - "deferred": { - "type": "boolean", - "default": false - }, "unrendered_config": { "type": "object", "propertyNames": { @@ -16557,7 +14807,7 @@ }, "additionalProperties": false }, - "tested_node_unique_id": { + "column_name": { "anyOf": [ { "type": "string" @@ -16568,7 +14818,7 @@ ], "default": null }, - "this_input_node_unique_id": { + "file_key_name": { "anyOf": [ { "type": "string" @@ -16579,38 +14829,44 @@ ], "default": null }, - "overrides": { + "attached_node": { "anyOf": [ { - "type": "object", - "title": "UnitTestOverrides", - "properties": { - "macros": { - "type": "object", - "propertyNames": { - "type": "string" - } - }, - "vars": { - "type": "object", - "propertyNames": { - "type": "string" - } - }, - "env_vars": { - "type": "object", - "propertyNames": { - "type": "string" - } - } - }, - "additionalProperties": false + "type": "string" }, { "type": "null" } ], "default": null + }, + "test_metadata": { + "type": "object", + "title": "TestMetadata", + "properties": { + "name": { + "type": "string", + "default": "test" + }, + "kwargs": { + "type": "object", + "propertyNames": { + "type": "string" + } + }, + "namespace": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + } + }, + "additionalProperties": false } }, "additionalProperties": false, @@ -16630,7 +14886,7 @@ }, { "type": "object", - "title": "SeedNode", + "title": "Snapshot", "properties": { "database": { "anyOf": [ @@ -16649,7 +14905,7 @@ "type": "string" }, "resource_type": { - "const": "seed" + "const": "snapshot" }, "package_name": { "type": "string" @@ -16691,7 +14947,7 @@ }, "config": { "type": "object", - "title": "SeedConfig", + "title": "SnapshotConfig", "properties": { "_extra": { "type": "object", @@ -16768,7 +15024,7 @@ }, "materialized": { "type": "string", - "default": "seed" + "default": "snapshot" }, "incremental_strategy": { "anyOf": [ @@ -16877,12 +15133,6 @@ { "type": "string" }, - { - "type": "array", - "items": { - "type": "string" - } - }, { "type": "null" } @@ -16956,14 +15206,60 @@ }, "additionalProperties": false }, - "delimiter": { - "type": "string", - "default": "," + "strategy": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null }, - "quote_columns": { + "target_schema": { "anyOf": [ { - "type": "boolean" + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "target_database": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "updated_at": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "check_cols": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } }, { "type": "null" @@ -16974,12 +15270,6 @@ }, "additionalProperties": true }, - "_event_status": { - "type": "object", - "propertyNames": { - "type": "string" - } - }, "tags": { "type": "array", "items": { @@ -17156,7 +15446,130 @@ ], "default": null }, - "build_path": { + "build_path": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "unrendered_config": { + "type": "object", + "propertyNames": { + "type": "string" + } + }, + "created_at": { + "type": "number" + }, + "config_call_dict": { + "type": "object", + "propertyNames": { + "type": "string" + } + }, + "relation_name": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "raw_code": { + "type": "string", + "default": "" + }, + "language": { + "type": "string", + "default": "sql" + }, + "refs": { + "type": "array", + "items": { + "type": "object", + "title": "RefArgs", + "properties": { + "name": { + "type": "string" + }, + "package": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "version": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "number" + }, + { + "type": "null" + } + ], + "default": null + } + }, + "additionalProperties": false, + "required": [ + "name" + ] + } + }, + "sources": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "metrics": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "depends_on": { + "type": "object", + "title": "DependsOn", + "properties": { + "macros": { + "type": "array", + "items": { + "type": "string" + } + }, + "nodes": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false + }, + "compiled_path": { "anyOf": [ { "type": "string" @@ -17167,26 +15580,11 @@ ], "default": null }, - "deferred": { + "compiled": { "type": "boolean", "default": false }, - "unrendered_config": { - "type": "object", - "propertyNames": { - "type": "string" - } - }, - "created_at": { - "type": "number" - }, - "config_call_dict": { - "type": "object", - "propertyNames": { - "type": "string" - } - }, - "relation_name": { + "compiled_code": { "anyOf": [ { "type": "string" @@ -17197,11 +15595,31 @@ ], "default": null }, - "raw_code": { - "type": "string", - "default": "" + "extra_ctes_injected": { + "type": "boolean", + "default": false }, - "root_path": { + "extra_ctes": { + "type": "array", + "items": { + "type": "object", + "title": "InjectedCTE", + "properties": { + "id": { + "type": "string" + }, + "sql": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "id", + "sql" + ] + } + }, + "_pre_injected_sql": { "anyOf": [ { "type": "string" @@ -17212,15 +15630,28 @@ ], "default": null }, - "depends_on": { + "contract": { "type": "object", - "title": "MacroDependsOn", + "title": "Contract", "properties": { - "macros": { - "type": "array", - "items": { - "type": "string" - } + "enforced": { + "type": "boolean", + "default": false + }, + "alias_types": { + "type": "boolean", + "default": true + }, + "checksum": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null } }, "additionalProperties": false @@ -17256,6 +15687,333 @@ "type": "null" } ] + }, + "resource_type": { + "enum": [ + "model", + "analysis", + "test", + "snapshot", + "operation", + "seed", + "rpc", + "sql_operation", + "doc", + "source", + "macro", + "exposure", + "metric", + "group", + "saved_query", + "semantic_model", + "unit_test", + "fixture" + ] + }, + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "compiled_code": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "meta": { + "type": "object", + "propertyNames": { + "type": "string" + } + }, + "tags": { + "type": "array", + "items": { + "type": "string" + } + }, + "config": { + "anyOf": [ + { + "type": "object", + "title": "NodeConfig", + "properties": { + "_extra": { + "type": "object", + "propertyNames": { + "type": "string" + } + }, + "enabled": { + "type": "boolean", + "default": true + }, + "alias": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "database": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "tags": { + "anyOf": [ + { + "type": "array", + "items": { + "type": "string" + } + }, + { + "type": "string" + } + ] + }, + "meta": { + "type": "object", + "propertyNames": { + "type": "string" + } + }, + "group": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "materialized": { + "type": "string", + "default": "view" + }, + "incremental_strategy": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + }, + "persist_docs": { + "type": "object", + "propertyNames": { + "type": "string" + } + }, + "post-hook": { + "type": "array", + "items": { + "type": "object", + "title": "Hook", + "properties": { + "sql": { + "type": "string" + }, + "transaction": { + "type": "boolean", + "default": true + }, + "index": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "default": null + } + }, + "additionalProperties": false, + "required": [ + "sql" + ] + } + }, + "pre-hook": { + "type": "array", + "items": { + "type": "object", + "title": "Hook", + "properties": { + "sql": { + "type": "string" + }, + "transaction": { + "type": "boolean", + "default": true + }, + "index": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "default": null + } + }, + "additionalProperties": false, + "required": [ + "sql" + ] + } + }, + "quoting": { + "type": "object", + "propertyNames": { + "type": "string" + } + }, + "column_types": { + "type": "object", + "propertyNames": { + "type": "string" + } + }, + "full_refresh": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "default": null + }, + "unique_key": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + }, + { + "type": "null" + } + ], + "default": null + }, + "on_schema_change": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": "ignore" + }, + "on_configuration_change": { + "enum": [ + "apply", + "continue", + "fail" + ] + }, + "grants": { + "type": "object", + "propertyNames": { + "type": "string" + } + }, + "packages": { + "type": "array", + "items": { + "type": "string" + } + }, + "docs": { + "type": "object", + "title": "Docs", + "properties": { + "show": { + "type": "boolean", + "default": true + }, + "node_color": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null + } + }, + "additionalProperties": false + }, + "contract": { + "type": "object", + "title": "ContractConfig", + "properties": { + "enforced": { + "type": "boolean", + "default": false + }, + "alias_types": { + "type": "boolean", + "default": true + } + }, + "additionalProperties": false + } + }, + "additionalProperties": true + }, + { + "type": "null" + } + ] } }, "additionalProperties": false, @@ -17263,7 +16021,14 @@ "database", "schema", "alias", - "relation_name" + "relation_name", + "resource_type", + "name", + "description", + "compiled_code", + "meta", + "tags", + "config" ] }, { @@ -17285,7 +16050,8 @@ "unique_id", "fqn", "alias", - "checksum" + "checksum", + "config" ] }, { @@ -17341,12 +16107,6 @@ "identifier": { "type": "string" }, - "_event_status": { - "type": "object", - "propertyNames": { - "type": "string" - } - }, "quoting": { "type": "object", "title": "Quoting", @@ -19038,6 +17798,12 @@ } ], "default": null + }, + "meta": { + "type": "object", + "propertyNames": { + "type": "string" + } } }, "additionalProperties": true @@ -19300,6 +18066,17 @@ } ], "default": null + }, + "database": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null } }, "additionalProperties": false, @@ -19315,12 +18092,6 @@ ] } }, - "_event_status": { - "type": "object", - "propertyNames": { - "type": "string" - } - }, "description": { "anyOf": [ { @@ -19445,6 +18216,17 @@ } ], "default": null + }, + "cache": { + "type": "object", + "title": "SavedQueryCache", + "properties": { + "enabled": { + "type": "boolean", + "default": false + } + }, + "additionalProperties": false } }, "additionalProperties": true @@ -19625,7 +18407,7 @@ "type": "null" } ], - "default": null + "default": "" } }, "additionalProperties": false, @@ -20292,7 +19074,8 @@ "format": { "enum": [ "csv", - "dict" + "dict", + "sql" ], "default": "dict" }, @@ -20341,7 +19124,8 @@ "format": { "enum": [ "csv", - "dict" + "dict", + "sql" ], "default": "dict" }, @@ -20402,12 +19186,6 @@ "type": "string" } }, - "_event_status": { - "type": "object", - "propertyNames": { - "type": "string" - } - }, "description": { "type": "string", "default": "" @@ -20517,6 +19295,80 @@ } ], "default": null + }, + "created_at": { + "type": "number" + }, + "versions": { + "anyOf": [ + { + "type": "object", + "title": "UnitTestNodeVersions", + "properties": { + "include": { + "anyOf": [ + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "number" + } + ] + } + }, + { + "type": "null" + } + ], + "default": null + }, + "exclude": { + "anyOf": [ + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "number" + } + ] + } + }, + { + "type": "null" + } + ], + "default": null + } + }, + "additionalProperties": false + }, + { + "type": "null" + } + ], + "default": null + }, + "version": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "number" + }, + { + "type": "null" + } + ], + "default": null } }, "additionalProperties": false, @@ -20752,6 +19604,17 @@ } ], "default": null + }, + "database": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null } }, "additionalProperties": false, @@ -20767,12 +19630,6 @@ ] } }, - "_event_status": { - "type": "object", - "propertyNames": { - "type": "string" - } - }, "description": { "anyOf": [ { @@ -20897,6 +19754,17 @@ } ], "default": null + }, + "cache": { + "type": "object", + "title": "SavedQueryCache", + "properties": { + "enabled": { + "type": "boolean", + "default": false + } + }, + "additionalProperties": false } }, "additionalProperties": true @@ -21084,7 +19952,7 @@ "type": "null" } ], - "default": null + "default": "" } }, "additionalProperties": false, @@ -21758,7 +20626,8 @@ "format": { "enum": [ "csv", - "dict" + "dict", + "sql" ], "default": "dict" }, @@ -21807,7 +20676,8 @@ "format": { "enum": [ "csv", - "dict" + "dict", + "sql" ], "default": "dict" }, @@ -21868,12 +20738,6 @@ "type": "string" } }, - "_event_status": { - "type": "object", - "propertyNames": { - "type": "string" - } - }, "description": { "type": "string", "default": "" @@ -21983,6 +20847,80 @@ } ], "default": null + }, + "created_at": { + "type": "number" + }, + "versions": { + "anyOf": [ + { + "type": "object", + "title": "UnitTestNodeVersions", + "properties": { + "include": { + "anyOf": [ + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "number" + } + ] + } + }, + { + "type": "null" + } + ], + "default": null + }, + "exclude": { + "anyOf": [ + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "number" + } + ] + } + }, + { + "type": "null" + } + ], + "default": null + } + }, + "additionalProperties": false + }, + { + "type": "null" + } + ], + "default": null + }, + "version": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "number" + }, + { + "type": "null" + } + ], + "default": null } }, "additionalProperties": false, diff --git a/tests/functional/artifacts/expected_manifest.py b/tests/functional/artifacts/expected_manifest.py index eb010780334..68e7799182b 100644 --- a/tests/functional/artifacts/expected_manifest.py +++ b/tests/functional/artifacts/expected_manifest.py @@ -282,6 +282,7 @@ def expected_seeded_manifest(project, model_database=None, quote_model=False): "database": model_database, "alias": "model", "description": "The test model", + "primary_key": ["id"], "columns": { "id": { "name": "id", @@ -374,6 +375,7 @@ def expected_seeded_manifest(project, model_database=None, quote_model=False): "database": project.database, "alias": "second_model", "description": "The second test model", + "primary_key": [], "columns": { "id": { "name": "id", @@ -924,6 +926,7 @@ def expected_references_manifest(project): }, "deprecation_date": None, "description": "", + "primary_key": [], "docs": {"node_color": None, "show": True}, "fqn": ["test", "ephemeral_copy"], "group": None, @@ -989,6 +992,7 @@ def expected_references_manifest(project): }, "deprecation_date": None, "description": "A summmary table of the ephemeral copy of the seed data", + "primary_key": [], "docs": {"node_color": None, "show": True}, "fqn": ["test", "ephemeral_summary"], "group": "test_group", @@ -1057,6 +1061,7 @@ def expected_references_manifest(project): }, "deprecation_date": None, "description": "A view of the summary of the ephemeral copy of the seed data", + "primary_key": [], "docs": {"node_color": None, "show": True}, "fqn": ["test", "view_summary"], "group": None, @@ -1502,6 +1507,7 @@ def expected_versions_manifest(project): "sources": [], "depends_on": {"macros": [], "nodes": []}, "description": "A versioned model", + "primary_key": ["count", "first_name"], "deprecation_date": ANY, "docs": {"node_color": None, "show": True}, "fqn": ["test", "versioned_model", "v1"], @@ -1572,6 +1578,7 @@ def expected_versions_manifest(project): "sources": [], "depends_on": {"macros": [], "nodes": []}, "description": "A versioned model", + "primary_key": ["first_name"], "deprecation_date": None, "docs": {"node_color": None, "show": True}, "fqn": ["test", "versioned_model", "v2"], @@ -1625,6 +1632,7 @@ def expected_versions_manifest(project): }, "deprecation_date": None, "description": "", + "primary_key": [], "docs": {"node_color": None, "show": True}, "fqn": ["test", "ref_versioned_model"], "group": None, diff --git a/tests/functional/primary_keys/fixtures.py b/tests/functional/primary_keys/fixtures.py new file mode 100644 index 00000000000..888e9d65190 --- /dev/null +++ b/tests/functional/primary_keys/fixtures.py @@ -0,0 +1,88 @@ +simple_model_sql = """ +select 1 as id, 'blue' as color +""" + +simple_model_unique_test = """ +models: + - name: simple_model + columns: + - name: id + tests: + - unique +""" + +simple_model_disabled_unique_test = """ +models: + - name: simple_model + columns: + - name: id + tests: + - unique: + enabled: false + +""" + +simple_model_unique_not_null_tests = """ +models: + - name: simple_model + columns: + - name: id + tests: + - unique + - not_null +""" + +simple_model_unique_combo_of_columns = """ +models: + - name: simple_model + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: [id, color] +""" + +simple_model_constraints = """ +models: + - name: simple_model + config: + contract: + enforced: true + columns: + - name: id + data_type: int + constraints: + - type: not_null + - type: primary_key + - name: color + data_type: text +""" + +simple_model_two_versions_both_configured = """ +models: + - name: simple_model + latest_version: 1 + columns: + - name: id + tests: + - unique + - not_null + versions: + - v: 1 + - v: 2 +""" + +simple_model_two_versions_exclude_col = """ +models: + - name: simple_model + latest_version: 1 + columns: + - name: id + tests: + - unique + - not_null + versions: + - v: 1 + - v: 2 + columns: + - include: all + exclude: [id] +""" diff --git a/tests/functional/primary_keys/test_primary_keys.py b/tests/functional/primary_keys/test_primary_keys.py new file mode 100644 index 00000000000..866ff2967ce --- /dev/null +++ b/tests/functional/primary_keys/test_primary_keys.py @@ -0,0 +1,157 @@ +import pytest + +from dbt.tests.util import get_manifest, run_dbt +from tests.functional.primary_keys.fixtures import ( + simple_model_constraints, + simple_model_disabled_unique_test, + simple_model_sql, + simple_model_two_versions_both_configured, + simple_model_two_versions_exclude_col, + simple_model_unique_combo_of_columns, + simple_model_unique_not_null_tests, + simple_model_unique_test, +) + + +class TestSimpleModelNoYml: + @pytest.fixture(scope="class") + def models(self): + return { + "simple_model.sql": simple_model_sql, + } + + def test_simple_model_no_yml(self, project): + run_dbt(["deps"]) + run_dbt(["run"]) + manifest = get_manifest(project.project_root) + node = manifest.nodes["model.test.simple_model"] + assert node.primary_key == [] + + +class TestSimpleModelConstraints: + @pytest.fixture(scope="class") + def models(self): + return { + "simple_model.sql": simple_model_sql, + "schema.yml": simple_model_constraints, + } + + def test_simple_model_constraints(self, project): + run_dbt(["deps"]) + run_dbt(["run"]) + manifest = get_manifest(project.project_root) + node = manifest.nodes["model.test.simple_model"] + assert node.primary_key == ["id"] + + +class TestSimpleModelUniqueNotNullTests: + @pytest.fixture(scope="class") + def models(self): + return { + "simple_model.sql": simple_model_sql, + "schema.yml": simple_model_unique_not_null_tests, + } + + def test_simple_model_unique_not_null_tests(self, project): + run_dbt(["deps"]) + run_dbt(["run"]) + manifest = get_manifest(project.project_root) + node = manifest.nodes["model.test.simple_model"] + assert node.primary_key == ["id"] + + +class TestSimpleModelUniqueTests: + @pytest.fixture(scope="class") + def models(self): + return { + "simple_model.sql": simple_model_sql, + "schema.yml": simple_model_unique_test, + } + + def test_simple_model_unique_test(self, project): + run_dbt(["deps"]) + run_dbt(["run"]) + manifest = get_manifest(project.project_root) + node = manifest.nodes["model.test.simple_model"] + assert node.primary_key == ["id"] + + +class TestSimpleModelDisabledUniqueTests: + @pytest.fixture(scope="class") + def models(self): + return { + "simple_model.sql": simple_model_sql, + "schema.yml": simple_model_disabled_unique_test, + } + + def test_simple_model_disabled_unique_test(self, project): + run_dbt(["deps"]) + run_dbt(["run"]) + manifest = get_manifest(project.project_root) + node = manifest.nodes["model.test.simple_model"] + assert node.primary_key == ["id"] + + +class TestVersionedSimpleModel: + @pytest.fixture(scope="class") + def models(self): + return { + "simple_model_v1.sql": simple_model_sql, + "simple_model_v2.sql": simple_model_sql, + "schema.yml": simple_model_two_versions_both_configured, + } + + def test_versioned_simple_model(self, project): + run_dbt(["deps"]) + run_dbt(["run"]) + manifest = get_manifest(project.project_root) + node_v1 = manifest.nodes["model.test.simple_model.v1"] + node_v2 = manifest.nodes["model.test.simple_model.v2"] + assert node_v1.primary_key == ["id"] + assert node_v2.primary_key == ["id"] + + +class TestVersionedSimpleModelExcludeTests: + @pytest.fixture(scope="class") + def models(self): + return { + "simple_model_v1.sql": simple_model_sql, + "simple_model_v2.sql": simple_model_sql, + "schema.yml": simple_model_two_versions_exclude_col, + } + + def test_versioned_simple_model_exclude_col(self, project): + run_dbt(["deps"]) + run_dbt(["run"]) + manifest = get_manifest(project.project_root) + node_v1 = manifest.nodes["model.test.simple_model.v1"] + node_v2 = manifest.nodes["model.test.simple_model.v2"] + assert node_v1.primary_key == ["id"] + assert node_v2.primary_key == [] + + +class TestSimpleModelCombinationOfColumns: + @pytest.fixture(scope="class") + def packages(self): + return { + "packages": [ + { + "git": "https://github.com/dbt-labs/dbt-utils.git", + "revision": "1.1.0", + }, + ] + } + + @pytest.fixture(scope="class") + def models(self): + return { + "simple_model.sql": simple_model_sql, + "schema.yml": simple_model_unique_combo_of_columns, + } + + def test_versioned_simple_combo_of_columns(self, project): + run_dbt(["deps"]) + run_dbt(["run"]) + manifest = get_manifest(project.project_root) + node = manifest.nodes["model.test.simple_model"] + assert node.primary_key == ["color", "id"] diff --git a/tests/unit/contracts/graph/test_manifest.py b/tests/unit/contracts/graph/test_manifest.py index 7f53951bdeb..4d19a269f71 100644 --- a/tests/unit/contracts/graph/test_manifest.py +++ b/tests/unit/contracts/graph/test_manifest.py @@ -74,6 +74,7 @@ "raw_code", "language", "description", + "primary_key", "columns", "fqn", "build_path", diff --git a/tests/unit/fixtures.py b/tests/unit/fixtures.py index 5cd18f49bc0..cfcc1636b18 100644 --- a/tests/unit/fixtures.py +++ b/tests/unit/fixtures.py @@ -26,6 +26,7 @@ def model_node(): metrics=[], depends_on=DependsOn(), description="", + primary_key=[], database="test_db", schema="test_schema", alias="bar", diff --git a/tests/unit/test_contracts_graph_compiled.py b/tests/unit/test_contracts_graph_compiled.py index e345899e4d6..e0228cc28f6 100644 --- a/tests/unit/test_contracts_graph_compiled.py +++ b/tests/unit/test_contracts_graph_compiled.py @@ -149,6 +149,7 @@ def basic_compiled_dict(): "depends_on": {"macros": [], "nodes": []}, "database": "test_db", "description": "", + "primary_key": [], "schema": "test_schema", "alias": "bar", "tags": [], diff --git a/tests/unit/test_contracts_graph_parsed.py b/tests/unit/test_contracts_graph_parsed.py index 3a1861af462..7a62c394b22 100644 --- a/tests/unit/test_contracts_graph_parsed.py +++ b/tests/unit/test_contracts_graph_parsed.py @@ -167,6 +167,7 @@ def base_parsed_model_dict(): "depends_on": {"macros": [], "nodes": []}, "database": "test_db", "description": "", + "primary_key": [], "schema": "test_schema", "alias": "bar", "tags": [], @@ -220,6 +221,7 @@ def basic_parsed_model_object(): metrics=[], depends_on=DependsOn(), description="", + primary_key=[], database="test_db", schema="test_schema", alias="bar", @@ -274,6 +276,7 @@ def complex_parsed_model_dict(): "depends_on": {"macros": [], "nodes": ["model.test.bar"]}, "database": "test_db", "description": "My parsed node", + "primary_key": [], "schema": "test_schema", "alias": "bar", "tags": ["tag"],