From 6484bab997d3148b918b851c2079411d0a149e5f Mon Sep 17 00:00:00 2001 From: Alice Jia Qi Liu Date: Wed, 24 Jul 2024 19:10:13 -0700 Subject: [PATCH 01/17] Generate dbt_yml_files from pydantic classes --- .gitignore | 3 +- pyproject.toml | 28 + .../dbt_yml_files-latest-generated.json | 4711 +++++++++++++++++ schemas/latest/dbt_yml_files-latest.json | 84 +- src/generate.py | 19 + src/latest/dbt_yml_files.py | 1012 ++++ tests/latest/valid/dbt_yml_files.yml | 25 + 7 files changed, 5839 insertions(+), 43 deletions(-) create mode 100644 pyproject.toml create mode 100644 schemas/latest-generated/dbt_yml_files-latest-generated.json create mode 100644 src/generate.py create mode 100644 src/latest/dbt_yml_files.py diff --git a/.gitignore b/.gitignore index 074bbde..873a2cb 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ .DS_Store node_modules/ -.venv \ No newline at end of file +.venv +__pycache__ \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..598d133 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,28 @@ +[build-system] +requires = ["hatchling"] +build-backend = "hatchling.build" + +[project] +name = "dbt-jsonschema" +version = "0.1.0" +description = '' +readme = "README.md" +requires-python = ">=3.11" +keywords = [] +classifiers = [ + "Development Status :: 4 - Beta", + "Programming Language :: Python", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: Implementation :: CPython", + "Programming Language :: Python :: Implementation :: PyPy", +] +dependencies = ["pydantic >=2.8.0, <3.0.0"] + +[project.urls] +Documentation = "https://github.com/dbt-labs/dbt-jsonschema/blob/main/README.md" +Issues = "https://github.com/dbt-labs/dbt-jsonschema/issues" +Source = "https://github.com/dbt-labs/dbt-jsonschema" + +[tool.hatch.envs.types] +extra-dependencies = ["mypy>=1.0.0"] diff --git a/schemas/latest-generated/dbt_yml_files-latest-generated.json b/schemas/latest-generated/dbt_yml_files-latest-generated.json new file mode 100644 index 0000000..2f0fcf2 --- /dev/null +++ b/schemas/latest-generated/dbt_yml_files-latest-generated.json @@ -0,0 +1,4711 @@ +{ + "$defs": { + "AcceptedValues": { + "properties": { + "name": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Name" + }, + "config": { + "anyOf": [ + { + "$ref": "#/$defs/TestConfigs" + }, + { + "type": "null" + } + ], + "default": null + }, + "quote": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Quote" + }, + "values": { + "items": { + "type": "string" + }, + "title": "Values", + "type": "array" + }, + "where": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Where" + } + }, + "required": [ + "values" + ], + "title": "AcceptedValues", + "type": "object" + }, + "AcceptedValuesTest": { + "properties": { + "accepted_values": { + "anyOf": [ + { + "$ref": "#/$defs/AcceptedValues" + }, + { + "type": "null" + } + ], + "default": null + } + }, + "title": "AcceptedValuesTest", + "type": "object" + }, + "Access": { + "enum": [ + "private", + "protected", + "public" + ], + "title": "Access", + "type": "string" + }, + "Agg": { + "enum": [ + "SUM", + "MIN", + "MAX", + "AVG", + "COUNT_DISTINCT", + "SUM_BOOLEAN", + "COUNT", + "PERCENTILE", + "MEDIAN", + "sum", + "min", + "max", + "avg", + "count_distinct", + "sum_boolean", + "count", + "percentile", + "median" + ], + "title": "Agg", + "type": "string" + }, + "AggregationTypeParams": { + "additionalProperties": false, + "properties": { + "percentile": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Percentile" + }, + "use_approximate_percentile": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Use Approximate Percentile" + }, + "use_discrete_percentile": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Use Discrete Percentile" + } + }, + "title": "AggregationTypeParams", + "type": "object" + }, + "Analyse": { + "properties": { + "name": { + "title": "Name", + "type": "string" + }, + "description": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Description" + }, + "columns": { + "anyOf": [ + { + "items": { + "$ref": "#/$defs/Column" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Columns" + }, + "config": { + "anyOf": [ + { + "$ref": "#/$defs/Config" + }, + { + "type": "null" + } + ], + "default": null + }, + "docs": { + "anyOf": [ + { + "$ref": "#/$defs/DocsConfig" + }, + { + "type": "null" + } + ], + "default": null + }, + "group": { + "anyOf": [ + { + "$ref": "#/$defs/GroupName" + }, + { + "type": "null" + } + ], + "default": null + } + }, + "required": [ + "name" + ], + "title": "Analyse", + "type": "object" + }, + "Argument": { + "additionalProperties": false, + "properties": { + "name": { + "title": "Name", + "type": "string" + }, + "description": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Description" + }, + "type": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Type" + } + }, + "required": [ + "name" + ], + "title": "Argument", + "type": "object" + }, + "ArrayOfStrings": { + "items": { + "type": "string" + }, + "title": "ArrayOfStrings", + "type": "array" + }, + "AuthorizedView": { + "additionalProperties": false, + "properties": { + "database": { + "title": "Database", + "type": "string" + }, + "project": { + "title": "Project", + "type": "string" + } + }, + "required": [ + "database", + "project" + ], + "title": "AuthorizedView", + "type": "object" + }, + "BooleanOrJinjaString": { + "anyOf": [ + { + "$ref": "#/$defs/JinjaString" + }, + { + "type": "boolean" + } + ], + "title": "BooleanOrJinjaString" + }, + "Calculation": { + "enum": [ + "conversions", + "conversion_rate", + "CONVERSIONS", + "CONVERSION_RATE" + ], + "title": "Calculation", + "type": "string" + }, + "CategoricalDimension": { + "additionalProperties": false, + "properties": { + "name": { + "pattern": "(?!.*__).*^[a-z][a-z0-9_]*[a-z0-9]$", + "title": "Name", + "type": "string" + }, + "description": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Description" + }, + "expr": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Expr" + }, + "is_partition": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Is Partition" + }, + "type": { + "$ref": "#/$defs/CategoricalDimensionType" + } + }, + "required": [ + "name", + "type" + ], + "title": "CategoricalDimension", + "type": "object" + }, + "CategoricalDimensionType": { + "enum": [ + "CATEGORICAL", + "categorical" + ], + "title": "CategoricalDimensionType", + "type": "string" + }, + "Column": { + "additionalProperties": false, + "properties": { + "name": { + "title": "Name", + "type": "string" + }, + "description": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Description" + }, + "data_type": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Data Type" + } + }, + "required": [ + "name" + ], + "title": "Column", + "type": "object" + }, + "ColumnProperties": { + "additionalProperties": false, + "properties": { + "name": { + "title": "Name", + "type": "string" + }, + "description": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Description" + }, + "constraints": { + "anyOf": [ + { + "$ref": "#/$defs/Constraints" + }, + { + "type": "null" + } + ], + "default": null + }, + "data_tests": { + "anyOf": [ + { + "items": { + "$ref": "#/$defs/DataTests" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Data Tests" + }, + "data_type": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Data Type" + }, + "meta": { + "anyOf": [ + { + "type": "object" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Meta" + }, + "policy_tags": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Configurations, specific to BigQuery adapter, used to set policy tags on specific columns, enabling column-level security. Only relevant when `persist_docs.columns` is true.", + "title": "Policy tags" + }, + "quote": { + "anyOf": [ + { + "$ref": "#/$defs/BooleanOrJinjaString" + }, + { + "type": "null" + } + ], + "default": null + }, + "tags": { + "anyOf": [ + { + "$ref": "#/$defs/StringOrArrayOfStrings" + }, + { + "type": "null" + } + ], + "default": null + }, + "tests": { + "anyOf": [ + { + "items": { + "$ref": "#/$defs/DataTests" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Tests" + } + }, + "required": [ + "name" + ], + "title": "ColumnProperties", + "type": "object" + }, + "Config": { + "additionalProperties": false, + "properties": { + "tags": { + "anyOf": [ + { + "$ref": "#/$defs/StringOrArrayOfStrings" + }, + { + "type": "null" + } + ], + "default": null + } + }, + "title": "Config", + "type": "object" + }, + "ConstantProperty": { + "properties": { + "base_property": { + "description": "DIMENSION or ENTITY", + "title": "Base Property", + "type": "string" + }, + "conversion_property": { + "description": "DIMENSION or ENTITY", + "title": "Conversion Property", + "type": "string" + } + }, + "required": [ + "base_property", + "conversion_property" + ], + "title": "ConstantProperty", + "type": "object" + }, + "Constraint": { + "properties": { + "name": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Name" + }, + "type": { + "title": "Type", + "type": "string" + }, + "columns": { + "anyOf": [ + { + "$ref": "#/$defs/StringOrArrayOfStrings" + }, + { + "type": "null" + } + ], + "default": null + }, + "expression": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Expression" + }, + "warn_unenforced": { + "anyOf": [ + { + "$ref": "#/$defs/BooleanOrJinjaString" + }, + { + "type": "null" + } + ], + "default": null + }, + "warn_unsupported": { + "anyOf": [ + { + "$ref": "#/$defs/BooleanOrJinjaString" + }, + { + "type": "null" + } + ], + "default": null + } + }, + "required": [ + "type" + ], + "title": "Constraint", + "type": "object" + }, + "Constraints": { + "items": { + "$ref": "#/$defs/Constraint" + }, + "title": "Constraints", + "type": "array" + }, + "Contract": { + "properties": { + "enforced": { + "anyOf": [ + { + "$ref": "#/$defs/BooleanOrJinjaString" + }, + { + "type": "null" + } + ], + "default": null + } + }, + "title": "Contract", + "type": "object" + }, + "ConversionMetric": { + "additionalProperties": false, + "properties": { + "name": { + "pattern": "(?!.*__).*^[a-z][a-z0-9_]*[a-z0-9]$", + "title": "Name", + "type": "string" + }, + "description": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Description" + }, + "filter": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Filter" + }, + "group": { + "anyOf": [ + { + "$ref": "#/$defs/GroupName" + }, + { + "type": "null" + } + ], + "default": null + }, + "label": { + "title": "Label", + "type": "string" + }, + "type": { + "$ref": "#/$defs/ConversionMetricType" + }, + "type_params": { + "$ref": "#/$defs/ConversionMetricTypeParams" + } + }, + "required": [ + "name", + "label", + "type", + "type_params" + ], + "title": "ConversionMetric", + "type": "object" + }, + "ConversionMetricType": { + "enum": [ + "CONVERSION", + "conversion" + ], + "title": "ConversionMetricType", + "type": "string" + }, + "ConversionMetricTypeParams": { + "additionalProperties": false, + "properties": { + "conversion_type_params": { + "anyOf": [ + { + "$ref": "#/$defs/ConversionTypeParams" + }, + { + "type": "null" + } + ], + "default": null + } + }, + "title": "ConversionMetricTypeParams", + "type": "object" + }, + "ConversionTypeParams": { + "additionalProperties": false, + "properties": { + "base_measure": { + "$ref": "#/$defs/MetricInputMeasure" + }, + "calculation": { + "anyOf": [ + { + "$ref": "#/$defs/Calculation" + }, + { + "type": "null" + } + ], + "default": "conversion_rate" + }, + "constant_properties": { + "anyOf": [ + { + "items": { + "$ref": "#/$defs/ConstantProperty" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Constant Properties" + }, + "conversion_measure": { + "$ref": "#/$defs/MetricInputMeasure" + }, + "entity": { + "description": "The entity to calculate over", + "title": "Entity", + "type": "string" + }, + "window": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Window" + } + }, + "required": [ + "base_measure", + "conversion_measure", + "entity" + ], + "title": "ConversionTypeParams", + "type": "object" + }, + "CumulativeMetric": { + "additionalProperties": false, + "properties": { + "name": { + "pattern": "(?!.*__).*^[a-z][a-z0-9_]*[a-z0-9]$", + "title": "Name", + "type": "string" + }, + "description": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Description" + }, + "filter": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Filter" + }, + "group": { + "anyOf": [ + { + "$ref": "#/$defs/GroupName" + }, + { + "type": "null" + } + ], + "default": null + }, + "label": { + "title": "Label", + "type": "string" + }, + "type": { + "$ref": "#/$defs/CumulativeMetricType" + }, + "type_params": { + "$ref": "#/$defs/CumulativeMetricTypeParams" + } + }, + "required": [ + "name", + "label", + "type", + "type_params" + ], + "title": "CumulativeMetric", + "type": "object" + }, + "CumulativeMetricType": { + "enum": [ + "CUMULATIVE", + "cumulative" + ], + "title": "CumulativeMetricType", + "type": "string" + }, + "CumulativeMetricTypeParams": { + "additionalProperties": false, + "properties": { + "grain_to_date": { + "anyOf": [ + { + "$ref": "#/$defs/GrainToDate" + }, + { + "type": "null" + } + ], + "default": null + }, + "measure": { + "anyOf": [ + { + "$ref": "#/$defs/MetricInputMeasure" + }, + { + "type": "null" + } + ], + "default": null + }, + "window": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Window" + } + }, + "title": "CumulativeMetricTypeParams", + "type": "object" + }, + "DataTests": { + "anyOf": [ + { + "type": "string" + }, + { + "$ref": "#/$defs/RelationshipsTest" + }, + { + "$ref": "#/$defs/AcceptedValuesTest" + }, + { + "$ref": "#/$defs/NotNullTest" + }, + { + "$ref": "#/$defs/UniqueTest" + } + ], + "title": "DataTests" + }, + "Defaults": { + "additionalProperties": false, + "properties": { + "agg_time_dimension": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Agg Time Dimension" + } + }, + "title": "Defaults", + "type": "object" + }, + "DerivedMetric": { + "additionalProperties": false, + "properties": { + "name": { + "pattern": "(?!.*__).*^[a-z][a-z0-9_]*[a-z0-9]$", + "title": "Name", + "type": "string" + }, + "description": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Description" + }, + "filter": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Filter" + }, + "group": { + "anyOf": [ + { + "$ref": "#/$defs/GroupName" + }, + { + "type": "null" + } + ], + "default": null + }, + "label": { + "title": "Label", + "type": "string" + }, + "type": { + "$ref": "#/$defs/DerivedMetricType" + }, + "type_params": { + "$ref": "#/$defs/DerivedMetricTypeParams" + } + }, + "required": [ + "name", + "label", + "type", + "type_params" + ], + "title": "DerivedMetric", + "type": "object" + }, + "DerivedMetricType": { + "enum": [ + "DERIVED", + "derived" + ], + "title": "DerivedMetricType", + "type": "string" + }, + "DerivedMetricTypeParams": { + "additionalProperties": false, + "properties": { + "expr": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Expr" + }, + "metrics": { + "anyOf": [ + { + "items": { + "$ref": "#/$defs/MetricInputSchema" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Metrics" + } + }, + "title": "DerivedMetricTypeParams", + "type": "object" + }, + "Dimension": { + "anyOf": [ + { + "$ref": "#/$defs/CategoricalDimension" + }, + { + "$ref": "#/$defs/TimeDimension" + } + ], + "title": "Dimension" + }, + "DimensionTypeParams": { + "additionalProperties": false, + "properties": { + "time_granularity": { + "$ref": "#/$defs/TimeGranularity" + }, + "validity_params": { + "anyOf": [ + { + "$ref": "#/$defs/ValidityParams" + }, + { + "type": "null" + } + ], + "default": null + } + }, + "required": [ + "time_granularity" + ], + "title": "DimensionTypeParams", + "type": "object" + }, + "DocsConfig": { + "additionalProperties": false, + "properties": { + "node_color": { + "anyOf": [ + { + "pattern": "^(#[a-fA-F0-9]{3}|#[a-fA-F0-9]{6}|[^#][a-zA-Z]*)$", + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "The color of the node on the DAG in the documentation. It must be an Hex code or a valid CSS color name.", + "title": "Node Color" + }, + "show": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "default": true, + "title": "Show" + } + }, + "title": "DocsConfig", + "type": "object" + }, + "Entity": { + "additionalProperties": false, + "properties": { + "name": { + "pattern": "(?!.*__).*^[a-z][a-z0-9_]*[a-z0-9]$", + "title": "Name", + "type": "string" + }, + "type": { + "allOf": [ + { + "$ref": "#/$defs/EntityType" + } + ], + "title": "Entity Type" + }, + "entity": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Entity" + }, + "expr": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Expr" + } + }, + "required": [ + "name", + "type" + ], + "title": "Entity", + "type": "object" + }, + "EntityType": { + "enum": [ + "PRIMARY", + "UNIQUE", + "FOREIGN", + "NATURAL", + "primary", + "unique", + "foreign", + "natural" + ], + "title": "EntityType", + "type": "string" + }, + "ExpectCSV": { + "properties": { + "format": { + "const": "csv", + "default": "csv", + "enum": [ + "csv" + ], + "title": "Format", + "type": "string" + }, + "rows": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "When `format` is csv or sql, a string containing comma-separated headers and values. Alternatively provide a fixture. Use the pipe character | to create a multi-line string in YAML.", + "title": "Rows" + }, + "fixture": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Specify the name of a fixture instead of providing `rows`.", + "title": "Fixture" + } + }, + "title": "ExpectCSV", + "type": "object" + }, + "ExpectDict": { + "properties": { + "format": { + "const": "dict", + "default": "dict", + "enum": [ + "dict" + ], + "title": "Format", + "type": "string" + }, + "rows": { + "description": "When `format` is `dict`, each item should be a dictionary containing a key-value pair for each column and its value, e.g. `{id: 1, code: 'ABC'}`", + "items": { + "type": "object" + }, + "title": "Rows", + "type": "array" + } + }, + "required": [ + "rows" + ], + "title": "ExpectDict", + "type": "object" + }, + "ExpectSQL": { + "properties": { + "format": { + "const": "sql", + "default": "sql", + "enum": [ + "sql" + ], + "title": "Format", + "type": "string" + }, + "rows": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "When `format` is csv or sql, a string containing comma-separated headers and values. Alternatively provide a fixture. Use the pipe character | to create a multi-line string in YAML.", + "title": "Rows" + }, + "fixture": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Specify the name of a fixture instead of providing `rows`.", + "title": "Fixture" + } + }, + "title": "ExpectSQL", + "type": "object" + }, + "Export": { + "additionalProperties": false, + "properties": { + "name": { + "title": "Name", + "type": "string" + }, + "config": { + "anyOf": [ + { + "$ref": "#/$defs/ExportConfig" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Export Config" + } + }, + "required": [ + "name" + ], + "title": "Export", + "type": "object" + }, + "ExportAs": { + "enum": [ + "table", + "view", + "cache" + ], + "title": "ExportAs", + "type": "string" + }, + "ExportConfig": { + "additionalProperties": true, + "properties": { + "alias": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Alias" + }, + "export_as": { + "anyOf": [ + { + "$ref": "#/$defs/ExportAs" + }, + { + "type": "null" + } + ], + "default": null + }, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Schema" + } + }, + "title": "ExportConfig", + "type": "object" + }, + "Exposure": { + "properties": { + "name": { + "title": "Name", + "type": "string" + }, + "description": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Description" + }, + "type": { + "$ref": "#/$defs/Type" + }, + "depends_on": { + "items": { + "type": "string" + }, + "title": "Depends On", + "type": "array" + }, + "label": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Label" + }, + "maturity": { + "anyOf": [ + { + "$ref": "#/$defs/Maturity" + }, + { + "type": "null" + } + ], + "default": null + }, + "meta": { + "anyOf": [ + { + "type": "object" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Meta" + }, + "owner": { + "anyOf": [ + { + "$ref": "#/$defs/OwnerWithEmail" + }, + { + "$ref": "#/$defs/OwnerWithName" + } + ], + "title": "Owner" + }, + "tags": { + "anyOf": [ + { + "$ref": "#/$defs/StringOrArrayOfStrings" + }, + { + "type": "null" + } + ], + "default": null + }, + "url": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Url" + } + }, + "required": [ + "name", + "type", + "depends_on", + "owner" + ], + "title": "Exposure", + "type": "object" + }, + "Format": { + "enum": [ + "csv", + "dict", + "sql" + ], + "title": "Format", + "type": "string" + }, + "FreshnessDefinition": { + "anyOf": [ + { + "$ref": "#/$defs/FreshnessDefinition1" + }, + { + "type": "null" + } + ], + "title": "FreshnessDefinition" + }, + "FreshnessDefinition1": { + "additionalProperties": false, + "properties": { + "error_after": { + "anyOf": [ + { + "$ref": "#/$defs/FreshnessRules" + }, + { + "type": "null" + } + ], + "default": null + }, + "filter": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Filter" + }, + "warn_after": { + "anyOf": [ + { + "$ref": "#/$defs/FreshnessRules" + }, + { + "type": "null" + } + ], + "default": null + } + }, + "title": "FreshnessDefinition1", + "type": "object" + }, + "FreshnessRules": { + "additionalProperties": false, + "properties": { + "count": { + "$ref": "#/$defs/NumberOrJinjaString" + }, + "period": { + "$ref": "#/$defs/Period" + } + }, + "required": [ + "count", + "period" + ], + "title": "FreshnessRules", + "type": "object" + }, + "GivenItem": { + "properties": { + "fixture": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Only relevant when format is csv. Specify the name of a fixture instead of providing `rows`.", + "title": "Fixture" + }, + "format": { + "anyOf": [ + { + "$ref": "#/$defs/Format" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Defaults to `dict` when not specified" + }, + "input": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "The relation whose inputs you need to mock. Enclose in ref or source without curly braces", + "examples": [ + "ref('model_b')", + "ref('upstream_project', 'model_b')", + "source('schema', 'table')" + ], + "title": "Input" + }, + "additionalProperties": { + "anyOf": [ + {}, + { + "type": "null" + } + ], + "default": null, + "title": "Additionalproperties" + } + }, + "title": "GivenItem", + "type": "object" + }, + "GrainToDate": { + "enum": [ + "day", + "week", + "month", + "quarter", + "year" + ], + "title": "GrainToDate", + "type": "string" + }, + "Grants": { + "additionalProperties": { + "$ref": "#/$defs/StringOrArrayOfStrings" + }, + "description": "grant config. each key is a database permission and the value is the grantee of that permission", + "title": "Grants", + "type": "object" + }, + "Group": { + "additionalProperties": false, + "properties": { + "name": { + "title": "Name", + "type": "string" + }, + "owner": { + "anyOf": [ + { + "$ref": "#/$defs/OwnerWithEmail" + }, + { + "$ref": "#/$defs/OwnerWithName" + } + ], + "title": "Owner" + } + }, + "required": [ + "name", + "owner" + ], + "title": "Group", + "type": "object" + }, + "GroupName": { + "title": "GroupName", + "type": "string" + }, + "IncludeExclude": { + "properties": { + "exclude": { + "anyOf": [ + { + "$ref": "#/$defs/StringOrArrayOfStrings" + }, + { + "type": "null" + } + ], + "default": null + }, + "include": { + "anyOf": [ + { + "$ref": "#/$defs/StringOrArrayOfStrings" + }, + { + "type": "null" + } + ], + "default": null + } + }, + "title": "IncludeExclude", + "type": "object" + }, + "JinjaString": { + "pattern": "\\{\\{.*\\}\\}", + "title": "JinjaString", + "type": "string" + }, + "Macro": { + "additionalProperties": false, + "properties": { + "name": { + "title": "Name", + "type": "string" + }, + "description": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Description" + }, + "arguments": { + "anyOf": [ + { + "items": { + "$ref": "#/$defs/Argument" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Arguments" + }, + "docs": { + "anyOf": [ + { + "$ref": "#/$defs/DocsConfig" + }, + { + "type": "null" + } + ], + "default": null + } + }, + "required": [ + "name" + ], + "title": "Macro", + "type": "object" + }, + "Maturity": { + "enum": [ + "high", + "medium", + "low" + ], + "title": "Maturity", + "type": "string" + }, + "Measure": { + "additionalProperties": false, + "properties": { + "name": { + "pattern": "(?!.*__).*^[a-z][a-z0-9_]*[a-z0-9]$", + "title": "Name", + "type": "string" + }, + "description": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Description" + }, + "agg": { + "$ref": "#/$defs/Agg" + }, + "agg_params": { + "anyOf": [ + { + "$ref": "#/$defs/AggregationTypeParams" + }, + { + "type": "null" + } + ], + "default": null + }, + "agg_time_dimension": { + "anyOf": [ + { + "pattern": "(?!.*__).*^[a-z][a-z0-9_]*[a-z0-9]$", + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Agg Time Dimension" + }, + "create_metric": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Create Metric" + }, + "create_metric_display_name": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Create Metric Display Name" + }, + "expr": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "integer" + }, + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Expr" + }, + "label": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Label" + }, + "non_additive_dimension": { + "anyOf": [ + { + "$ref": "#/$defs/NonAdditiveDimension" + }, + { + "type": "null" + } + ], + "default": null + } + }, + "required": [ + "name", + "agg" + ], + "title": "Measure", + "type": "object" + }, + "MetricInputMeasure": { + "additionalProperties": false, + "properties": { + "name": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Name" + }, + "fill_nulls_with": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "integer" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Fill Nulls With" + }, + "filter": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Filter" + }, + "join_to_timespine": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Join To Timespine" + } + }, + "title": "MetricInputMeasure", + "type": "object" + }, + "MetricInputSchema": { + "additionalProperties": false, + "properties": { + "name": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Name" + }, + "alias": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Alias" + }, + "filter": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Filter" + }, + "offset_window": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Offset Window" + } + }, + "title": "MetricInputSchema", + "type": "object" + }, + "Model": { + "additionalProperties": false, + "properties": { + "name": { + "title": "Name", + "type": "string" + }, + "description": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Description" + }, + "access": { + "anyOf": [ + { + "$ref": "#/$defs/Access" + }, + { + "type": "null" + } + ], + "default": null + }, + "columns": { + "anyOf": [ + { + "items": { + "$ref": "#/$defs/ColumnProperties" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Columns" + }, + "config": { + "anyOf": [ + { + "$ref": "#/$defs/ModelConfigs" + }, + { + "type": "null" + } + ], + "default": null + }, + "constraints": { + "anyOf": [ + { + "$ref": "#/$defs/Constraints" + }, + { + "type": "null" + } + ], + "default": null + }, + "data_tests": { + "anyOf": [ + { + "items": { + "$ref": "#/$defs/DataTests" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Data Tests" + }, + "deprecation_date": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Deprecation Date" + }, + "docs": { + "anyOf": [ + { + "$ref": "#/$defs/DocsConfig" + }, + { + "type": "null" + } + ], + "default": null + }, + "group": { + "anyOf": [ + { + "$ref": "#/$defs/GroupName" + }, + { + "type": "null" + } + ], + "default": null + }, + "latest_version": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Latest Version" + }, + "meta": { + "anyOf": [ + { + "type": "object" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Meta" + }, + "tests": { + "anyOf": [ + { + "items": { + "$ref": "#/$defs/DataTests" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Tests" + }, + "versions": { + "anyOf": [ + { + "items": { + "$ref": "#/$defs/Version" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Versions" + } + }, + "required": [ + "name" + ], + "title": "Model", + "type": "object" + }, + "ModelConfigs": { + "properties": { + "auto_refresh": { + "anyOf": [ + { + "$ref": "#/$defs/BooleanOrJinjaString" + }, + { + "type": "null" + } + ], + "default": null + }, + "backup": { + "anyOf": [ + { + "$ref": "#/$defs/BooleanOrJinjaString" + }, + { + "type": "null" + } + ], + "default": null + }, + "contract": { + "anyOf": [ + { + "$ref": "#/$defs/Contract" + }, + { + "type": "null" + } + ], + "default": null + }, + "file_format": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "File Format" + }, + "grant_access_to": { + "anyOf": [ + { + "items": { + "$ref": "#/$defs/AuthorizedView" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Configuration, specific to BigQuery adapter, used to setup authorized views.", + "title": "Authorized views" + }, + "grants": { + "anyOf": [ + { + "$ref": "#/$defs/Grants" + }, + { + "type": "null" + } + ], + "default": null + }, + "hours_to_expiration": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Configuration specific to BigQuery adapter used to set an expiration delay (in hours) to a table.", + "title": "Hours To Expiration" + }, + "kms_key_name": { + "anyOf": [ + { + "pattern": "projects/[a-zA-Z0-9_-]*/locations/[a-zA-Z0-9_-]*/keyRings/.*/cryptoKeys/.*", + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Configuration of the KMS key name, specific to BigQuery adapter.", + "title": "Kms Key Name" + }, + "labels": { + "anyOf": [ + { + "additionalProperties": { + "type": "string" + }, + "type": "object" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Configuration specific to BigQuery adapter used to add labels and tags to tables/views created by dbt.", + "title": "Label configs" + }, + "location": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Location" + }, + "materialized": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Materialized" + }, + "on_configuration_change": { + "anyOf": [ + { + "$ref": "#/$defs/OnConfigurationChange" + }, + { + "type": "null" + } + ], + "default": null + }, + "on_schema_change": { + "anyOf": [ + { + "$ref": "#/$defs/OnSchemaChange" + }, + { + "type": "null" + } + ], + "default": null + }, + "snowflake_warehouse": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Snowflake Warehouse" + }, + "sql_header": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Sql Header" + }, + "target_lag": { + "anyOf": [ + { + "pattern": "^(?:downstream|\\d+\\s*(?:seconds|minutes|hours|days))$", + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Target Lag" + } + }, + "title": "ModelConfigs", + "type": "object" + }, + "NonAdditiveDimension": { + "additionalProperties": false, + "properties": { + "name": { + "title": "Name", + "type": "string" + }, + "window_choice": { + "anyOf": [ + { + "$ref": "#/$defs/WindowChoice" + }, + { + "type": "null" + } + ], + "default": null + }, + "window_groupings": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Window Groupings" + } + }, + "required": [ + "name" + ], + "title": "NonAdditiveDimension", + "type": "object" + }, + "NotNull": { + "properties": { + "name": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Name" + }, + "config": { + "anyOf": [ + { + "$ref": "#/$defs/TestConfigs" + }, + { + "type": "null" + } + ], + "default": null + }, + "where": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Where" + } + }, + "title": "NotNull", + "type": "object" + }, + "NotNullTest": { + "properties": { + "not_null": { + "anyOf": [ + { + "$ref": "#/$defs/NotNull" + }, + { + "type": "null" + } + ], + "default": null + } + }, + "title": "NotNullTest", + "type": "object" + }, + "NumberOrJinjaString": { + "anyOf": [ + { + "$ref": "#/$defs/JinjaString" + }, + { + "type": "number" + } + ], + "title": "NumberOrJinjaString" + }, + "OnConfigurationChange": { + "enum": [ + "apply", + "continue", + "fail" + ], + "title": "OnConfigurationChange", + "type": "string" + }, + "OnSchemaChange": { + "enum": [ + "append_new_columns", + "fail", + "ignore", + "sync_all_columns" + ], + "title": "OnSchemaChange", + "type": "string" + }, + "Overrides": { + "additionalProperties": false, + "properties": { + "env_vars": { + "anyOf": [ + { + "type": "object" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Env Vars" + }, + "macros": { + "anyOf": [ + { + "type": "object" + }, + { + "type": "null" + } + ], + "default": null, + "examples": [ + { + "is_incremental": "true" + } + ], + "title": "Macros" + }, + "vars": { + "anyOf": [ + { + "type": "object" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Vars" + } + }, + "title": "Overrides", + "type": "object" + }, + "OwnerWithEmail": { + "additionalProperties": false, + "properties": { + "email": { + "title": "Email", + "type": "string" + } + }, + "required": [ + "email" + ], + "title": "OwnerWithEmail", + "type": "object" + }, + "OwnerWithName": { + "additionalProperties": false, + "properties": { + "name": { + "title": "Name", + "type": "string" + } + }, + "required": [ + "name" + ], + "title": "OwnerWithName", + "type": "object" + }, + "Period": { + "enum": [ + "minute", + "hour", + "day" + ], + "title": "Period", + "type": "string" + }, + "PersistDocsConfig": { + "additionalProperties": false, + "properties": { + "columns": { + "anyOf": [ + { + "$ref": "#/$defs/BooleanOrJinjaString" + }, + { + "type": "null" + } + ] + }, + "relation": { + "anyOf": [ + { + "$ref": "#/$defs/BooleanOrJinjaString" + }, + { + "type": "null" + } + ] + } + }, + "title": "PersistDocsConfig", + "type": "object" + }, + "QueryParams": { + "properties": { + "dimensions": { + "anyOf": [ + { + "$ref": "#/$defs/ArrayOfStrings" + }, + { + "type": "null" + } + ], + "default": null + }, + "metrics": { + "anyOf": [ + { + "$ref": "#/$defs/ArrayOfStrings" + }, + { + "type": "null" + } + ], + "default": null + }, + "where": { + "anyOf": [ + { + "$ref": "#/$defs/ArrayOfStrings" + }, + { + "type": "null" + } + ], + "default": null + }, + "additionalProperties": { + "anyOf": [ + {}, + { + "type": "null" + } + ], + "default": null, + "title": "Additionalproperties" + } + }, + "title": "QueryParams", + "type": "object" + }, + "Quoting": { + "additionalProperties": false, + "properties": { + "database": { + "anyOf": [ + { + "$ref": "#/$defs/BooleanOrJinjaString" + }, + { + "type": "null" + } + ], + "default": null + }, + "identifier": { + "anyOf": [ + { + "$ref": "#/$defs/BooleanOrJinjaString" + }, + { + "type": "null" + } + ], + "default": null + }, + "schema": { + "anyOf": [ + { + "$ref": "#/$defs/BooleanOrJinjaString" + }, + { + "type": "null" + } + ], + "default": null + } + }, + "title": "Quoting", + "type": "object" + }, + "RatioMetric": { + "additionalProperties": false, + "properties": { + "name": { + "pattern": "(?!.*__).*^[a-z][a-z0-9_]*[a-z0-9]$", + "title": "Name", + "type": "string" + }, + "description": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Description" + }, + "filter": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Filter" + }, + "group": { + "anyOf": [ + { + "$ref": "#/$defs/GroupName" + }, + { + "type": "null" + } + ], + "default": null + }, + "label": { + "title": "Label", + "type": "string" + }, + "type": { + "$ref": "#/$defs/RatioMetricType" + }, + "type_params": { + "$ref": "#/$defs/RatioMetricTypeParams" + } + }, + "required": [ + "name", + "label", + "type", + "type_params" + ], + "title": "RatioMetric", + "type": "object" + }, + "RatioMetricType": { + "enum": [ + "RATIO", + "ratio" + ], + "title": "RatioMetricType", + "type": "string" + }, + "RatioMetricTypeParams": { + "additionalProperties": false, + "properties": { + "denominator": { + "anyOf": [ + { + "$ref": "#/$defs/MetricInputSchema" + }, + { + "type": "null" + } + ], + "default": null + }, + "filter": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Filter" + }, + "numerator": { + "anyOf": [ + { + "$ref": "#/$defs/MetricInputSchema" + }, + { + "type": "null" + } + ], + "default": null + } + }, + "title": "RatioMetricTypeParams", + "type": "object" + }, + "Relationships": { + "properties": { + "name": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Name" + }, + "config": { + "anyOf": [ + { + "$ref": "#/$defs/TestConfigs" + }, + { + "type": "null" + } + ], + "default": null + }, + "field": { + "description": "The foreign key column", + "title": "Relationships: Field", + "type": "string" + }, + "to": { + "examples": [ + "ref('parent_model')", + "source('parent_schema', 'parent_table')" + ], + "title": "To", + "type": "string" + }, + "where": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Where" + } + }, + "required": [ + "field", + "to" + ], + "title": "Relationships", + "type": "object" + }, + "RelationshipsTest": { + "properties": { + "relationships": { + "anyOf": [ + { + "$ref": "#/$defs/Relationships" + }, + { + "type": "null" + } + ], + "default": null + } + }, + "title": "RelationshipsTest", + "type": "object" + }, + "SavedQuery": { + "additionalProperties": false, + "properties": { + "name": { + "title": "Name", + "type": "string" + }, + "description": { + "title": "Description", + "type": "string" + }, + "exports": { + "anyOf": [ + { + "items": { + "$ref": "#/$defs/Export" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Exports" + }, + "label": { + "title": "Label", + "type": "string" + }, + "query_params": { + "$ref": "#/$defs/QueryParams" + } + }, + "required": [ + "name", + "description", + "label", + "query_params" + ], + "title": "SavedQuery", + "type": "object" + }, + "Seed": { + "additionalProperties": false, + "properties": { + "name": { + "title": "Name", + "type": "string" + }, + "description": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Description" + }, + "columns": { + "anyOf": [ + { + "items": { + "$ref": "#/$defs/ColumnProperties" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Columns" + }, + "config": { + "anyOf": [ + { + "$ref": "#/$defs/SeedConfig" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Seed Config" + }, + "docs": { + "anyOf": [ + { + "$ref": "#/$defs/DocsConfig" + }, + { + "type": "null" + } + ], + "default": null + }, + "group": { + "anyOf": [ + { + "$ref": "#/$defs/GroupName" + }, + { + "type": "null" + } + ], + "default": null + }, + "tests": { + "anyOf": [ + { + "items": { + "$ref": "#/$defs/DataTests" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Tests" + } + }, + "required": [ + "name" + ], + "title": "Seed", + "type": "object" + }, + "SeedConfig": { + "properties": { + "column_types": { + "anyOf": [ + { + "type": "object" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Column Types" + }, + "copy_grants": { + "anyOf": [ + { + "$ref": "#/$defs/BooleanOrJinjaString" + }, + { + "type": "null" + } + ], + "default": null + }, + "data_tests": { + "anyOf": [ + { + "items": { + "$ref": "#/$defs/DataTests" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Data Tests" + }, + "database": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Database" + }, + "enabled": { + "anyOf": [ + { + "$ref": "#/$defs/BooleanOrJinjaString" + }, + { + "type": "null" + } + ], + "default": null + }, + "grants": { + "anyOf": [ + { + "$ref": "#/$defs/Grants" + }, + { + "type": "null" + } + ], + "default": null + }, + "quote_columns": { + "anyOf": [ + { + "$ref": "#/$defs/BooleanOrJinjaString" + }, + { + "type": "null" + } + ], + "default": null + }, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Schema" + } + }, + "title": "SeedConfig", + "type": "object" + }, + "SemanticModel": { + "additionalProperties": false, + "properties": { + "name": { + "pattern": "(?!.*__).*^[a-z][a-z0-9_]*[a-z0-9]$", + "title": "Name", + "type": "string" + }, + "description": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Description" + }, + "defaults": { + "anyOf": [ + { + "$ref": "#/$defs/Defaults" + }, + { + "type": "null" + } + ], + "default": null + }, + "dimensions": { + "anyOf": [ + { + "items": { + "$ref": "#/$defs/Dimension" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Dimensions" + }, + "entities": { + "anyOf": [ + { + "items": { + "$ref": "#/$defs/Entity" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Entities" + }, + "measures": { + "anyOf": [ + { + "items": { + "$ref": "#/$defs/Measure" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Measures" + }, + "model": { + "title": "Model", + "type": "string" + }, + "primary_entity": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Primary Entity" + } + }, + "required": [ + "name", + "model" + ], + "title": "SemanticModel", + "type": "object" + }, + "Severity": { + "enum": [ + "warn", + "error" + ], + "title": "Severity", + "type": "string" + }, + "SimpleMetric": { + "additionalProperties": false, + "properties": { + "name": { + "pattern": "(?!.*__).*^[a-z][a-z0-9_]*[a-z0-9]$", + "title": "Name", + "type": "string" + }, + "description": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Description" + }, + "filter": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Filter" + }, + "group": { + "anyOf": [ + { + "$ref": "#/$defs/GroupName" + }, + { + "type": "null" + } + ], + "default": null + }, + "label": { + "title": "Label", + "type": "string" + }, + "type": { + "$ref": "#/$defs/SimpleMetricType" + }, + "type_params": { + "$ref": "#/$defs/SimpleMetricTypeParams" + } + }, + "required": [ + "name", + "label", + "type", + "type_params" + ], + "title": "SimpleMetric", + "type": "object" + }, + "SimpleMetricType": { + "enum": [ + "SIMPLE", + "simple" + ], + "title": "SimpleMetricType", + "type": "string" + }, + "SimpleMetricTypeParams": { + "additionalProperties": false, + "properties": { + "measure": { + "anyOf": [ + { + "$ref": "#/$defs/MetricInputMeasure" + }, + { + "type": "null" + } + ], + "default": null + } + }, + "title": "SimpleMetricTypeParams", + "type": "object" + }, + "Snapshot": { + "additionalProperties": false, + "properties": { + "name": { + "title": "Name", + "type": "string" + }, + "description": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Description" + }, + "columns": { + "anyOf": [ + { + "items": { + "$ref": "#/$defs/ColumnProperties" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Columns" + }, + "config": { + "anyOf": [ + { + "$ref": "#/$defs/SnapshotConfig" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Snapshot Config" + }, + "data_tests": { + "anyOf": [ + { + "items": { + "$ref": "#/$defs/DataTests" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Data Tests" + }, + "docs": { + "anyOf": [ + { + "$ref": "#/$defs/DocsConfig" + }, + { + "type": "null" + } + ], + "default": null + }, + "group": { + "anyOf": [ + { + "$ref": "#/$defs/GroupName" + }, + { + "type": "null" + } + ], + "default": null + }, + "meta": { + "anyOf": [ + { + "type": "object" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Meta" + }, + "tests": { + "anyOf": [ + { + "items": { + "$ref": "#/$defs/DataTests" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Tests" + } + }, + "required": [ + "name" + ], + "title": "Snapshot", + "type": "object" + }, + "SnapshotConfig": { + "properties": { + "alias": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Alias" + }, + "check_cols": { + "anyOf": [ + { + "$ref": "#/$defs/StringOrArrayOfStrings" + }, + { + "type": "null" + } + ], + "default": null + }, + "enabled": { + "anyOf": [ + { + "$ref": "#/$defs/BooleanOrJinjaString" + }, + { + "type": "null" + } + ], + "default": null + }, + "grants": { + "anyOf": [ + { + "$ref": "#/$defs/Grants" + }, + { + "type": "null" + } + ], + "default": null + }, + "persist_docs": { + "anyOf": [ + { + "$ref": "#/$defs/PersistDocsConfig" + }, + { + "type": "null" + } + ], + "default": null + }, + "post-hook": { + "anyOf": [ + { + "$ref": "#/$defs/ArrayOfStrings" + }, + { + "type": "null" + } + ], + "default": null + }, + "pre-hook": { + "anyOf": [ + { + "$ref": "#/$defs/ArrayOfStrings" + }, + { + "type": "null" + } + ], + "default": null + }, + "quote_columns": { + "anyOf": [ + { + "$ref": "#/$defs/BooleanOrJinjaString" + }, + { + "type": "null" + } + ], + "default": null + }, + "strategy": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Strategy" + }, + "tags": { + "anyOf": [ + { + "$ref": "#/$defs/StringOrArrayOfStrings" + }, + { + "type": "null" + } + ], + "default": null + }, + "target_database": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Target Database" + }, + "target_schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Target Schema" + }, + "unique_key": { + "anyOf": [ + { + "$ref": "#/$defs/StringOrArrayOfStrings" + }, + { + "type": "null" + } + ], + "default": null + }, + "updated_at": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Updated At" + } + }, + "title": "SnapshotConfig", + "type": "object" + }, + "Source": { + "properties": { + "name": { + "description": "How you will identify the schema in {{ source() }} calls. Unless `schema` is also set, this will be the name of the schema in the database.", + "title": "Name", + "type": "string" + }, + "description": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Description" + }, + "config": { + "anyOf": [ + { + "type": "object" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Config" + }, + "data_tests": { + "anyOf": [ + { + "items": { + "$ref": "#/$defs/DataTests" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Data Tests" + }, + "database": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Database" + }, + "freshness": { + "anyOf": [ + { + "$ref": "#/$defs/FreshnessDefinition" + }, + { + "type": "null" + } + ], + "default": null + }, + "loaded_at_field": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Loaded At Field" + }, + "loader": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Loader" + }, + "meta": { + "anyOf": [ + { + "type": "object" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Meta" + }, + "overrides": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "The name of another package installed in your project. If that package has a source with the same name as this one, its properties will be applied on top of the base properties of the overridden source. https://docs.getdbt.com/reference/resource-properties/overrides", + "title": "Package to Override" + }, + "quoting": { + "anyOf": [ + { + "$ref": "#/$defs/Quoting" + }, + { + "type": "null" + } + ], + "default": null + }, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "The schema name as stored in the database. Only needed if you want to use a different `name` than what exists in the database (otherwise `name` is used by default)", + "title": "Schema" + }, + "tables": { + "anyOf": [ + { + "items": { + "$ref": "#/$defs/Table" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Tables" + }, + "tags": { + "anyOf": [ + { + "$ref": "#/$defs/StringOrArrayOfStrings" + }, + { + "type": "null" + } + ], + "default": null + }, + "tests": { + "anyOf": [ + { + "items": { + "$ref": "#/$defs/DataTests" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Tests" + } + }, + "required": [ + "name" + ], + "title": "Source", + "type": "object" + }, + "StringOrArrayOfStrings": { + "anyOf": [ + { + "type": "string" + }, + { + "$ref": "#/$defs/ArrayOfStrings" + } + ], + "title": "StringOrArrayOfStrings" + }, + "Table": { + "additionalProperties": false, + "properties": { + "name": { + "description": "How you will identify the table in {{ source() }} calls. Unless `identifier` is also set, this will be the name of the table in the database.", + "title": "Name", + "type": "string" + }, + "description": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Description" + }, + "columns": { + "anyOf": [ + { + "items": { + "$ref": "#/$defs/ColumnProperties" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Columns" + }, + "external": { + "anyOf": [ + { + "type": "object" + }, + { + "type": "null" + } + ], + "default": null, + "title": "External" + }, + "freshness": { + "anyOf": [ + { + "$ref": "#/$defs/FreshnessDefinition" + }, + { + "type": "null" + } + ], + "default": null + }, + "identifier": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "The table name as stored in the database. Only needed if you want to give the source a different name than what exists in the database (otherwise `name` is used by default)", + "title": "Identifier" + }, + "loaded_at_field": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Which column to check during data freshness tests. Only needed if the table has a different loaded_at_field to the one defined on the source overall.", + "title": "Loaded At Field" + }, + "loader": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Loader" + }, + "meta": { + "anyOf": [ + { + "type": "object" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Meta" + }, + "quoting": { + "anyOf": [ + { + "$ref": "#/$defs/Quoting" + }, + { + "type": "null" + } + ], + "default": null + }, + "tags": { + "anyOf": [ + { + "$ref": "#/$defs/StringOrArrayOfStrings" + }, + { + "type": "null" + } + ], + "default": null + }, + "tests": { + "anyOf": [ + { + "items": { + "$ref": "#/$defs/DataTests" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Tests" + } + }, + "required": [ + "name" + ], + "title": "Table", + "type": "object" + }, + "TestConfigs": { + "properties": { + "alias": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Only relevant when `store_failures` is true", + "title": "Alias" + }, + "database": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Only relevant when `store_failures` is true", + "title": "Database" + }, + "enabled": { + "anyOf": [ + { + "$ref": "#/$defs/BooleanOrJinjaString" + }, + { + "type": "null" + } + ], + "default": null + }, + "error_if": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Error If" + }, + "fail_calc": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Fail Calc" + }, + "limit": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Limit" + }, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Only relevant when `store_failures` is true", + "title": "Schema" + }, + "severity": { + "anyOf": [ + { + "$ref": "#/$defs/JinjaString" + }, + { + "$ref": "#/$defs/Severity" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Severity" + }, + "store_failures": { + "anyOf": [ + { + "$ref": "#/$defs/BooleanOrJinjaString" + }, + { + "type": "null" + } + ], + "default": null + }, + "tags": { + "anyOf": [ + { + "$ref": "#/$defs/StringOrArrayOfStrings" + }, + { + "type": "null" + } + ], + "default": null + }, + "warn_if": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Warn If" + } + }, + "title": "TestConfigs", + "type": "object" + }, + "TimeDimension": { + "additionalProperties": false, + "properties": { + "name": { + "pattern": "(?!.*__).*^[a-z][a-z0-9_]*[a-z0-9]$", + "title": "Name", + "type": "string" + }, + "description": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Description" + }, + "expr": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Expr" + }, + "is_partition": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Is Partition" + }, + "type": { + "$ref": "#/$defs/TimeDimensionType" + }, + "type_params": { + "$ref": "#/$defs/DimensionTypeParams" + } + }, + "required": [ + "name", + "type", + "type_params" + ], + "title": "TimeDimension", + "type": "object" + }, + "TimeDimensionType": { + "enum": [ + "TIME", + "time" + ], + "title": "TimeDimensionType", + "type": "string" + }, + "TimeGranularity": { + "enum": [ + "DAY", + "WEEK", + "MONTH", + "QUARTER", + "YEAR", + "day", + "week", + "month", + "quarter", + "year" + ], + "title": "TimeGranularity", + "type": "string" + }, + "Type": { + "enum": [ + "dashboard", + "notebook", + "analysis", + "ml", + "application" + ], + "title": "Type", + "type": "string" + }, + "Unique": { + "properties": { + "name": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Name" + }, + "config": { + "anyOf": [ + { + "$ref": "#/$defs/TestConfigs" + }, + { + "type": "null" + } + ], + "default": null + }, + "where": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Where" + } + }, + "title": "Unique", + "type": "object" + }, + "UniqueTest": { + "properties": { + "unique": { + "anyOf": [ + { + "$ref": "#/$defs/Unique" + }, + { + "type": "null" + } + ], + "default": null + } + }, + "title": "UniqueTest", + "type": "object" + }, + "UnitTest": { + "additionalProperties": false, + "properties": { + "name": { + "title": "Name", + "type": "string" + }, + "description": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Description" + }, + "config": { + "anyOf": [ + { + "$ref": "#/$defs/UnitTestConfig" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Unit Test Config" + }, + "expect": { + "anyOf": [ + { + "$ref": "#/$defs/ExpectDict" + }, + { + "$ref": "#/$defs/ExpectCSV" + }, + { + "$ref": "#/$defs/ExpectSQL" + } + ], + "title": "Expect" + }, + "given": { + "anyOf": [ + { + "items": { + "$ref": "#/$defs/GivenItem" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Given" + }, + "model": { + "description": "The name of the model whose behaviour you are testing. Does not need to be wrapped in a ref.", + "examples": [ + "my_model" + ], + "title": "Model", + "type": "string" + }, + "overrides": { + "anyOf": [ + { + "$ref": "#/$defs/Overrides" + }, + { + "type": "null" + } + ], + "default": null + }, + "additionalProperties": { + "anyOf": [ + {}, + { + "type": "null" + } + ], + "default": null, + "title": "Additionalproperties" + } + }, + "required": [ + "name", + "expect", + "model" + ], + "title": "UnitTest", + "type": "object" + }, + "UnitTestConfig": { + "additionalProperties": false, + "properties": { + "meta": { + "anyOf": [ + { + "type": "object" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Meta" + }, + "tags": { + "anyOf": [ + { + "$ref": "#/$defs/StringOrArrayOfStrings" + }, + { + "type": "null" + } + ], + "default": null + } + }, + "title": "UnitTestConfig", + "type": "object" + }, + "ValidityParams": { + "additionalProperties": false, + "properties": { + "is_end": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Is End" + }, + "is_start": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Is Start" + } + }, + "title": "ValidityParams", + "type": "object" + }, + "Version": { + "properties": { + "columns": { + "anyOf": [ + { + "items": { + "anyOf": [ + { + "$ref": "#/$defs/IncludeExclude" + }, + { + "$ref": "#/$defs/ColumnProperties" + } + ] + }, + "type": "array" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Columns" + }, + "config": { + "anyOf": [ + { + "$ref": "#/$defs/ModelConfigs" + }, + { + "type": "null" + } + ], + "default": null + }, + "v": { + "title": "V", + "type": "number" + } + }, + "required": [ + "v" + ], + "title": "Version", + "type": "object" + }, + "WindowChoice": { + "enum": [ + "MIN", + "MAX", + "min", + "max" + ], + "title": "WindowChoice", + "type": "string" + } + }, + "additionalProperties": false, + "properties": { + "version": { + "const": 2, + "default": 2, + "enum": [ + 2 + ], + "title": "Version", + "type": "integer" + }, + "analyses": { + "anyOf": [ + { + "items": { + "$ref": "#/$defs/Analyse" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Analyses" + }, + "exposures": { + "anyOf": [ + { + "items": { + "$ref": "#/$defs/Exposure" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Exposures" + }, + "groups": { + "anyOf": [ + { + "items": { + "$ref": "#/$defs/Group" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Groups" + }, + "macros": { + "anyOf": [ + { + "items": { + "$ref": "#/$defs/Macro" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Macros" + }, + "metrics": { + "anyOf": [ + { + "items": { + "anyOf": [ + { + "$ref": "#/$defs/SimpleMetric" + }, + { + "$ref": "#/$defs/DerivedMetric" + }, + { + "$ref": "#/$defs/CumulativeMetric" + }, + { + "$ref": "#/$defs/ConversionMetric" + }, + { + "$ref": "#/$defs/RatioMetric" + } + ] + }, + "type": "array" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Metrics" + }, + "models": { + "anyOf": [ + { + "items": { + "$ref": "#/$defs/Model" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Models" + }, + "saved_queries": { + "anyOf": [ + { + "items": { + "$ref": "#/$defs/SavedQuery" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Saved Queries" + }, + "seeds": { + "anyOf": [ + { + "items": { + "$ref": "#/$defs/Seed" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Seeds" + }, + "semantic_models": { + "anyOf": [ + { + "items": { + "$ref": "#/$defs/SemanticModel" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Semantic Models" + }, + "snapshots": { + "anyOf": [ + { + "items": { + "$ref": "#/$defs/Snapshot" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Snapshots" + }, + "sources": { + "anyOf": [ + { + "items": { + "$ref": "#/$defs/Source" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Sources" + }, + "unit_tests": { + "anyOf": [ + { + "items": { + "$ref": "#/$defs/UnitTest" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Unit Tests" + } + }, + "title": "DbtYmlFiles", + "type": "object" +} \ No newline at end of file diff --git a/schemas/latest/dbt_yml_files-latest.json b/schemas/latest/dbt_yml_files-latest.json index a0e146d..b8c757b 100644 --- a/schemas/latest/dbt_yml_files-latest.json +++ b/schemas/latest/dbt_yml_files-latest.json @@ -55,7 +55,7 @@ "$ref": "#/$defs/docs_config" }, "group": { - "$ref": "#/$defs/group" + "$ref": "#/$defs/group_name" } } } @@ -110,28 +110,7 @@ "type": "object" }, "owner": { - "type": "object", - "anyOf": [ - { - "required": [ - "email" - ] - }, - { - "required": [ - "name" - ] - } - ], - "properties": { - "name": { - "type": "string" - }, - "email": { - "type": "string" - } - }, - "additionalProperties": false + "$ref": "#/$defs/owner" }, "tags": { "$ref": "#/$defs/string_or_array_of_strings" @@ -155,17 +134,7 @@ "type": "string" }, "owner": { - "type": "object", - "minProperties": 1, - "properties": { - "name": { - "type": "string" - }, - "email": { - "type": "string" - } - }, - "additionalProperties": true + "$ref": "#/$defs/owner" } }, "additionalProperties": false @@ -325,6 +294,7 @@ "type": "string" }, "type": { + "title": "Metric Type", "enum": [ "SIMPLE", "RATIO", @@ -342,7 +312,7 @@ "type": "string" }, "group": { - "$ref": "#/$defs/group" + "$ref": "#/$defs/group_name" }, "label": { "type": "string" @@ -401,7 +371,7 @@ "$ref": "#/$defs/docs_config" }, "group": { - "$ref": "#/$defs/group" + "$ref": "#/$defs/group_name" }, "latest_version": { "type": "number" @@ -515,6 +485,7 @@ } }, "config": { + "title": "Seed Config", "type": "object", "properties": { "column_types": { @@ -550,7 +521,7 @@ "$ref": "#/$defs/docs_config" }, "group": { - "$ref": "#/$defs/group" + "$ref": "#/$defs/group_name" }, "tests": { "type": "array", @@ -637,6 +608,7 @@ } }, "config": { + "title": "Snapshot Config", "type": "object", "properties": { "alias": { @@ -693,7 +665,7 @@ "$ref": "#/$defs/docs_config" }, "group": { - "$ref": "#/$defs/group" + "$ref": "#/$defs/group_name" }, "meta": { "type": "object" @@ -871,6 +843,7 @@ "type": "string" }, "config": { + "title": "Unit Test Config", "type": "object", "properties": { "meta": { @@ -919,9 +892,9 @@ "description": "Defaults to `dict` when not specified", "type": "string", "enum": [ + "csv", "dict", - "sql", - "csv" + "sql" ] }, "additionalProperties": false @@ -966,8 +939,8 @@ "description": "Defaults to `dict` when not specified", "type": "string", "enum": [ - "dict", "csv", + "dict", "sql" ] }, @@ -1371,6 +1344,7 @@ "type": "string" }, "type": { + "title": "Dimension Type", "enum": [ "CATEGORICAL", "TIME", @@ -1448,6 +1422,7 @@ "pattern": "(?!.*__).*^[a-z][a-z0-9_]*[a-z0-9]$" }, "type": { + "title": "Entity Type", "enum": [ "PRIMARY", "UNIQUE", @@ -1481,6 +1456,7 @@ "type": "string" }, "config": { + "title": "Export Config", "type": "object", "properties": { "alias": { @@ -1565,7 +1541,7 @@ }, "additionalProperties": false }, - "group": { + "group_name": { "type": "string" }, "include_exclude": { @@ -1804,6 +1780,30 @@ } } }, + "owner": { + "type": "object", + "anyOf": [ + { + "required": [ + "email" + ] + }, + { + "required": [ + "name" + ] + } + ], + "properties": { + "name": { + "type": "string" + }, + "email": { + "type": "string" + } + }, + "additionalProperties": false + }, "non_additive_dimension": { "type": "object", "required": [ diff --git a/src/generate.py b/src/generate.py new file mode 100644 index 0000000..1e1034d --- /dev/null +++ b/src/generate.py @@ -0,0 +1,19 @@ +import json +import os + +from latest.dbt_yml_files import DbtYmlFiles + +if __name__ == "__main__": + versions = ["latest"] + files = {"dbt_yml_files": DbtYmlFiles} + for v in versions: + output_directory = os.path.join( + os.path.dirname(__file__), "../", f"schemas/{v}-generated" + ) + for file_name, model in files.items(): + file_path = os.path.join( + output_directory, f"{file_name}-{v}-generated.json" + ) + schema = model.model_json_schema(mode="validation") + with open(file_path, "w") as file: + json.dump(schema, file, indent=2) diff --git a/src/latest/dbt_yml_files.py b/src/latest/dbt_yml_files.py new file mode 100644 index 0000000..5ff5dc1 --- /dev/null +++ b/src/latest/dbt_yml_files.py @@ -0,0 +1,1012 @@ +# generated by datamodel-codegen: +# filename: dbt_yml_files-latest.json +# timestamp: 2024-07-25T00:00:09+00:00 + +from __future__ import annotations + +from enum import Enum +from typing import Any, Dict, List, Literal, Optional, Union + +from pydantic import BaseModel, ConfigDict, Field, RootModel + + +class Column(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + name: str + description: Optional[str] = None + data_type: Optional[str] = None + + +class Type(Enum): + dashboard = "dashboard" + notebook = "notebook" + analysis = "analysis" + ml = "ml" + application = "application" + + +class Maturity(Enum): + high = "high" + medium = "medium" + low = "low" + + +class Argument(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + name: str + description: Optional[str] = None + type: Optional[str] = None + + +class Access(Enum): + private = "private" + protected = "protected" + public = "public" + + +class Defaults(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + agg_time_dimension: Optional[str] = None + + +class Format(Enum): + csv = "csv" + dict = "dict" + sql = "sql" + + +class ExpectDict(BaseModel): + format: Literal["dict"] = Field("dict") + rows: List[Dict[str, Any]] = Field( + ..., + description="When `format` is `dict`, each item should be a dictionary containing a key-value pair for each column and its value, e.g. `{id: 1, code: 'ABC'}`", + ) + + +class ExpectCSV(BaseModel): + format: Literal["csv"] = Field("csv") + rows: Optional[str] = Field( + None, + description="When `format` is csv or sql, a string containing comma-separated headers and values. Alternatively provide a fixture. Use the pipe character | to create a multi-line string in YAML.", + ) + fixture: Optional[str] = Field( + None, + description="Specify the name of a fixture instead of providing `rows`.", + ) + + +class ExpectSQL(BaseModel): + format: Literal["sql"] = Field("sql") + rows: Optional[str] = Field( + None, + description="When `format` is csv or sql, a string containing comma-separated headers and values. Alternatively provide a fixture. Use the pipe character | to create a multi-line string in YAML.", + ) + fixture: Optional[str] = Field( + None, + description="Specify the name of a fixture instead of providing `rows`.", + ) + + +Expect = Union[ExpectDict, ExpectCSV, ExpectSQL] + + +class GivenItem(BaseModel): + fixture: Optional[str] = Field( + None, + description="Only relevant when format is csv. Specify the name of a fixture instead of providing `rows`.", + ) + format: Optional[Format] = Field( + None, description="Defaults to `dict` when not specified" + ) + input: Optional[str] = Field( + None, + description="The relation whose inputs you need to mock. Enclose in ref or source without curly braces", + examples=[ + "ref('model_b')", + "ref('upstream_project', 'model_b')", + "source('schema', 'table')", + ], + ) + additionalProperties: Optional[Any] = None + + +class Overrides(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + env_vars: Optional[Dict[str, Any]] = None + macros: Optional[Dict[str, Any]] = Field( + None, examples=[{"is_incremental": "true"}] + ) + vars: Optional[Dict[str, Any]] = None + + +class AggregationTypeParams(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + percentile: Optional[float] = None + use_approximate_percentile: Optional[bool] = None + use_discrete_percentile: Optional[bool] = None + + +class ArrayOfStrings(RootModel[List[str]]): + root: List[str] + + +class Calculation(Enum): + conversions = "conversions" + conversion_rate = "conversion_rate" + CONVERSIONS = "CONVERSIONS" + CONVERSION_RATE = "CONVERSION_RATE" + + +class ConstantProperty(BaseModel): + base_property: str = Field(..., description="DIMENSION or ENTITY") + conversion_property: str = Field(..., description="DIMENSION or ENTITY") + + +class GrainToDate(Enum): + day = "day" + week = "week" + month = "month" + quarter = "quarter" + year = "year" + + +class TimeGranularity(Enum): + DAY = "DAY" + WEEK = "WEEK" + MONTH = "MONTH" + QUARTER = "QUARTER" + YEAR = "YEAR" + day = "day" + week = "week" + month = "month" + quarter = "quarter" + year = "year" + + +class DocsConfig(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + node_color: Optional[str] = Field( + None, + description="The color of the node on the DAG in the documentation. It must be an Hex code or a valid CSS color name.", + pattern="^(#[a-fA-F0-9]{3}|#[a-fA-F0-9]{6}|[^#][a-zA-Z]*)$", + ) + show: Optional[bool] = True + + +class EntityType(Enum): + PRIMARY = "PRIMARY" + UNIQUE = "UNIQUE" + FOREIGN = "FOREIGN" + NATURAL = "NATURAL" + primary = "primary" + unique = "unique" + foreign = "foreign" + natural = "natural" + + +class Entity(BaseModel): + model_config = ConfigDict( + extra="forbid", + regex_engine="python-re", + ) + name: str = Field(..., pattern="(?!.*__).*^[a-z][a-z0-9_]*[a-z0-9]$") + type: EntityType = Field(..., title="Entity Type") + entity: Optional[str] = None + expr: Optional[Union[str, bool]] = None + + +class ExportAs(Enum): + table = "table" + view = "view" + cache = "cache" + + +class ExportConfig(BaseModel): + model_config = ConfigDict( + extra="allow", + ) + alias: Optional[str] = None + export_as: Optional[ExportAs] = None + schema_: Optional[str] = Field(None, alias="schema") + + +class Export(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + name: str + config: Optional[ExportConfig] = Field(None, title="Export Config") + + +class Period(Enum): + minute = "minute" + hour = "hour" + day = "day" + + +class GroupName(RootModel[str]): + root: str + + +class JinjaString(RootModel[str]): + root: str = Field(..., pattern="\\{\\{.*\\}\\}") + + +class Agg(Enum): + SUM = "SUM" + MIN = "MIN" + MAX = "MAX" + AVG = "AVG" + COUNT_DISTINCT = "COUNT_DISTINCT" + SUM_BOOLEAN = "SUM_BOOLEAN" + COUNT = "COUNT" + PERCENTILE = "PERCENTILE" + MEDIAN = "MEDIAN" + sum = "sum" + min = "min" + max = "max" + avg = "avg" + count_distinct = "count_distinct" + sum_boolean = "sum_boolean" + count = "count" + percentile = "percentile" + median = "median" + + +class MetricInputMeasure(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + name: Optional[str] = None + fill_nulls_with: Optional[Union[str, int]] = None + filter: Optional[str] = None + join_to_timespine: Optional[bool] = None + + +class MetricInputSchema(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + name: Optional[str] = None + alias: Optional[str] = None + filter: Optional[str] = None + offset_window: Optional[str] = None + + +class AuthorizedView(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + database: str + project: str + + +class OnConfigurationChange(Enum): + apply = "apply" + continue_ = "continue" + fail = "fail" + + +class OnSchemaChange(Enum): + append_new_columns = "append_new_columns" + fail = "fail" + ignore = "ignore" + sync_all_columns = "sync_all_columns" + + +class OwnerWithEmail(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + email: str + + +class OwnerWithName(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + name: str + + +Owner = Union[OwnerWithEmail, OwnerWithName] + + +class WindowChoice(Enum): + MIN = "MIN" + MAX = "MAX" + min = "min" + max = "max" + + +class NonAdditiveDimension(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + name: str + window_choice: Optional[WindowChoice] = None + window_groupings: Optional[List[str]] = None + + +class NumberOrJinjaString(RootModel[Union[JinjaString, float]]): + root: Union[JinjaString, float] + + +class RatioMetricTypeParams(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + denominator: Optional[MetricInputSchema] = None + filter: Optional[str] = None + numerator: Optional[MetricInputSchema] = None + + +class SimpleMetricTypeParams(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + measure: Optional[MetricInputMeasure] = None + + +class StringOrArrayOfStrings(RootModel[Union[str, ArrayOfStrings]]): + root: Union[str, ArrayOfStrings] + + +class Severity(Enum): + warn = "warn" + error = "error" + + +class ValidityParams(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + is_end: Optional[bool] = None + is_start: Optional[bool] = None + + +class Config(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + tags: Optional[StringOrArrayOfStrings] = None + + +class Analyse(BaseModel): + name: str + description: Optional[str] = None + columns: Optional[List[Column]] = None + config: Optional[Config] = None + docs: Optional[DocsConfig] = None + group: Optional[GroupName] = None + + +class Exposure(BaseModel): + name: str + description: Optional[str] = None + type: Type + depends_on: List[str] + label: Optional[str] = None + maturity: Optional[Maturity] = None + meta: Optional[Dict[str, Any]] = None + owner: Owner + tags: Optional[StringOrArrayOfStrings] = None + url: Optional[str] = None + + +class Group(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + name: str + owner: Owner + + +class Macro(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + name: str + description: Optional[str] = None + arguments: Optional[List[Argument]] = None + docs: Optional[DocsConfig] = None + + +class SimpleMetricType(Enum): + SIMPLE = "SIMPLE" + simple = "simple" + + +class DerivedMetricType(Enum): + DERIVED = "DERIVED" + derived = "derived" + + +class CumulativeMetricType(Enum): + CUMULATIVE = "CUMULATIVE" + cumulative = "cumulative" + + +class ConversionMetricType(Enum): + CONVERSION = "CONVERSION" + conversion = "conversion" + + +class RatioMetricType(Enum): + RATIO = "RATIO" + ratio = "ratio" + + +class MetricBase(BaseModel): + model_config = ConfigDict( + extra="forbid", + regex_engine="python-re", + ) + name: str = Field(..., pattern="(?!.*__).*^[a-z][a-z0-9_]*[a-z0-9]$") + description: Optional[str] = None + filter: Optional[str] = None + group: Optional[GroupName] = None + label: str + + +class SimpleMetric(MetricBase): + type: SimpleMetricType + type_params: SimpleMetricTypeParams + + +class DerivedMetric(MetricBase): + type: DerivedMetricType + type_params: DerivedMetricTypeParams + + +class CumulativeMetric(MetricBase): + type: CumulativeMetricType + type_params: CumulativeMetricTypeParams + + +class ConversionMetric(MetricBase): + type: ConversionMetricType + type_params: ConversionMetricTypeParams + + +class RatioMetric(MetricBase): + type: RatioMetricType + type_params: RatioMetricTypeParams + + +Metric = Union[ + SimpleMetric, DerivedMetric, CumulativeMetric, ConversionMetric, RatioMetric +] + + +class QueryParams(BaseModel): + dimensions: Optional[ArrayOfStrings] = None + metrics: Optional[ArrayOfStrings] = None + where: Optional[ArrayOfStrings] = None + additionalProperties: Optional[Any] = None + + +class SavedQuery(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + name: str + description: str + exports: Optional[List[Export]] = None + label: str + query_params: QueryParams + + +class UnitTestConfig(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + meta: Optional[Dict[str, Any]] = None + tags: Optional[StringOrArrayOfStrings] = None + + +class UnitTest(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + name: str + description: Optional[str] = None + config: Optional[UnitTestConfig] = Field(None, title="Unit Test Config") + expect: Expect + given: Optional[List[GivenItem]] = None + model: str = Field( + ..., + description="The name of the model whose behaviour you are testing. Does not need to be wrapped in a ref.", + examples=["my_model"], + ) + overrides: Optional[Overrides] = None + additionalProperties: Optional[Any] = None + + +class BooleanOrJinjaString(RootModel[Union[JinjaString, bool]]): + root: Union[JinjaString, bool] + + +class Constraint(BaseModel): + name: Optional[str] = None + type: str + columns: Optional[StringOrArrayOfStrings] = None + expression: Optional[str] = None + warn_unenforced: Optional[BooleanOrJinjaString] = None + warn_unsupported: Optional[BooleanOrJinjaString] = None + + +class Constraints(RootModel[List[Constraint]]): + root: List[Constraint] + + +class ConversionTypeParams(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + base_measure: MetricInputMeasure + calculation: Optional[Calculation] = Calculation.conversion_rate + constant_properties: Optional[List[ConstantProperty]] = None + conversion_measure: MetricInputMeasure + entity: str = Field(..., description="The entity to calculate over") + window: Optional[str] = None + + +class ConversionMetricTypeParams(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + conversion_type_params: Optional[ConversionTypeParams] = None + + +class CumulativeMetricTypeParams(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + grain_to_date: Optional[GrainToDate] = None + measure: Optional[MetricInputMeasure] = None + window: Optional[str] = None + + +class DerivedMetricTypeParams(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + expr: Optional[str] = None + metrics: Optional[List[MetricInputSchema]] = None + + +class DimensionTypeParams(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + time_granularity: TimeGranularity + validity_params: Optional[ValidityParams] = None + + +class FreshnessRules(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + count: NumberOrJinjaString + period: Period + + +class Grants(RootModel[Dict[str, StringOrArrayOfStrings]]): + root: Dict[str, StringOrArrayOfStrings] = Field( + ..., + description="grant config. each key is a database permission and the value is the grantee of that permission", + ) + + +class IncludeExclude(BaseModel): + exclude: Optional[StringOrArrayOfStrings] = None + include: Optional[StringOrArrayOfStrings] = None + + +class Measure(BaseModel): + model_config = ConfigDict( + extra="forbid", + regex_engine="python-re", + ) + name: str = Field(..., pattern="(?!.*__).*^[a-z][a-z0-9_]*[a-z0-9]$") + description: Optional[str] = None + agg: Agg + agg_params: Optional[AggregationTypeParams] = None + agg_time_dimension: Optional[str] = Field( + None, pattern="(?!.*__).*^[a-z][a-z0-9_]*[a-z0-9]$" + ) + create_metric: Optional[bool] = None + create_metric_display_name: Optional[str] = None + expr: Optional[Union[str, int, bool]] = None + label: Optional[str] = None + non_additive_dimension: Optional[NonAdditiveDimension] = None + + +class Contract(BaseModel): + enforced: Optional[BooleanOrJinjaString] = None + + +class ModelConfigs(BaseModel): + auto_refresh: Optional[BooleanOrJinjaString] = None + backup: Optional[BooleanOrJinjaString] = None + contract: Optional[Contract] = None + file_format: Optional[str] = None + grant_access_to: Optional[List[AuthorizedView]] = Field( + None, + description="Configuration, specific to BigQuery adapter, used to setup authorized views.", + title="Authorized views", + ) + grants: Optional[Grants] = None + hours_to_expiration: Optional[float] = Field( + None, + description="Configuration specific to BigQuery adapter used to set an expiration delay (in hours) to a table.", + ) + kms_key_name: Optional[str] = Field( + None, + description="Configuration of the KMS key name, specific to BigQuery adapter.", + pattern="projects/[a-zA-Z0-9_-]*/locations/[a-zA-Z0-9_-]*/keyRings/.*/cryptoKeys/.*", + ) + labels: Optional[Dict[str, str]] = Field( + None, + description="Configuration specific to BigQuery adapter used to add labels and tags to tables/views created by dbt.", + title="Label configs", + ) + location: Optional[str] = None + materialized: Optional[str] = None + on_configuration_change: Optional[OnConfigurationChange] = None + on_schema_change: Optional[OnSchemaChange] = None + snowflake_warehouse: Optional[str] = None + sql_header: Optional[str] = None + target_lag: Optional[str] = Field( + None, pattern="^(?:downstream|\\d+\\s*(?:seconds|minutes|hours|days))$" + ) + + +class PersistDocsConfig(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + columns: Optional[BooleanOrJinjaString] = Field( + default_factory=lambda: BooleanOrJinjaString.model_validate(True) + ) + relation: Optional[BooleanOrJinjaString] = Field( + default_factory=lambda: BooleanOrJinjaString.model_validate(True) + ) + + +class TestConfigs(BaseModel): + alias: Optional[str] = Field( + None, description="Only relevant when `store_failures` is true" + ) + database: Optional[str] = Field( + None, description="Only relevant when `store_failures` is true" + ) + enabled: Optional[BooleanOrJinjaString] = None + error_if: Optional[str] = None + fail_calc: Optional[str] = None + limit: Optional[float] = None + schema_: Optional[str] = Field( + None, alias="schema", description="Only relevant when `store_failures` is true" + ) + severity: Optional[Union[JinjaString, Severity]] = None + store_failures: Optional[BooleanOrJinjaString] = None + tags: Optional[StringOrArrayOfStrings] = None + warn_if: Optional[str] = None + + +class SnapshotConfig(BaseModel): + alias: Optional[str] = None + check_cols: Optional[StringOrArrayOfStrings] = None + enabled: Optional[BooleanOrJinjaString] = None + grants: Optional[Grants] = None + persist_docs: Optional[PersistDocsConfig] = None + post_hook: Optional[ArrayOfStrings] = Field(None, alias="post-hook") + pre_hook: Optional[ArrayOfStrings] = Field(None, alias="pre-hook") + quote_columns: Optional[BooleanOrJinjaString] = None + strategy: Optional[str] = None + tags: Optional[StringOrArrayOfStrings] = None + target_database: Optional[str] = None + target_schema: Optional[str] = None + unique_key: Optional[StringOrArrayOfStrings] = None + updated_at: Optional[str] = None + + +class Quoting(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + database: Optional[BooleanOrJinjaString] = None + identifier: Optional[BooleanOrJinjaString] = None + schema_: Optional[BooleanOrJinjaString] = Field(None, alias="schema") + + +class Relationships(BaseModel): + name: Optional[str] = None + config: Optional[TestConfigs] = None + field: str = Field( + ..., description="The foreign key column", title="Relationships: Field" + ) + to: str = Field( + ..., examples=["ref('parent_model')", "source('parent_schema', 'parent_table')"] + ) + where: Optional[str] = None + + +class RelationshipsTest(BaseModel): + relationships: Optional[Relationships] = None + + +class AcceptedValues(BaseModel): + name: Optional[str] = None + config: Optional[TestConfigs] = None + quote: Optional[bool] = None + values: List[str] + where: Optional[str] = None + + +class AcceptedValuesTest(BaseModel): + accepted_values: Optional[AcceptedValues] = None + + +class NotNull(BaseModel): + name: Optional[str] = None + config: Optional[TestConfigs] = None + where: Optional[str] = None + + +class NotNullTest(BaseModel): + not_null: Optional[NotNull] = None + + +class Unique(BaseModel): + name: Optional[str] = None + config: Optional[TestConfigs] = None + where: Optional[str] = None + + +class UniqueTest(BaseModel): + unique: Optional[Unique] = None + + +class DataTests( + RootModel[ + Union[str, RelationshipsTest, AcceptedValuesTest, NotNullTest, UniqueTest] + ] +): + root: Union[str, RelationshipsTest, AcceptedValuesTest, NotNullTest, UniqueTest] + + +class DimensionBase(BaseModel): + model_config = ConfigDict( + extra="forbid", + regex_engine="python-re", + ) + name: str = Field(..., pattern="(?!.*__).*^[a-z][a-z0-9_]*[a-z0-9]$") + description: Optional[str] = None + expr: Optional[Union[str, bool]] = None + is_partition: Optional[bool] = None + + +class TimeDimensionType(Enum): + TIME = "TIME" + time = "time" + + +class CategoricalDimensionType(Enum): + CATEGORICAL = "CATEGORICAL" + categorical = "categorical" + + +class CategoricalDimension(DimensionBase): + type: CategoricalDimensionType + + +class TimeDimension(DimensionBase): + type: TimeDimensionType + type_params: DimensionTypeParams + + +class Dimension(RootModel[Union[CategoricalDimension, TimeDimension]]): + root: Union[CategoricalDimension, TimeDimension] + + +class FreshnessDefinition1(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + error_after: Optional[FreshnessRules] = None + filter: Optional[str] = None + warn_after: Optional[FreshnessRules] = None + + +class FreshnessDefinition(RootModel[Union[FreshnessDefinition1, None]]): + root: Union[FreshnessDefinition1, None] + + +class SeedConfig(BaseModel): + column_types: Optional[Dict[str, Any]] = None + copy_grants: Optional[BooleanOrJinjaString] = None + data_tests: Optional[List[DataTests]] = None + database: Optional[str] = None + enabled: Optional[BooleanOrJinjaString] = None + grants: Optional[Grants] = None + quote_columns: Optional[BooleanOrJinjaString] = None + schema_: Optional[str] = Field(None, alias="schema") + + +class SemanticModel(BaseModel): + model_config = ConfigDict( + extra="forbid", + regex_engine="python-re", + ) + name: str = Field(..., pattern="(?!.*__).*^[a-z][a-z0-9_]*[a-z0-9]$") + description: Optional[str] = None + defaults: Optional[Defaults] = None + dimensions: Optional[List[Dimension]] = None + entities: Optional[List[Entity]] = None + measures: Optional[List[Measure]] = None + model: str + primary_entity: Optional[str] = None + + +class ColumnProperties(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + name: str + description: Optional[str] = None + constraints: Optional[Constraints] = None + data_tests: Optional[List[DataTests]] = None + data_type: Optional[str] = None + meta: Optional[Dict[str, Any]] = None + policy_tags: Optional[List[str]] = Field( + None, + description="Configurations, specific to BigQuery adapter, used to set policy tags on specific columns, enabling column-level security. Only relevant when `persist_docs.columns` is true.", + title="Policy tags", + ) + quote: Optional[BooleanOrJinjaString] = None + tags: Optional[StringOrArrayOfStrings] = None + tests: Optional[List[DataTests]] = None + + +class Version(BaseModel): + columns: Optional[List[Union[IncludeExclude, ColumnProperties]]] = None + config: Optional[ModelConfigs] = None + v: float + + +class Model(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + name: str + description: Optional[str] = None + access: Optional[Access] = None + columns: Optional[List[ColumnProperties]] = None + config: Optional[ModelConfigs] = None + constraints: Optional[Constraints] = None + data_tests: Optional[List[DataTests]] = None + deprecation_date: Optional[str] = None + docs: Optional[DocsConfig] = None + group: Optional[GroupName] = None + latest_version: Optional[float] = None + meta: Optional[Dict[str, Any]] = None + tests: Optional[List[DataTests]] = None + versions: Optional[List[Version]] = None + + +class Seed(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + name: str + description: Optional[str] = None + columns: Optional[List[ColumnProperties]] = None + config: Optional[SeedConfig] = Field(None, title="Seed Config") + docs: Optional[DocsConfig] = None + group: Optional[GroupName] = None + tests: Optional[List[DataTests]] = None + + +class Snapshot(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + name: str + description: Optional[str] = None + columns: Optional[List[ColumnProperties]] = None + config: Optional[SnapshotConfig] = Field(None, title="Snapshot Config") + data_tests: Optional[List[DataTests]] = None + docs: Optional[DocsConfig] = None + group: Optional[GroupName] = None + meta: Optional[Dict[str, Any]] = None + tests: Optional[List[DataTests]] = None + + +class Table(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + name: str = Field( + ..., + description="How you will identify the table in {{ source() }} calls. Unless `identifier` is also set, this will be the name of the table in the database.", + title="Name", + ) + description: Optional[str] = None + columns: Optional[List[ColumnProperties]] = None + external: Optional[Dict[str, Any]] = None + freshness: Optional[FreshnessDefinition] = None + identifier: Optional[str] = Field( + None, + description="The table name as stored in the database. Only needed if you want to give the source a different name than what exists in the database (otherwise `name` is used by default)", + title="Identifier", + ) + loaded_at_field: Optional[str] = Field( + None, + description="Which column to check during data freshness tests. Only needed if the table has a different loaded_at_field to the one defined on the source overall.", + ) + loader: Optional[str] = None + meta: Optional[Dict[str, Any]] = None + quoting: Optional[Quoting] = None + tags: Optional[StringOrArrayOfStrings] = None + tests: Optional[List[DataTests]] = None + + +class Source(BaseModel): + name: str = Field( + ..., + description="How you will identify the schema in {{ source() }} calls. Unless `schema` is also set, this will be the name of the schema in the database.", + ) + description: Optional[str] = None + config: Optional[Dict[str, Any]] = None + data_tests: Optional[List[DataTests]] = None + database: Optional[str] = None + freshness: Optional[FreshnessDefinition] = None + loaded_at_field: Optional[str] = None + loader: Optional[str] = None + meta: Optional[Dict[str, Any]] = None + overrides: Optional[str] = Field( + None, + description="The name of another package installed in your project. If that package has a source with the same name as this one, its properties will be applied on top of the base properties of the overridden source. https://docs.getdbt.com/reference/resource-properties/overrides", + title="Package to Override", + ) + quoting: Optional[Quoting] = None + schema_: Optional[str] = Field( + None, + alias="schema", + description="The schema name as stored in the database. Only needed if you want to use a different `name` than what exists in the database (otherwise `name` is used by default)", + ) + tables: Optional[List[Table]] = None + tags: Optional[StringOrArrayOfStrings] = None + tests: Optional[List[DataTests]] = None + + +class DbtYmlFiles(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) + version: Literal[2] = 2 + analyses: Optional[List[Analyse]] = None + exposures: Optional[List[Exposure]] = None + groups: Optional[List[Group]] = None + macros: Optional[List[Macro]] = None + metrics: Optional[List[Metric]] = None + models: Optional[List[Model]] = None + saved_queries: Optional[List[SavedQuery]] = None + seeds: Optional[List[Seed]] = None + semantic_models: Optional[List[SemanticModel]] = None + snapshots: Optional[List[Snapshot]] = None + sources: Optional[List[Source]] = None + unit_tests: Optional[List[UnitTest]] = None diff --git a/tests/latest/valid/dbt_yml_files.yml b/tests/latest/valid/dbt_yml_files.yml index 1b07fe1..7ec00a4 100644 --- a/tests/latest/valid/dbt_yml_files.yml +++ b/tests/latest/valid/dbt_yml_files.yml @@ -289,3 +289,28 @@ saved_queries: alias: my_export_alias export_as: table schema: my_export_schema_name + + +sources: + - name: jaffle_shop + database: raw + + freshness: # default freshness + warn_after: {count: 12, period: hour} + error_after: {count: 24, period: hour} + + loaded_at_field: _etl_loaded_at + + tables: + - name: customers # this will use the freshness defined above + + - name: orders + freshness: # make this a little more strict + warn_after: {count: 6, period: hour} + error_after: {count: 12, period: hour} + # Apply a where clause in the freshness query + filter: datediff('day', _etl_loaded_at, current_timestamp) < 2 + + + - name: product_skus + freshness: # do not check freshness for this table \ No newline at end of file From 8ea4b7772ae8b0089d6fed83934bfa4acdb5f853 Mon Sep 17 00:00:00 2001 From: Dave Connors Date: Mon, 5 Aug 2024 17:29:34 -0500 Subject: [PATCH 02/17] update script, and generate pydantic for all latest files --- src/generate.py | 34 ++- src/latest/dbt_cloud.py | 17 ++ src/latest/dbt_project.py | 562 +++++++++++++++++++++++++++++++++++++ src/latest/dependencies.py | 76 +++++ src/latest/selectors.py | 92 ++++++ 5 files changed, 769 insertions(+), 12 deletions(-) create mode 100644 src/latest/dbt_cloud.py create mode 100644 src/latest/dbt_project.py create mode 100644 src/latest/dependencies.py create mode 100644 src/latest/selectors.py diff --git a/src/generate.py b/src/generate.py index 1e1034d..b34cccd 100644 --- a/src/generate.py +++ b/src/generate.py @@ -1,19 +1,29 @@ import json import os +from latest.dbt_cloud import DbtCloud +from latest.dbt_project import DbtProject from latest.dbt_yml_files import DbtYmlFiles +from latest.dependencies import Dependencies, Packages +from latest.selectors import Selectors if __name__ == "__main__": - versions = ["latest"] - files = {"dbt_yml_files": DbtYmlFiles} - for v in versions: - output_directory = os.path.join( - os.path.dirname(__file__), "../", f"schemas/{v}-generated" + files = { + "dbt_yml_files": DbtYmlFiles, + "dependencies": Dependencies, + "packages": Packages, + "selectors": Selectors, + "dbt_project": DbtProject, + "dbt_cloud": DbtCloud, + + } + output_directory = os.path.join( + os.path.dirname(__file__), "../", f"schemas/latest-generated" + ) + for file_name, model in files.items(): + file_path = os.path.join( + output_directory, f"{file_name}-latest-generated.json" ) - for file_name, model in files.items(): - file_path = os.path.join( - output_directory, f"{file_name}-{v}-generated.json" - ) - schema = model.model_json_schema(mode="validation") - with open(file_path, "w") as file: - json.dump(schema, file, indent=2) + schema = model.model_json_schema(mode="validation") + with open(file_path, "w") as file: + json.dump(schema, file, indent=2) diff --git a/src/latest/dbt_cloud.py b/src/latest/dbt_cloud.py new file mode 100644 index 0000000..fc4c3df --- /dev/null +++ b/src/latest/dbt_cloud.py @@ -0,0 +1,17 @@ +# generated by datamodel-codegen: +# filename: dbt_cloud-latest.json +# timestamp: 2024-08-05T22:16:27+00:00 + +from __future__ import annotations + +from typing import Optional + +from pydantic import BaseModel, ConfigDict, Field + + +class DbtCloud(BaseModel): + model_config = ConfigDict( + extra='forbid', + ) + project_id: str = Field(..., alias='project-id') + defer_env_id: Optional[str] = Field(None, alias='defer-env-id') diff --git a/src/latest/dbt_project.py b/src/latest/dbt_project.py new file mode 100644 index 0000000..68be497 --- /dev/null +++ b/src/latest/dbt_project.py @@ -0,0 +1,562 @@ +# generated by datamodel-codegen: +# filename: dbt_project-latest.json +# timestamp: 2024-08-05T21:39:08+00:00 + +from __future__ import annotations + +from enum import Enum +from typing import Any, Dict, List, Optional, Union + +from pydantic import BaseModel, ConfigDict, Field, RootModel + + +class DbtCloud(BaseModel): + model_config = ConfigDict( + extra='allow', + ) + project_id: Optional[float] = Field(None, alias='project-id') + + +class Flags(BaseModel): + cache_selected_only: Optional[bool] = None + debug: Optional[bool] = None + fail_fast: Optional[bool] = None + indirect_selection: Optional[str] = None + log_format: Optional[str] = None + log_format_file: Optional[str] = None + log_level: Optional[str] = None + log_level_file: Optional[str] = None + partial_parse: Optional[bool] = None + populate_cache: Optional[bool] = None + printer_width: Optional[int] = None + require_explicit_package_overrides_for_builtin_materializations: Optional[bool] = ( + None + ) + require_resource_names_without_spaces: Optional[bool] = None + send_anonymous_usage_stats: Optional[bool] = None + source_freshness_run_project_hooks: Optional[bool] = None + static_parser: Optional[bool] = None + use_colors: Optional[bool] = None + use_colors_file: Optional[bool] = None + use_experimental_parser: Optional[bool] = None + version_check: Optional[bool] = None + warn_error: Optional[bool] = None + warn_error_options: Optional[Dict[str, Any]] = None + write_json: Optional[bool] = None + + +class Access(Enum): + private = 'private' + protected = 'protected' + public = 'public' + + +class Alias(RootModel[str]): + root: str + + +class ArrayOfStrings(RootModel[List[str]]): + root: List[str] + + +class ColumnTypes(RootModel[Dict[str, str]]): + root: Dict[str, str] + + +class Database(RootModel[str]): + root: str + + +class DocsConfig(BaseModel): + model_config = ConfigDict( + extra='forbid', + ) + node_color: Optional[str] = Field( + None, + description='The color of the node on the DAG in the documentation. It must be an Hex code or a valid CSS color name.', + pattern='^(#[a-fA-F0-9]{3}|#[a-fA-F0-9]{6}|[^#][a-zA-Z]*)$', + ) + show: Optional[bool] = True + + +class EmptyDirectory(RootModel[None]): + root: None + + +class ErrorIf(RootModel[str]): + root: str + + +class FailCalc(RootModel[str]): + root: str + + +class FileFormat(RootModel[str]): + root: str + + +class AuthorizedView(BaseModel): + model_config = ConfigDict( + extra='forbid', + ) + database: Optional[str] = None + project: Optional[str] = None + + +class AuthorizedViews(RootModel[List[AuthorizedView]]): + root: List[AuthorizedView] = Field( + ..., + description='Configuration, specific to BigQuery adapter, used to setup authorized views.', + title='Authorized views', + ) + + +class Group(RootModel[str]): + root: str + + +class HoursToExpiration(RootModel[float]): + root: float = Field( + ..., + description='Configuration specific to BigQuery adapter used to set an expiration delay (in hours) to a table.', + ) + + +class IncrementalStrategy(RootModel[str]): + root: str + + +class JinjaString(RootModel[str]): + root: str = Field(..., pattern='\\{\\{.*\\}\\}') + + +class KmsKeyName(RootModel[str]): + root: str = Field( + ..., + description='Configuration, specific to BigQuery adapter, of the KMS key name used for data encryption.', + ) + + +class LabelConfigs(RootModel[str]): + root: str = Field(..., pattern='^[a-z0-9_-]{0,64}$') + + +class LabelConfigs1(RootModel[Dict[str, Union[LabelConfigs, JinjaString]]]): + root: Dict[str, Union[LabelConfigs, JinjaString]] = Field( + ..., + description='Configurations specific to BigQuery adapter used to add labels and tags to tables & views created by dbt.', + title='Label configs', + ) + + +class Limit(RootModel[float]): + root: float + + +class Location(RootModel[str]): + root: str + + +class Materialized(RootModel[str]): + root: str + + +class Meta(BaseModel): + pass + + +class OnConfigurationChange(Enum): + apply = 'apply' + continue_ = 'continue' + fail = 'fail' + + +class OnSchemaChange(Enum): + append_new_columns = 'append_new_columns' + fail = 'fail' + ignore = 'ignore' + sync_all_columns = 'sync_all_columns' + + +class Schema(RootModel[Optional[str]]): + root: Optional[str] + + +class Severity1(Enum): + warn = 'warn' + error = 'error' + + +class Severity(RootModel[Union[JinjaString, Severity1]]): + root: Union[JinjaString, Severity1] + + +class SnowflakeWarehouse(RootModel[str]): + root: str + + +class SqlHeader(RootModel[str]): + root: str + + +class Strategy(RootModel[str]): + root: str + + +class StringOrArrayOfStrings(RootModel[Union[str, ArrayOfStrings]]): + root: Union[str, ArrayOfStrings] + + +class Tags(RootModel[StringOrArrayOfStrings]): + root: StringOrArrayOfStrings + + +class TargetDatabase(RootModel[str]): + root: str + + +class TargetLag(RootModel[str]): + root: str = Field( + ..., pattern='^(?:downstream|\\d+\\s*(?:seconds|minutes|hours|days))$' + ) + + +class TargetSchema(RootModel[str]): + root: str + + +class UnitTestConfigs(BaseModel): + field_meta: Optional[Meta] = Field(None, alias='+meta') + field_tags: Optional[Tags] = Field(None, alias='+tags') + meta: Optional[Meta] = None + tags: Optional[Tags] = None + + +class UpdatedAt(RootModel[str]): + root: str + + +class WarnIf(RootModel[str]): + root: str + + +class DispatchItem(BaseModel): + model_config = ConfigDict( + extra='forbid', + ) + macro_namespace: str + search_order: ArrayOfStrings + + +class BooleanOrJinjaString(RootModel[Union[JinjaString, bool]]): + root: Union[JinjaString, bool] + + +class Contract(BaseModel): + enforced: BooleanOrJinjaString + + +class DataTestConfigs(BaseModel): + field_alias: Optional[Alias] = Field(None, alias='+alias') + field_database: Optional[Database] = Field(None, alias='+database') + field_enabled: Optional[BooleanOrJinjaString] = Field(None, alias='+enabled') + field_error_if: Optional[ErrorIf] = Field(None, alias='+error_if') + field_fail_calc: Optional[FailCalc] = Field(None, alias='+fail_calc') + field_group: Optional[Group] = Field(None, alias='+group') + field_limit: Optional[Limit] = Field(None, alias='+limit') + field_meta: Optional[Meta] = Field(None, alias='+meta') + field_schema: Optional[Schema] = Field(None, alias='+schema') + field_severity: Optional[Severity] = Field(None, alias='+severity') + field_store_failures: Optional[BooleanOrJinjaString] = Field( + None, alias='+store_failures' + ) + field_tags: Optional[Tags] = Field(None, alias='+tags') + field_warn_if: Optional[WarnIf] = Field(None, alias='+warn_if') + alias: Optional[Alias] = None + database: Optional[Database] = None + enabled: Optional[BooleanOrJinjaString] = None + error_if: Optional[ErrorIf] = None + fail_calc: Optional[FailCalc] = None + group: Optional[Group] = None + limit: Optional[Limit] = None + meta: Optional[Meta] = None + schema_: Optional[Schema] = Field(None, alias='schema') + severity: Optional[Severity] = None + store_failures: Optional[BooleanOrJinjaString] = None + tags: Optional[Tags] = None + warn_if: Optional[WarnIf] = None + + +class Grants(RootModel[Dict[str, StringOrArrayOfStrings]]): + root: Dict[str, StringOrArrayOfStrings] = Field( + ..., + description='grant config. each key is a database permission and the value is the grantee of that permission', + ) + + +class InvalidateHardDeletes(RootModel[BooleanOrJinjaString]): + root: BooleanOrJinjaString + + +class PersistDocsConfig(BaseModel): + model_config = ConfigDict( + extra='forbid', + ) + columns: Optional[BooleanOrJinjaString] = Field( + default_factory=lambda: BooleanOrJinjaString.model_validate(True) + ) + relation: Optional[BooleanOrJinjaString] = Field( + default_factory=lambda: BooleanOrJinjaString.model_validate(True) + ) + + +class SeedConfigs(BaseModel): + field_column_types: Optional[ColumnTypes] = Field(None, alias='+column_types') + field_copy_grants: Optional[BooleanOrJinjaString] = Field( + None, alias='+copy_grants' + ) + field_database: Optional[Database] = Field(None, alias='+database') + field_docs: Optional[DocsConfig] = Field(None, alias='+docs') + field_enabled: Optional[BooleanOrJinjaString] = Field(None, alias='+enabled') + field_full_refresh: Optional[BooleanOrJinjaString] = Field( + None, alias='+full_refresh' + ) + field_grants: Optional[Grants] = Field(None, alias='+grants') + field_group: Optional[Group] = Field(None, alias='+group') + field_meta: Optional[Meta] = Field(None, alias='+meta') + field_persist_docs: Optional[PersistDocsConfig] = Field(None, alias='+persist_docs') + field_quote_columns: Optional[BooleanOrJinjaString] = Field( + None, alias='+quote_columns' + ) + field_schema: Optional[Schema] = Field(None, alias='+schema') + field_tags: Optional[Tags] = Field(None, alias='+tags') + field_transient: Optional[BooleanOrJinjaString] = Field(None, alias='+transient') + column_types: Optional[ColumnTypes] = None + copy_grants: Optional[BooleanOrJinjaString] = None + database: Optional[Database] = None + docs: Optional[DocsConfig] = None + enabled: Optional[BooleanOrJinjaString] = None + full_refresh: Optional[BooleanOrJinjaString] = None + grants: Optional[Grants] = None + group: Optional[Group] = None + meta: Optional[Meta] = None + persist_docs: Optional[PersistDocsConfig] = None + quote_columns: Optional[BooleanOrJinjaString] = None + schema_: Optional[Schema] = Field(None, alias='schema') + tags: Optional[Tags] = None + transient: Optional[BooleanOrJinjaString] = None + + +class SnapshotConfigs(BaseModel): + field_alias: Optional[Alias] = Field(None, alias='+alias') + field_check_cols: Optional[StringOrArrayOfStrings] = Field( + None, alias='+check_cols' + ) + field_docs: Optional[DocsConfig] = Field(None, alias='+docs') + field_enabled: Optional[BooleanOrJinjaString] = Field(None, alias='+enabled') + field_grants: Optional[Grants] = Field(None, alias='+grants') + field_group: Optional[Group] = Field(None, alias='+group') + field_invalidate_hard_deletes: Optional[InvalidateHardDeletes] = Field( + None, alias='+invalidate_hard_deletes' + ) + field_meta: Optional[Meta] = Field(None, alias='+meta') + field_persist_docs: Optional[PersistDocsConfig] = Field(None, alias='+persist_docs') + field_post_hook: Optional[ArrayOfStrings] = Field(None, alias='+post-hook') + field_pre_hook: Optional[ArrayOfStrings] = Field(None, alias='+pre-hook') + field_quote_columns: Optional[BooleanOrJinjaString] = Field( + None, alias='+quote_columns' + ) + field_strategy: Optional[Strategy] = Field(None, alias='+strategy') + field_tags: Optional[Tags] = Field(None, alias='+tags') + field_target_database: Optional[TargetDatabase] = Field( + None, alias='+target_database' + ) + field_target_schema: Optional[TargetSchema] = Field(None, alias='+target_schema') + field_transient: Optional[BooleanOrJinjaString] = Field(None, alias='+transient') + field_unique_key: Optional[StringOrArrayOfStrings] = Field( + None, alias='+unique_key' + ) + field_updated_at: Optional[UpdatedAt] = Field(None, alias='+updated_at') + alias: Optional[Alias] = None + check_cols: Optional[StringOrArrayOfStrings] = None + docs: Optional[DocsConfig] = None + enabled: Optional[BooleanOrJinjaString] = None + grants: Optional[Grants] = None + group: Optional[Group] = None + invalidate_hard_deletes: Optional[InvalidateHardDeletes] = None + meta: Optional[Meta] = None + persist_docs: Optional[PersistDocsConfig] = None + post_hook: Optional[ArrayOfStrings] = Field(None, alias='post-hook') + pre_hook: Optional[ArrayOfStrings] = Field(None, alias='pre-hook') + quote_columns: Optional[BooleanOrJinjaString] = None + strategy: Optional[Strategy] = None + tags: Optional[Tags] = None + target_database: Optional[TargetDatabase] = None + target_schema: Optional[TargetSchema] = None + transient: Optional[BooleanOrJinjaString] = None + unique_key: Optional[StringOrArrayOfStrings] = None + updated_at: Optional[UpdatedAt] = None + + +class SourceConfigs(BaseModel): + field_enabled: Optional[BooleanOrJinjaString] = Field(None, alias='+enabled') + field_meta: Optional[Meta] = Field(None, alias='+meta') + field_tags: Optional[Tags] = Field(None, alias='+tags') + enabled: Optional[BooleanOrJinjaString] = None + meta: Optional[Meta] = None + tags: Optional[Tags] = None + + +class QueryComment(BaseModel): + model_config = ConfigDict( + extra='forbid', + ) + append: Optional[BooleanOrJinjaString] = None + comment: Optional[str] = None + job_label: Optional[BooleanOrJinjaString] = Field(None, alias='job-label') + + +class Quoting(BaseModel): + database: Optional[BooleanOrJinjaString] = None + identifier: Optional[BooleanOrJinjaString] = None + schema_: Optional[BooleanOrJinjaString] = Field(None, alias='schema') + + +class AutoRefresh(RootModel[BooleanOrJinjaString]): + root: BooleanOrJinjaString + + +class Backup(RootModel[BooleanOrJinjaString]): + root: BooleanOrJinjaString + + +class ModelConfigs(BaseModel): + field_access: Optional[Access] = Field(None, alias='+access') + field_alias: Optional[Alias] = Field(None, alias='+alias') + field_auto_refresh: Optional[AutoRefresh] = Field(None, alias='+auto_refresh') + field_backup: Optional[Backup] = Field(None, alias='+backup') + field_bind: Optional[BooleanOrJinjaString] = Field(False, alias='+bind') + field_contract: Optional[Contract] = Field(None, alias='+contract') + field_copy_grants: Optional[BooleanOrJinjaString] = Field( + None, alias='+copy_grants' + ) + field_database: Optional[Database] = Field(None, alias='+database') + field_docs: Optional[DocsConfig] = Field(None, alias='+docs') + field_enabled: Optional[BooleanOrJinjaString] = Field(None, alias='+enabled') + field_file_format: Optional[FileFormat] = Field(None, alias='+file_format') + field_full_refresh: Optional[BooleanOrJinjaString] = Field( + None, alias='+full_refresh' + ) + field_grant_access_to: Optional[AuthorizedViews] = Field( + None, alias='+grant_access_to' + ) + field_grants: Optional[Grants] = Field(None, alias='+grants') + field_group: Optional[Group] = Field(None, alias='+group') + field_hours_to_expiration: Optional[HoursToExpiration] = Field( + None, alias='+hours_to_expiration' + ) + field_incremental_strategy: Optional[IncrementalStrategy] = Field( + None, alias='+incremental_strategy' + ) + field_kms_key_name: Optional[KmsKeyName] = Field(None, alias='+kms_key_name') + field_labels: Optional[LabelConfigs1] = Field(None, alias='+labels') + field_location: Optional[Location] = Field(None, alias='+location') + field_materialized: Optional[Materialized] = Field(None, alias='+materialized') + field_meta: Optional[Meta] = Field(None, alias='+meta') + field_on_configuration_change: Optional[OnConfigurationChange] = Field( + None, alias='+on_configuration_change' + ) + field_on_schema_change: Optional[OnSchemaChange] = Field( + None, alias='+on_schema_change' + ) + field_persist_docs: Optional[PersistDocsConfig] = Field(None, alias='+persist_docs') + field_post_hook: Optional[ArrayOfStrings] = Field(None, alias='+post-hook') + field_pre_hook: Optional[ArrayOfStrings] = Field(None, alias='+pre-hook') + field_schema: Optional[Schema] = Field(None, alias='+schema') + field_secure: Optional[BooleanOrJinjaString] = Field(False, alias='+secure') + field_snowflake_warehouse: Optional[SnowflakeWarehouse] = Field( + None, alias='+snowflake_warehouse' + ) + field_sql_header: Optional[SqlHeader] = Field(None, alias='+sql_header') + field_tags: Optional[Tags] = Field(None, alias='+tags') + field_target_lag: Optional[TargetLag] = Field(None, alias='+target_lag') + field_transient: Optional[BooleanOrJinjaString] = Field(None, alias='+transient') + access: Optional[Access] = None + alias: Optional[Alias] = None + auto_refresh: Optional[AutoRefresh] = None + backup: Optional[Backup] = None + bind: Optional[BooleanOrJinjaString] = False + contract: Optional[Contract] = None + copy_grants: Optional[BooleanOrJinjaString] = None + database: Optional[Database] = None + docs: Optional[DocsConfig] = None + enabled: Optional[BooleanOrJinjaString] = None + file_format: Optional[FileFormat] = None + full_refresh: Optional[BooleanOrJinjaString] = None + grant_access_to: Optional[AuthorizedViews] = None + grants: Optional[Grants] = None + group: Optional[Group] = None + hours_to_expiration: Optional[HoursToExpiration] = None + incremental_strategy: Optional[IncrementalStrategy] = None + kms_key_name: Optional[KmsKeyName] = None + labels: Optional[LabelConfigs1] = None + location: Optional[Location] = None + materialized: Optional[Materialized] = None + meta: Optional[Meta] = None + on_configuration_change: Optional[OnConfigurationChange] = None + on_schema_change: Optional[OnSchemaChange] = None + persist_docs: Optional[PersistDocsConfig] = None + post_hook: Optional[ArrayOfStrings] = Field(None, alias='post-hook') + pre_hook: Optional[ArrayOfStrings] = Field(None, alias='pre-hook') + schema_: Optional[Schema] = Field(None, alias='schema') + secure: Optional[BooleanOrJinjaString] = False + snowflake_warehouse: Optional[SnowflakeWarehouse] = None + sql_header: Optional[SqlHeader] = None + tags: Optional[Tags] = None + target_lag: Optional[TargetLag] = None + transient: Optional[BooleanOrJinjaString] = None + + +class DbtProject(BaseModel): + model_config = ConfigDict( + extra='forbid', + protected_namespaces=[] + ) + version: Optional[str] = None + name: str + analysis_paths: Optional[ArrayOfStrings] = Field(None, alias='analysis-paths') + asset_paths: Optional[ArrayOfStrings] = Field(None, alias='asset-paths') + clean_targets: Optional[ArrayOfStrings] = Field(None, alias='clean-targets') + config_version: Optional[float] = Field(2, alias='config-version') + data_tests: Optional[DataTestConfigs] = None + dbt_cloud: Optional[DbtCloud] = Field(None, alias='dbt-cloud') + dispatch: Optional[List[DispatchItem]] = None + docs_paths: Optional[ArrayOfStrings] = Field(None, alias='docs-paths') + flags: Optional[Flags] = None + log_path: Optional[str] = Field(None, alias='log-path') + macro_paths: Optional[ArrayOfStrings] = Field(None, alias='macro-paths') + model_paths: Optional[ArrayOfStrings] = Field(None, alias='model-paths') + models: Optional[ModelConfigs] = None + on_run_end: Optional[Union[ArrayOfStrings, str]] = Field(None, alias='on-run-end') + on_run_start: Optional[Union[ArrayOfStrings, str]] = Field( + None, alias='on-run-start' + ) + packages_install_path: Optional[str] = Field(None, alias='packages-install-path') + profile: Optional[str] = None + query_comment: Optional[Union[str, QueryComment]] = Field( + None, alias='query-comment' + ) + quoting: Optional[Quoting] = None + require_dbt_version: Optional[StringOrArrayOfStrings] = Field( + None, alias='require-dbt-version' + ) + seed_paths: Optional[ArrayOfStrings] = Field(None, alias='seed-paths') + seeds: Optional[SeedConfigs] = None + snapshot_paths: Optional[ArrayOfStrings] = Field(None, alias='snapshot-paths') + snapshots: Optional[SnapshotConfigs] = None + sources: Optional[SourceConfigs] = None + target_path: Optional[str] = Field(None, alias='target-path') + test_paths: Optional[ArrayOfStrings] = Field(None, alias='test-paths') + tests: Optional[DataTestConfigs] = None + unit_tests: Optional[UnitTestConfigs] = None + vars: Optional[Dict[str, Any]] = None diff --git a/src/latest/dependencies.py b/src/latest/dependencies.py new file mode 100644 index 0000000..48b1e11 --- /dev/null +++ b/src/latest/dependencies.py @@ -0,0 +1,76 @@ +# generated by datamodel-codegen: +# filename: dependencies-latest.json +# timestamp: 2024-08-05T21:14:54+00:00 + +from __future__ import annotations + +from typing import Any, List, Optional, Union + +from pydantic import BaseModel, ConfigDict, Field + + +class Project(BaseModel): + model_config = ConfigDict( + extra='forbid', + ) + name: str + + +class HubPackages(BaseModel): + model_config = ConfigDict( + extra='forbid', + ) + version: Union[str, float, List[Any]] = Field( + ..., + description='A semantic version string or range, such as [">=1.0.0", "<2.0.0"]', + title='Package version', + ) + install_prerelease: Optional[bool] = Field( + None, + alias='install-prerelease', + description='Opt in to prerelease versions of a package', + title='Install Prerelease', + ) + package: str = Field( + ..., + description='Must be in format `org_name/package_name`. Refer to hub.getdbt.com for installation instructions', + examples=['dbt-labs/dbt_utils'], + pattern='^[\\w\\-\\.]+/[\\w\\-\\.]+$', + title='Package identifier', + ) + + +class GitPackages(BaseModel): + model_config = ConfigDict( + extra='forbid', + ) + git: str = Field(..., title='Git URL') + revision: Optional[str] = Field( + None, + description='Pin your package to a specific release by specifying a release name', + title='Revision', + ) + subdirectory: Optional[str] = Field( + None, + description='Only required if the package is nested in a subdirectory of the git project', + title='Subdirectory', + ) + + +class LocalPackage(BaseModel): + model_config = ConfigDict( + extra='forbid', + ) + local: Optional[str] = None + + +class Packages(BaseModel): + model_config = ConfigDict( + extra='forbid', + ) + packages: Optional[List[Union[HubPackages, GitPackages, LocalPackage]]] = Field( + None, min_length=1 + ) + +class Dependencies(Packages): + projects: Optional[List[Project]] = None \ No newline at end of file diff --git a/src/latest/selectors.py b/src/latest/selectors.py new file mode 100644 index 0000000..859ffba --- /dev/null +++ b/src/latest/selectors.py @@ -0,0 +1,92 @@ +# generated by datamodel-codegen: +# filename: selectors-latest.json +# timestamp: 2024-08-05T21:30:57+00:00 + +from __future__ import annotations + +from enum import Enum +from typing import List, Optional, Union + +from pydantic import BaseModel, ConfigDict, Field, RootModel + + +class Default(RootModel[str]): + root: str = Field(..., pattern='\\{\\{.*\\}\\}') + + +class Method(Enum): + tag = 'tag' + source = 'source' + path = 'path' + file = 'file' + fqn = 'fqn' + package = 'package' + config = 'config' + test_type = 'test_type' + test_name = 'test_name' + state = 'state' + exposure = 'exposure' + metric = 'metric' + result = 'result' + source_status = 'source_status' + group = 'group' + wildcard = 'wildcard' + + +class IndirectSelection(Enum): + buildable = 'buildable' + cautious = 'cautious' + eager = 'eager' + + +class JinjaString(RootModel[str]): + root: str = Field(..., pattern='\\{\\{.*\\}\\}') + + +class BooleanOrJinjaString(RootModel[Union[JinjaString, bool]]): + root: Union[JinjaString, bool] + + +class DefinitionBlock(BaseModel): + model_config = ConfigDict( + extra='allow', + ) + method: Optional[Method] = None + value: Optional[str] = None + children: Optional[BooleanOrJinjaString] = None + parents: Optional[BooleanOrJinjaString] = None + children_depth: Optional[float] = None + parents_depth: Optional[float] = None + childrens_parents: Optional[BooleanOrJinjaString] = None + indirect_selection: Optional[IndirectSelection] = None + + +class IntersectionBlock(RootModel[List[DefinitionBlock]]): + root: List[DefinitionBlock] + + +class ExcludeBlock(RootModel[List[Union[IntersectionBlock, DefinitionBlock]]]): + root: List[Union[IntersectionBlock, DefinitionBlock]] + + +class UnionBlock( + RootModel[List[Union[IntersectionBlock, DefinitionBlock, ExcludeBlock]]] +): + root: List[Union[IntersectionBlock, DefinitionBlock, ExcludeBlock]] + + +class Selector(BaseModel): + model_config = ConfigDict( + extra='forbid', + ) + name: Optional[str] = None + description: Optional[str] = None + default: Optional[Union[Default, bool]] = None + definition: Optional[Union[DefinitionBlock, str, UnionBlock]] = None + + +class Selectors(BaseModel): + model_config = ConfigDict( + extra='forbid', + ) + selectors: List[Selector] = Field(..., min_length=1) From 12573aa0f1d02a367ed8510aed070949206288ff Mon Sep 17 00:00:00 2001 From: Dave Connors Date: Mon, 5 Aug 2024 17:29:59 -0500 Subject: [PATCH 03/17] add env to gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 873a2cb..ed66080 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,5 @@ .DS_Store node_modules/ .venv +env __pycache__ \ No newline at end of file From b99f338f8200a28907df0d5768d1ab8aadeda6e2 Mon Sep 17 00:00:00 2001 From: Dave Connors Date: Mon, 5 Aug 2024 17:30:28 -0500 Subject: [PATCH 04/17] add autogenerated schemas --- .../dbt_cloud-latest-generated.json | 26 + .../dbt_project-latest-generated.json | 3043 +++++++++++++++++ .../dependencies-latest-generated.json | 172 + .../packages-latest-generated.json | 143 + .../selectors-latest-generated.json | 272 ++ 5 files changed, 3656 insertions(+) create mode 100644 schemas/latest-generated/dbt_cloud-latest-generated.json create mode 100644 schemas/latest-generated/dbt_project-latest-generated.json create mode 100644 schemas/latest-generated/dependencies-latest-generated.json create mode 100644 schemas/latest-generated/packages-latest-generated.json create mode 100644 schemas/latest-generated/selectors-latest-generated.json diff --git a/schemas/latest-generated/dbt_cloud-latest-generated.json b/schemas/latest-generated/dbt_cloud-latest-generated.json new file mode 100644 index 0000000..e9d76cd --- /dev/null +++ b/schemas/latest-generated/dbt_cloud-latest-generated.json @@ -0,0 +1,26 @@ +{ + "additionalProperties": false, + "properties": { + "project-id": { + "title": "Project-Id", + "type": "string" + }, + "defer-env-id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Defer-Env-Id" + } + }, + "required": [ + "project-id" + ], + "title": "DbtCloud", + "type": "object" +} \ No newline at end of file diff --git a/schemas/latest-generated/dbt_project-latest-generated.json b/schemas/latest-generated/dbt_project-latest-generated.json new file mode 100644 index 0000000..3a7e1a4 --- /dev/null +++ b/schemas/latest-generated/dbt_project-latest-generated.json @@ -0,0 +1,3043 @@ +{ + "$defs": { + "Access": { + "enum": [ + "private", + "protected", + "public" + ], + "title": "Access", + "type": "string" + }, + "Alias": { + "title": "Alias", + "type": "string" + }, + "ArrayOfStrings": { + "items": { + "type": "string" + }, + "title": "ArrayOfStrings", + "type": "array" + }, + "AuthorizedView": { + "additionalProperties": false, + "properties": { + "database": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Database" + }, + "project": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Project" + } + }, + "title": "AuthorizedView", + "type": "object" + }, + "AuthorizedViews": { + "description": "Configuration, specific to BigQuery adapter, used to setup authorized views.", + "items": { + "$ref": "#/$defs/AuthorizedView" + }, + "title": "AuthorizedViews", + "type": "array" + }, + "AutoRefresh": { + "allOf": [ + { + "$ref": "#/$defs/BooleanOrJinjaString" + } + ], + "title": "AutoRefresh" + }, + "Backup": { + "allOf": [ + { + "$ref": "#/$defs/BooleanOrJinjaString" + } + ], + "title": "Backup" + }, + "BooleanOrJinjaString": { + "anyOf": [ + { + "$ref": "#/$defs/JinjaString" + }, + { + "type": "boolean" + } + ], + "title": "BooleanOrJinjaString" + }, + "ColumnTypes": { + "additionalProperties": { + "type": "string" + }, + "title": "ColumnTypes", + "type": "object" + }, + "Contract": { + "properties": { + "enforced": { + "$ref": "#/$defs/BooleanOrJinjaString" + } + }, + "required": [ + "enforced" + ], + "title": "Contract", + "type": "object" + }, + "DataTestConfigs": { + "properties": { + "+alias": { + "anyOf": [ + { + "$ref": "#/$defs/Alias" + }, + { + "type": "null" + } + ], + "default": null + }, + "+database": { + "anyOf": [ + { + "$ref": "#/$defs/Database" + }, + { + "type": "null" + } + ], + "default": null + }, + "+enabled": { + "anyOf": [ + { + "$ref": "#/$defs/BooleanOrJinjaString" + }, + { + "type": "null" + } + ], + "default": null + }, + "+error_if": { + "anyOf": [ + { + "$ref": "#/$defs/ErrorIf" + }, + { + "type": "null" + } + ], + "default": null + }, + "+fail_calc": { + "anyOf": [ + { + "$ref": "#/$defs/FailCalc" + }, + { + "type": "null" + } + ], + "default": null + }, + "+group": { + "anyOf": [ + { + "$ref": "#/$defs/Group" + }, + { + "type": "null" + } + ], + "default": null + }, + "+limit": { + "anyOf": [ + { + "$ref": "#/$defs/Limit" + }, + { + "type": "null" + } + ], + "default": null + }, + "+meta": { + "anyOf": [ + { + "$ref": "#/$defs/Meta" + }, + { + "type": "null" + } + ], + "default": null + }, + "+schema": { + "anyOf": [ + { + "$ref": "#/$defs/Schema" + }, + { + "type": "null" + } + ], + "default": null + }, + "+severity": { + "anyOf": [ + { + "$ref": "#/$defs/Severity" + }, + { + "type": "null" + } + ], + "default": null + }, + "+store_failures": { + "anyOf": [ + { + "$ref": "#/$defs/BooleanOrJinjaString" + }, + { + "type": "null" + } + ], + "default": null + }, + "+tags": { + "anyOf": [ + { + "$ref": "#/$defs/Tags" + }, + { + "type": "null" + } + ], + "default": null + }, + "+warn_if": { + "anyOf": [ + { + "$ref": "#/$defs/WarnIf" + }, + { + "type": "null" + } + ], + "default": null + }, + "alias": { + "anyOf": [ + { + "$ref": "#/$defs/Alias" + }, + { + "type": "null" + } + ], + "default": null + }, + "database": { + "anyOf": [ + { + "$ref": "#/$defs/Database" + }, + { + "type": "null" + } + ], + "default": null + }, + "enabled": { + "anyOf": [ + { + "$ref": "#/$defs/BooleanOrJinjaString" + }, + { + "type": "null" + } + ], + "default": null + }, + "error_if": { + "anyOf": [ + { + "$ref": "#/$defs/ErrorIf" + }, + { + "type": "null" + } + ], + "default": null + }, + "fail_calc": { + "anyOf": [ + { + "$ref": "#/$defs/FailCalc" + }, + { + "type": "null" + } + ], + "default": null + }, + "group": { + "anyOf": [ + { + "$ref": "#/$defs/Group" + }, + { + "type": "null" + } + ], + "default": null + }, + "limit": { + "anyOf": [ + { + "$ref": "#/$defs/Limit" + }, + { + "type": "null" + } + ], + "default": null + }, + "meta": { + "anyOf": [ + { + "$ref": "#/$defs/Meta" + }, + { + "type": "null" + } + ], + "default": null + }, + "schema": { + "anyOf": [ + { + "$ref": "#/$defs/Schema" + }, + { + "type": "null" + } + ], + "default": null + }, + "severity": { + "anyOf": [ + { + "$ref": "#/$defs/Severity" + }, + { + "type": "null" + } + ], + "default": null + }, + "store_failures": { + "anyOf": [ + { + "$ref": "#/$defs/BooleanOrJinjaString" + }, + { + "type": "null" + } + ], + "default": null + }, + "tags": { + "anyOf": [ + { + "$ref": "#/$defs/Tags" + }, + { + "type": "null" + } + ], + "default": null + }, + "warn_if": { + "anyOf": [ + { + "$ref": "#/$defs/WarnIf" + }, + { + "type": "null" + } + ], + "default": null + } + }, + "title": "DataTestConfigs", + "type": "object" + }, + "Database": { + "title": "Database", + "type": "string" + }, + "DbtCloud": { + "additionalProperties": true, + "properties": { + "project-id": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Project-Id" + } + }, + "title": "DbtCloud", + "type": "object" + }, + "DispatchItem": { + "additionalProperties": false, + "properties": { + "macro_namespace": { + "title": "Macro Namespace", + "type": "string" + }, + "search_order": { + "$ref": "#/$defs/ArrayOfStrings" + } + }, + "required": [ + "macro_namespace", + "search_order" + ], + "title": "DispatchItem", + "type": "object" + }, + "DocsConfig": { + "additionalProperties": false, + "properties": { + "node_color": { + "anyOf": [ + { + "pattern": "^(#[a-fA-F0-9]{3}|#[a-fA-F0-9]{6}|[^#][a-zA-Z]*)$", + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "The color of the node on the DAG in the documentation. It must be an Hex code or a valid CSS color name.", + "title": "Node Color" + }, + "show": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "default": true, + "title": "Show" + } + }, + "title": "DocsConfig", + "type": "object" + }, + "ErrorIf": { + "title": "ErrorIf", + "type": "string" + }, + "FailCalc": { + "title": "FailCalc", + "type": "string" + }, + "FileFormat": { + "title": "FileFormat", + "type": "string" + }, + "Flags": { + "properties": { + "cache_selected_only": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Cache Selected Only" + }, + "debug": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Debug" + }, + "fail_fast": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Fail Fast" + }, + "indirect_selection": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Indirect Selection" + }, + "log_format": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Log Format" + }, + "log_format_file": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Log Format File" + }, + "log_level": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Log Level" + }, + "log_level_file": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Log Level File" + }, + "partial_parse": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Partial Parse" + }, + "populate_cache": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Populate Cache" + }, + "printer_width": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Printer Width" + }, + "require_explicit_package_overrides_for_builtin_materializations": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Require Explicit Package Overrides For Builtin Materializations" + }, + "require_resource_names_without_spaces": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Require Resource Names Without Spaces" + }, + "send_anonymous_usage_stats": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Send Anonymous Usage Stats" + }, + "source_freshness_run_project_hooks": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Source Freshness Run Project Hooks" + }, + "static_parser": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Static Parser" + }, + "use_colors": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Use Colors" + }, + "use_colors_file": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Use Colors File" + }, + "use_experimental_parser": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Use Experimental Parser" + }, + "version_check": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Version Check" + }, + "warn_error": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Warn Error" + }, + "warn_error_options": { + "anyOf": [ + { + "type": "object" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Warn Error Options" + }, + "write_json": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Write Json" + } + }, + "title": "Flags", + "type": "object" + }, + "Grants": { + "additionalProperties": { + "$ref": "#/$defs/StringOrArrayOfStrings" + }, + "description": "grant config. each key is a database permission and the value is the grantee of that permission", + "title": "Grants", + "type": "object" + }, + "Group": { + "title": "Group", + "type": "string" + }, + "HoursToExpiration": { + "description": "Configuration specific to BigQuery adapter used to set an expiration delay (in hours) to a table.", + "title": "HoursToExpiration", + "type": "number" + }, + "IncrementalStrategy": { + "title": "IncrementalStrategy", + "type": "string" + }, + "InvalidateHardDeletes": { + "allOf": [ + { + "$ref": "#/$defs/BooleanOrJinjaString" + } + ], + "title": "InvalidateHardDeletes" + }, + "JinjaString": { + "pattern": "\\{\\{.*\\}\\}", + "title": "JinjaString", + "type": "string" + }, + "KmsKeyName": { + "description": "Configuration, specific to BigQuery adapter, of the KMS key name used for data encryption.", + "title": "KmsKeyName", + "type": "string" + }, + "LabelConfigs": { + "pattern": "^[a-z0-9_-]{0,64}$", + "title": "LabelConfigs", + "type": "string" + }, + "LabelConfigs1": { + "additionalProperties": { + "anyOf": [ + { + "$ref": "#/$defs/LabelConfigs" + }, + { + "$ref": "#/$defs/JinjaString" + } + ] + }, + "description": "Configurations specific to BigQuery adapter used to add labels and tags to tables & views created by dbt.", + "title": "LabelConfigs1", + "type": "object" + }, + "Limit": { + "title": "Limit", + "type": "number" + }, + "Location": { + "title": "Location", + "type": "string" + }, + "Materialized": { + "title": "Materialized", + "type": "string" + }, + "Meta": { + "properties": {}, + "title": "Meta", + "type": "object" + }, + "ModelConfigs": { + "properties": { + "+access": { + "anyOf": [ + { + "$ref": "#/$defs/Access" + }, + { + "type": "null" + } + ], + "default": null + }, + "+alias": { + "anyOf": [ + { + "$ref": "#/$defs/Alias" + }, + { + "type": "null" + } + ], + "default": null + }, + "+auto_refresh": { + "anyOf": [ + { + "$ref": "#/$defs/AutoRefresh" + }, + { + "type": "null" + } + ], + "default": null + }, + "+backup": { + "anyOf": [ + { + "$ref": "#/$defs/Backup" + }, + { + "type": "null" + } + ], + "default": null + }, + "+bind": { + "anyOf": [ + { + "$ref": "#/$defs/BooleanOrJinjaString" + }, + { + "type": "null" + } + ], + "default": false + }, + "+contract": { + "anyOf": [ + { + "$ref": "#/$defs/Contract" + }, + { + "type": "null" + } + ], + "default": null + }, + "+copy_grants": { + "anyOf": [ + { + "$ref": "#/$defs/BooleanOrJinjaString" + }, + { + "type": "null" + } + ], + "default": null + }, + "+database": { + "anyOf": [ + { + "$ref": "#/$defs/Database" + }, + { + "type": "null" + } + ], + "default": null + }, + "+docs": { + "anyOf": [ + { + "$ref": "#/$defs/DocsConfig" + }, + { + "type": "null" + } + ], + "default": null + }, + "+enabled": { + "anyOf": [ + { + "$ref": "#/$defs/BooleanOrJinjaString" + }, + { + "type": "null" + } + ], + "default": null + }, + "+file_format": { + "anyOf": [ + { + "$ref": "#/$defs/FileFormat" + }, + { + "type": "null" + } + ], + "default": null + }, + "+full_refresh": { + "anyOf": [ + { + "$ref": "#/$defs/BooleanOrJinjaString" + }, + { + "type": "null" + } + ], + "default": null + }, + "+grant_access_to": { + "anyOf": [ + { + "$ref": "#/$defs/AuthorizedViews" + }, + { + "type": "null" + } + ], + "default": null + }, + "+grants": { + "anyOf": [ + { + "$ref": "#/$defs/Grants" + }, + { + "type": "null" + } + ], + "default": null + }, + "+group": { + "anyOf": [ + { + "$ref": "#/$defs/Group" + }, + { + "type": "null" + } + ], + "default": null + }, + "+hours_to_expiration": { + "anyOf": [ + { + "$ref": "#/$defs/HoursToExpiration" + }, + { + "type": "null" + } + ], + "default": null + }, + "+incremental_strategy": { + "anyOf": [ + { + "$ref": "#/$defs/IncrementalStrategy" + }, + { + "type": "null" + } + ], + "default": null + }, + "+kms_key_name": { + "anyOf": [ + { + "$ref": "#/$defs/KmsKeyName" + }, + { + "type": "null" + } + ], + "default": null + }, + "+labels": { + "anyOf": [ + { + "$ref": "#/$defs/LabelConfigs1" + }, + { + "type": "null" + } + ], + "default": null + }, + "+location": { + "anyOf": [ + { + "$ref": "#/$defs/Location" + }, + { + "type": "null" + } + ], + "default": null + }, + "+materialized": { + "anyOf": [ + { + "$ref": "#/$defs/Materialized" + }, + { + "type": "null" + } + ], + "default": null + }, + "+meta": { + "anyOf": [ + { + "$ref": "#/$defs/Meta" + }, + { + "type": "null" + } + ], + "default": null + }, + "+on_configuration_change": { + "anyOf": [ + { + "$ref": "#/$defs/OnConfigurationChange" + }, + { + "type": "null" + } + ], + "default": null + }, + "+on_schema_change": { + "anyOf": [ + { + "$ref": "#/$defs/OnSchemaChange" + }, + { + "type": "null" + } + ], + "default": null + }, + "+persist_docs": { + "anyOf": [ + { + "$ref": "#/$defs/PersistDocsConfig" + }, + { + "type": "null" + } + ], + "default": null + }, + "+post-hook": { + "anyOf": [ + { + "$ref": "#/$defs/ArrayOfStrings" + }, + { + "type": "null" + } + ], + "default": null + }, + "+pre-hook": { + "anyOf": [ + { + "$ref": "#/$defs/ArrayOfStrings" + }, + { + "type": "null" + } + ], + "default": null + }, + "+schema": { + "anyOf": [ + { + "$ref": "#/$defs/Schema" + }, + { + "type": "null" + } + ], + "default": null + }, + "+secure": { + "anyOf": [ + { + "$ref": "#/$defs/BooleanOrJinjaString" + }, + { + "type": "null" + } + ], + "default": false + }, + "+snowflake_warehouse": { + "anyOf": [ + { + "$ref": "#/$defs/SnowflakeWarehouse" + }, + { + "type": "null" + } + ], + "default": null + }, + "+sql_header": { + "anyOf": [ + { + "$ref": "#/$defs/SqlHeader" + }, + { + "type": "null" + } + ], + "default": null + }, + "+tags": { + "anyOf": [ + { + "$ref": "#/$defs/Tags" + }, + { + "type": "null" + } + ], + "default": null + }, + "+target_lag": { + "anyOf": [ + { + "$ref": "#/$defs/TargetLag" + }, + { + "type": "null" + } + ], + "default": null + }, + "+transient": { + "anyOf": [ + { + "$ref": "#/$defs/BooleanOrJinjaString" + }, + { + "type": "null" + } + ], + "default": null + }, + "access": { + "anyOf": [ + { + "$ref": "#/$defs/Access" + }, + { + "type": "null" + } + ], + "default": null + }, + "alias": { + "anyOf": [ + { + "$ref": "#/$defs/Alias" + }, + { + "type": "null" + } + ], + "default": null + }, + "auto_refresh": { + "anyOf": [ + { + "$ref": "#/$defs/AutoRefresh" + }, + { + "type": "null" + } + ], + "default": null + }, + "backup": { + "anyOf": [ + { + "$ref": "#/$defs/Backup" + }, + { + "type": "null" + } + ], + "default": null + }, + "bind": { + "anyOf": [ + { + "$ref": "#/$defs/BooleanOrJinjaString" + }, + { + "type": "null" + } + ], + "default": false + }, + "contract": { + "anyOf": [ + { + "$ref": "#/$defs/Contract" + }, + { + "type": "null" + } + ], + "default": null + }, + "copy_grants": { + "anyOf": [ + { + "$ref": "#/$defs/BooleanOrJinjaString" + }, + { + "type": "null" + } + ], + "default": null + }, + "database": { + "anyOf": [ + { + "$ref": "#/$defs/Database" + }, + { + "type": "null" + } + ], + "default": null + }, + "docs": { + "anyOf": [ + { + "$ref": "#/$defs/DocsConfig" + }, + { + "type": "null" + } + ], + "default": null + }, + "enabled": { + "anyOf": [ + { + "$ref": "#/$defs/BooleanOrJinjaString" + }, + { + "type": "null" + } + ], + "default": null + }, + "file_format": { + "anyOf": [ + { + "$ref": "#/$defs/FileFormat" + }, + { + "type": "null" + } + ], + "default": null + }, + "full_refresh": { + "anyOf": [ + { + "$ref": "#/$defs/BooleanOrJinjaString" + }, + { + "type": "null" + } + ], + "default": null + }, + "grant_access_to": { + "anyOf": [ + { + "$ref": "#/$defs/AuthorizedViews" + }, + { + "type": "null" + } + ], + "default": null + }, + "grants": { + "anyOf": [ + { + "$ref": "#/$defs/Grants" + }, + { + "type": "null" + } + ], + "default": null + }, + "group": { + "anyOf": [ + { + "$ref": "#/$defs/Group" + }, + { + "type": "null" + } + ], + "default": null + }, + "hours_to_expiration": { + "anyOf": [ + { + "$ref": "#/$defs/HoursToExpiration" + }, + { + "type": "null" + } + ], + "default": null + }, + "incremental_strategy": { + "anyOf": [ + { + "$ref": "#/$defs/IncrementalStrategy" + }, + { + "type": "null" + } + ], + "default": null + }, + "kms_key_name": { + "anyOf": [ + { + "$ref": "#/$defs/KmsKeyName" + }, + { + "type": "null" + } + ], + "default": null + }, + "labels": { + "anyOf": [ + { + "$ref": "#/$defs/LabelConfigs1" + }, + { + "type": "null" + } + ], + "default": null + }, + "location": { + "anyOf": [ + { + "$ref": "#/$defs/Location" + }, + { + "type": "null" + } + ], + "default": null + }, + "materialized": { + "anyOf": [ + { + "$ref": "#/$defs/Materialized" + }, + { + "type": "null" + } + ], + "default": null + }, + "meta": { + "anyOf": [ + { + "$ref": "#/$defs/Meta" + }, + { + "type": "null" + } + ], + "default": null + }, + "on_configuration_change": { + "anyOf": [ + { + "$ref": "#/$defs/OnConfigurationChange" + }, + { + "type": "null" + } + ], + "default": null + }, + "on_schema_change": { + "anyOf": [ + { + "$ref": "#/$defs/OnSchemaChange" + }, + { + "type": "null" + } + ], + "default": null + }, + "persist_docs": { + "anyOf": [ + { + "$ref": "#/$defs/PersistDocsConfig" + }, + { + "type": "null" + } + ], + "default": null + }, + "post-hook": { + "anyOf": [ + { + "$ref": "#/$defs/ArrayOfStrings" + }, + { + "type": "null" + } + ], + "default": null + }, + "pre-hook": { + "anyOf": [ + { + "$ref": "#/$defs/ArrayOfStrings" + }, + { + "type": "null" + } + ], + "default": null + }, + "schema": { + "anyOf": [ + { + "$ref": "#/$defs/Schema" + }, + { + "type": "null" + } + ], + "default": null + }, + "secure": { + "anyOf": [ + { + "$ref": "#/$defs/BooleanOrJinjaString" + }, + { + "type": "null" + } + ], + "default": false + }, + "snowflake_warehouse": { + "anyOf": [ + { + "$ref": "#/$defs/SnowflakeWarehouse" + }, + { + "type": "null" + } + ], + "default": null + }, + "sql_header": { + "anyOf": [ + { + "$ref": "#/$defs/SqlHeader" + }, + { + "type": "null" + } + ], + "default": null + }, + "tags": { + "anyOf": [ + { + "$ref": "#/$defs/Tags" + }, + { + "type": "null" + } + ], + "default": null + }, + "target_lag": { + "anyOf": [ + { + "$ref": "#/$defs/TargetLag" + }, + { + "type": "null" + } + ], + "default": null + }, + "transient": { + "anyOf": [ + { + "$ref": "#/$defs/BooleanOrJinjaString" + }, + { + "type": "null" + } + ], + "default": null + } + }, + "title": "ModelConfigs", + "type": "object" + }, + "OnConfigurationChange": { + "enum": [ + "apply", + "continue", + "fail" + ], + "title": "OnConfigurationChange", + "type": "string" + }, + "OnSchemaChange": { + "enum": [ + "append_new_columns", + "fail", + "ignore", + "sync_all_columns" + ], + "title": "OnSchemaChange", + "type": "string" + }, + "PersistDocsConfig": { + "additionalProperties": false, + "properties": { + "columns": { + "anyOf": [ + { + "$ref": "#/$defs/BooleanOrJinjaString" + }, + { + "type": "null" + } + ] + }, + "relation": { + "anyOf": [ + { + "$ref": "#/$defs/BooleanOrJinjaString" + }, + { + "type": "null" + } + ] + } + }, + "title": "PersistDocsConfig", + "type": "object" + }, + "QueryComment": { + "additionalProperties": false, + "properties": { + "append": { + "anyOf": [ + { + "$ref": "#/$defs/BooleanOrJinjaString" + }, + { + "type": "null" + } + ], + "default": null + }, + "comment": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Comment" + }, + "job-label": { + "anyOf": [ + { + "$ref": "#/$defs/BooleanOrJinjaString" + }, + { + "type": "null" + } + ], + "default": null + } + }, + "title": "QueryComment", + "type": "object" + }, + "Quoting": { + "properties": { + "database": { + "anyOf": [ + { + "$ref": "#/$defs/BooleanOrJinjaString" + }, + { + "type": "null" + } + ], + "default": null + }, + "identifier": { + "anyOf": [ + { + "$ref": "#/$defs/BooleanOrJinjaString" + }, + { + "type": "null" + } + ], + "default": null + }, + "schema": { + "anyOf": [ + { + "$ref": "#/$defs/BooleanOrJinjaString" + }, + { + "type": "null" + } + ], + "default": null + } + }, + "title": "Quoting", + "type": "object" + }, + "Schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Schema" + }, + "SeedConfigs": { + "properties": { + "+column_types": { + "anyOf": [ + { + "$ref": "#/$defs/ColumnTypes" + }, + { + "type": "null" + } + ], + "default": null + }, + "+copy_grants": { + "anyOf": [ + { + "$ref": "#/$defs/BooleanOrJinjaString" + }, + { + "type": "null" + } + ], + "default": null + }, + "+database": { + "anyOf": [ + { + "$ref": "#/$defs/Database" + }, + { + "type": "null" + } + ], + "default": null + }, + "+docs": { + "anyOf": [ + { + "$ref": "#/$defs/DocsConfig" + }, + { + "type": "null" + } + ], + "default": null + }, + "+enabled": { + "anyOf": [ + { + "$ref": "#/$defs/BooleanOrJinjaString" + }, + { + "type": "null" + } + ], + "default": null + }, + "+full_refresh": { + "anyOf": [ + { + "$ref": "#/$defs/BooleanOrJinjaString" + }, + { + "type": "null" + } + ], + "default": null + }, + "+grants": { + "anyOf": [ + { + "$ref": "#/$defs/Grants" + }, + { + "type": "null" + } + ], + "default": null + }, + "+group": { + "anyOf": [ + { + "$ref": "#/$defs/Group" + }, + { + "type": "null" + } + ], + "default": null + }, + "+meta": { + "anyOf": [ + { + "$ref": "#/$defs/Meta" + }, + { + "type": "null" + } + ], + "default": null + }, + "+persist_docs": { + "anyOf": [ + { + "$ref": "#/$defs/PersistDocsConfig" + }, + { + "type": "null" + } + ], + "default": null + }, + "+quote_columns": { + "anyOf": [ + { + "$ref": "#/$defs/BooleanOrJinjaString" + }, + { + "type": "null" + } + ], + "default": null + }, + "+schema": { + "anyOf": [ + { + "$ref": "#/$defs/Schema" + }, + { + "type": "null" + } + ], + "default": null + }, + "+tags": { + "anyOf": [ + { + "$ref": "#/$defs/Tags" + }, + { + "type": "null" + } + ], + "default": null + }, + "+transient": { + "anyOf": [ + { + "$ref": "#/$defs/BooleanOrJinjaString" + }, + { + "type": "null" + } + ], + "default": null + }, + "column_types": { + "anyOf": [ + { + "$ref": "#/$defs/ColumnTypes" + }, + { + "type": "null" + } + ], + "default": null + }, + "copy_grants": { + "anyOf": [ + { + "$ref": "#/$defs/BooleanOrJinjaString" + }, + { + "type": "null" + } + ], + "default": null + }, + "database": { + "anyOf": [ + { + "$ref": "#/$defs/Database" + }, + { + "type": "null" + } + ], + "default": null + }, + "docs": { + "anyOf": [ + { + "$ref": "#/$defs/DocsConfig" + }, + { + "type": "null" + } + ], + "default": null + }, + "enabled": { + "anyOf": [ + { + "$ref": "#/$defs/BooleanOrJinjaString" + }, + { + "type": "null" + } + ], + "default": null + }, + "full_refresh": { + "anyOf": [ + { + "$ref": "#/$defs/BooleanOrJinjaString" + }, + { + "type": "null" + } + ], + "default": null + }, + "grants": { + "anyOf": [ + { + "$ref": "#/$defs/Grants" + }, + { + "type": "null" + } + ], + "default": null + }, + "group": { + "anyOf": [ + { + "$ref": "#/$defs/Group" + }, + { + "type": "null" + } + ], + "default": null + }, + "meta": { + "anyOf": [ + { + "$ref": "#/$defs/Meta" + }, + { + "type": "null" + } + ], + "default": null + }, + "persist_docs": { + "anyOf": [ + { + "$ref": "#/$defs/PersistDocsConfig" + }, + { + "type": "null" + } + ], + "default": null + }, + "quote_columns": { + "anyOf": [ + { + "$ref": "#/$defs/BooleanOrJinjaString" + }, + { + "type": "null" + } + ], + "default": null + }, + "schema": { + "anyOf": [ + { + "$ref": "#/$defs/Schema" + }, + { + "type": "null" + } + ], + "default": null + }, + "tags": { + "anyOf": [ + { + "$ref": "#/$defs/Tags" + }, + { + "type": "null" + } + ], + "default": null + }, + "transient": { + "anyOf": [ + { + "$ref": "#/$defs/BooleanOrJinjaString" + }, + { + "type": "null" + } + ], + "default": null + } + }, + "title": "SeedConfigs", + "type": "object" + }, + "Severity": { + "anyOf": [ + { + "$ref": "#/$defs/JinjaString" + }, + { + "$ref": "#/$defs/Severity1" + } + ], + "title": "Severity" + }, + "Severity1": { + "enum": [ + "warn", + "error" + ], + "title": "Severity1", + "type": "string" + }, + "SnapshotConfigs": { + "properties": { + "+alias": { + "anyOf": [ + { + "$ref": "#/$defs/Alias" + }, + { + "type": "null" + } + ], + "default": null + }, + "+check_cols": { + "anyOf": [ + { + "$ref": "#/$defs/StringOrArrayOfStrings" + }, + { + "type": "null" + } + ], + "default": null + }, + "+docs": { + "anyOf": [ + { + "$ref": "#/$defs/DocsConfig" + }, + { + "type": "null" + } + ], + "default": null + }, + "+enabled": { + "anyOf": [ + { + "$ref": "#/$defs/BooleanOrJinjaString" + }, + { + "type": "null" + } + ], + "default": null + }, + "+grants": { + "anyOf": [ + { + "$ref": "#/$defs/Grants" + }, + { + "type": "null" + } + ], + "default": null + }, + "+group": { + "anyOf": [ + { + "$ref": "#/$defs/Group" + }, + { + "type": "null" + } + ], + "default": null + }, + "+invalidate_hard_deletes": { + "anyOf": [ + { + "$ref": "#/$defs/InvalidateHardDeletes" + }, + { + "type": "null" + } + ], + "default": null + }, + "+meta": { + "anyOf": [ + { + "$ref": "#/$defs/Meta" + }, + { + "type": "null" + } + ], + "default": null + }, + "+persist_docs": { + "anyOf": [ + { + "$ref": "#/$defs/PersistDocsConfig" + }, + { + "type": "null" + } + ], + "default": null + }, + "+post-hook": { + "anyOf": [ + { + "$ref": "#/$defs/ArrayOfStrings" + }, + { + "type": "null" + } + ], + "default": null + }, + "+pre-hook": { + "anyOf": [ + { + "$ref": "#/$defs/ArrayOfStrings" + }, + { + "type": "null" + } + ], + "default": null + }, + "+quote_columns": { + "anyOf": [ + { + "$ref": "#/$defs/BooleanOrJinjaString" + }, + { + "type": "null" + } + ], + "default": null + }, + "+strategy": { + "anyOf": [ + { + "$ref": "#/$defs/Strategy" + }, + { + "type": "null" + } + ], + "default": null + }, + "+tags": { + "anyOf": [ + { + "$ref": "#/$defs/Tags" + }, + { + "type": "null" + } + ], + "default": null + }, + "+target_database": { + "anyOf": [ + { + "$ref": "#/$defs/TargetDatabase" + }, + { + "type": "null" + } + ], + "default": null + }, + "+target_schema": { + "anyOf": [ + { + "$ref": "#/$defs/TargetSchema" + }, + { + "type": "null" + } + ], + "default": null + }, + "+transient": { + "anyOf": [ + { + "$ref": "#/$defs/BooleanOrJinjaString" + }, + { + "type": "null" + } + ], + "default": null + }, + "+unique_key": { + "anyOf": [ + { + "$ref": "#/$defs/StringOrArrayOfStrings" + }, + { + "type": "null" + } + ], + "default": null + }, + "+updated_at": { + "anyOf": [ + { + "$ref": "#/$defs/UpdatedAt" + }, + { + "type": "null" + } + ], + "default": null + }, + "alias": { + "anyOf": [ + { + "$ref": "#/$defs/Alias" + }, + { + "type": "null" + } + ], + "default": null + }, + "check_cols": { + "anyOf": [ + { + "$ref": "#/$defs/StringOrArrayOfStrings" + }, + { + "type": "null" + } + ], + "default": null + }, + "docs": { + "anyOf": [ + { + "$ref": "#/$defs/DocsConfig" + }, + { + "type": "null" + } + ], + "default": null + }, + "enabled": { + "anyOf": [ + { + "$ref": "#/$defs/BooleanOrJinjaString" + }, + { + "type": "null" + } + ], + "default": null + }, + "grants": { + "anyOf": [ + { + "$ref": "#/$defs/Grants" + }, + { + "type": "null" + } + ], + "default": null + }, + "group": { + "anyOf": [ + { + "$ref": "#/$defs/Group" + }, + { + "type": "null" + } + ], + "default": null + }, + "invalidate_hard_deletes": { + "anyOf": [ + { + "$ref": "#/$defs/InvalidateHardDeletes" + }, + { + "type": "null" + } + ], + "default": null + }, + "meta": { + "anyOf": [ + { + "$ref": "#/$defs/Meta" + }, + { + "type": "null" + } + ], + "default": null + }, + "persist_docs": { + "anyOf": [ + { + "$ref": "#/$defs/PersistDocsConfig" + }, + { + "type": "null" + } + ], + "default": null + }, + "post-hook": { + "anyOf": [ + { + "$ref": "#/$defs/ArrayOfStrings" + }, + { + "type": "null" + } + ], + "default": null + }, + "pre-hook": { + "anyOf": [ + { + "$ref": "#/$defs/ArrayOfStrings" + }, + { + "type": "null" + } + ], + "default": null + }, + "quote_columns": { + "anyOf": [ + { + "$ref": "#/$defs/BooleanOrJinjaString" + }, + { + "type": "null" + } + ], + "default": null + }, + "strategy": { + "anyOf": [ + { + "$ref": "#/$defs/Strategy" + }, + { + "type": "null" + } + ], + "default": null + }, + "tags": { + "anyOf": [ + { + "$ref": "#/$defs/Tags" + }, + { + "type": "null" + } + ], + "default": null + }, + "target_database": { + "anyOf": [ + { + "$ref": "#/$defs/TargetDatabase" + }, + { + "type": "null" + } + ], + "default": null + }, + "target_schema": { + "anyOf": [ + { + "$ref": "#/$defs/TargetSchema" + }, + { + "type": "null" + } + ], + "default": null + }, + "transient": { + "anyOf": [ + { + "$ref": "#/$defs/BooleanOrJinjaString" + }, + { + "type": "null" + } + ], + "default": null + }, + "unique_key": { + "anyOf": [ + { + "$ref": "#/$defs/StringOrArrayOfStrings" + }, + { + "type": "null" + } + ], + "default": null + }, + "updated_at": { + "anyOf": [ + { + "$ref": "#/$defs/UpdatedAt" + }, + { + "type": "null" + } + ], + "default": null + } + }, + "title": "SnapshotConfigs", + "type": "object" + }, + "SnowflakeWarehouse": { + "title": "SnowflakeWarehouse", + "type": "string" + }, + "SourceConfigs": { + "properties": { + "+enabled": { + "anyOf": [ + { + "$ref": "#/$defs/BooleanOrJinjaString" + }, + { + "type": "null" + } + ], + "default": null + }, + "+meta": { + "anyOf": [ + { + "$ref": "#/$defs/Meta" + }, + { + "type": "null" + } + ], + "default": null + }, + "+tags": { + "anyOf": [ + { + "$ref": "#/$defs/Tags" + }, + { + "type": "null" + } + ], + "default": null + }, + "enabled": { + "anyOf": [ + { + "$ref": "#/$defs/BooleanOrJinjaString" + }, + { + "type": "null" + } + ], + "default": null + }, + "meta": { + "anyOf": [ + { + "$ref": "#/$defs/Meta" + }, + { + "type": "null" + } + ], + "default": null + }, + "tags": { + "anyOf": [ + { + "$ref": "#/$defs/Tags" + }, + { + "type": "null" + } + ], + "default": null + } + }, + "title": "SourceConfigs", + "type": "object" + }, + "SqlHeader": { + "title": "SqlHeader", + "type": "string" + }, + "Strategy": { + "title": "Strategy", + "type": "string" + }, + "StringOrArrayOfStrings": { + "anyOf": [ + { + "type": "string" + }, + { + "$ref": "#/$defs/ArrayOfStrings" + } + ], + "title": "StringOrArrayOfStrings" + }, + "Tags": { + "allOf": [ + { + "$ref": "#/$defs/StringOrArrayOfStrings" + } + ], + "title": "Tags" + }, + "TargetDatabase": { + "title": "TargetDatabase", + "type": "string" + }, + "TargetLag": { + "pattern": "^(?:downstream|\\d+\\s*(?:seconds|minutes|hours|days))$", + "title": "TargetLag", + "type": "string" + }, + "TargetSchema": { + "title": "TargetSchema", + "type": "string" + }, + "UnitTestConfigs": { + "properties": { + "+meta": { + "anyOf": [ + { + "$ref": "#/$defs/Meta" + }, + { + "type": "null" + } + ], + "default": null + }, + "+tags": { + "anyOf": [ + { + "$ref": "#/$defs/Tags" + }, + { + "type": "null" + } + ], + "default": null + }, + "meta": { + "anyOf": [ + { + "$ref": "#/$defs/Meta" + }, + { + "type": "null" + } + ], + "default": null + }, + "tags": { + "anyOf": [ + { + "$ref": "#/$defs/Tags" + }, + { + "type": "null" + } + ], + "default": null + } + }, + "title": "UnitTestConfigs", + "type": "object" + }, + "UpdatedAt": { + "title": "UpdatedAt", + "type": "string" + }, + "WarnIf": { + "title": "WarnIf", + "type": "string" + } + }, + "additionalProperties": false, + "properties": { + "version": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Version" + }, + "name": { + "title": "Name", + "type": "string" + }, + "analysis-paths": { + "anyOf": [ + { + "$ref": "#/$defs/ArrayOfStrings" + }, + { + "type": "null" + } + ], + "default": null + }, + "asset-paths": { + "anyOf": [ + { + "$ref": "#/$defs/ArrayOfStrings" + }, + { + "type": "null" + } + ], + "default": null + }, + "clean-targets": { + "anyOf": [ + { + "$ref": "#/$defs/ArrayOfStrings" + }, + { + "type": "null" + } + ], + "default": null + }, + "config-version": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "default": 2, + "title": "Config-Version" + }, + "data_tests": { + "anyOf": [ + { + "$ref": "#/$defs/DataTestConfigs" + }, + { + "type": "null" + } + ], + "default": null + }, + "dbt-cloud": { + "anyOf": [ + { + "$ref": "#/$defs/DbtCloud" + }, + { + "type": "null" + } + ], + "default": null + }, + "dispatch": { + "anyOf": [ + { + "items": { + "$ref": "#/$defs/DispatchItem" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Dispatch" + }, + "docs-paths": { + "anyOf": [ + { + "$ref": "#/$defs/ArrayOfStrings" + }, + { + "type": "null" + } + ], + "default": null + }, + "flags": { + "anyOf": [ + { + "$ref": "#/$defs/Flags" + }, + { + "type": "null" + } + ], + "default": null + }, + "log-path": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Log-Path" + }, + "macro-paths": { + "anyOf": [ + { + "$ref": "#/$defs/ArrayOfStrings" + }, + { + "type": "null" + } + ], + "default": null + }, + "model-paths": { + "anyOf": [ + { + "$ref": "#/$defs/ArrayOfStrings" + }, + { + "type": "null" + } + ], + "default": null + }, + "models": { + "anyOf": [ + { + "$ref": "#/$defs/ModelConfigs" + }, + { + "type": "null" + } + ], + "default": null + }, + "on-run-end": { + "anyOf": [ + { + "$ref": "#/$defs/ArrayOfStrings" + }, + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "On-Run-End" + }, + "on-run-start": { + "anyOf": [ + { + "$ref": "#/$defs/ArrayOfStrings" + }, + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "On-Run-Start" + }, + "packages-install-path": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Packages-Install-Path" + }, + "profile": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Profile" + }, + "query-comment": { + "anyOf": [ + { + "type": "string" + }, + { + "$ref": "#/$defs/QueryComment" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Query-Comment" + }, + "quoting": { + "anyOf": [ + { + "$ref": "#/$defs/Quoting" + }, + { + "type": "null" + } + ], + "default": null + }, + "require-dbt-version": { + "anyOf": [ + { + "$ref": "#/$defs/StringOrArrayOfStrings" + }, + { + "type": "null" + } + ], + "default": null + }, + "seed-paths": { + "anyOf": [ + { + "$ref": "#/$defs/ArrayOfStrings" + }, + { + "type": "null" + } + ], + "default": null + }, + "seeds": { + "anyOf": [ + { + "$ref": "#/$defs/SeedConfigs" + }, + { + "type": "null" + } + ], + "default": null + }, + "snapshot-paths": { + "anyOf": [ + { + "$ref": "#/$defs/ArrayOfStrings" + }, + { + "type": "null" + } + ], + "default": null + }, + "snapshots": { + "anyOf": [ + { + "$ref": "#/$defs/SnapshotConfigs" + }, + { + "type": "null" + } + ], + "default": null + }, + "sources": { + "anyOf": [ + { + "$ref": "#/$defs/SourceConfigs" + }, + { + "type": "null" + } + ], + "default": null + }, + "target-path": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Target-Path" + }, + "test-paths": { + "anyOf": [ + { + "$ref": "#/$defs/ArrayOfStrings" + }, + { + "type": "null" + } + ], + "default": null + }, + "tests": { + "anyOf": [ + { + "$ref": "#/$defs/DataTestConfigs" + }, + { + "type": "null" + } + ], + "default": null + }, + "unit_tests": { + "anyOf": [ + { + "$ref": "#/$defs/UnitTestConfigs" + }, + { + "type": "null" + } + ], + "default": null + }, + "vars": { + "anyOf": [ + { + "type": "object" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Vars" + } + }, + "required": [ + "name" + ], + "title": "DbtProject", + "type": "object" +} \ No newline at end of file diff --git a/schemas/latest-generated/dependencies-latest-generated.json b/schemas/latest-generated/dependencies-latest-generated.json new file mode 100644 index 0000000..9ec213f --- /dev/null +++ b/schemas/latest-generated/dependencies-latest-generated.json @@ -0,0 +1,172 @@ +{ + "$defs": { + "GitPackages": { + "additionalProperties": false, + "properties": { + "git": { + "title": "Git URL", + "type": "string" + }, + "revision": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Pin your package to a specific release by specifying a release name", + "title": "Revision" + }, + "subdirectory": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Only required if the package is nested in a subdirectory of the git project", + "title": "Subdirectory" + } + }, + "required": [ + "git" + ], + "title": "GitPackages", + "type": "object" + }, + "HubPackages": { + "additionalProperties": false, + "properties": { + "version": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "number" + }, + { + "items": {}, + "type": "array" + } + ], + "description": "A semantic version string or range, such as [\">=1.0.0\", \"<2.0.0\"]", + "title": "Package version" + }, + "install-prerelease": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Opt in to prerelease versions of a package", + "title": "Install Prerelease" + }, + "package": { + "description": "Must be in format `org_name/package_name`. Refer to hub.getdbt.com for installation instructions", + "examples": [ + "dbt-labs/dbt_utils" + ], + "pattern": "^[\\w\\-\\.]+/[\\w\\-\\.]+$", + "title": "Package identifier", + "type": "string" + } + }, + "required": [ + "version", + "package" + ], + "title": "HubPackages", + "type": "object" + }, + "LocalPackage": { + "additionalProperties": false, + "properties": { + "local": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Local" + } + }, + "title": "LocalPackage", + "type": "object" + }, + "Project": { + "additionalProperties": false, + "properties": { + "name": { + "title": "Name", + "type": "string" + } + }, + "required": [ + "name" + ], + "title": "Project", + "type": "object" + } + }, + "additionalProperties": false, + "properties": { + "packages": { + "anyOf": [ + { + "items": { + "anyOf": [ + { + "$ref": "#/$defs/HubPackages" + }, + { + "$ref": "#/$defs/GitPackages" + }, + { + "$ref": "#/$defs/LocalPackage" + } + ] + }, + "minItems": 1, + "type": "array" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Packages" + }, + "projects": { + "anyOf": [ + { + "items": { + "$ref": "#/$defs/Project" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Projects" + } + }, + "title": "Dependencies", + "type": "object" +} \ No newline at end of file diff --git a/schemas/latest-generated/packages-latest-generated.json b/schemas/latest-generated/packages-latest-generated.json new file mode 100644 index 0000000..f1ace24 --- /dev/null +++ b/schemas/latest-generated/packages-latest-generated.json @@ -0,0 +1,143 @@ +{ + "$defs": { + "GitPackages": { + "additionalProperties": false, + "properties": { + "git": { + "title": "Git URL", + "type": "string" + }, + "revision": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Pin your package to a specific release by specifying a release name", + "title": "Revision" + }, + "subdirectory": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Only required if the package is nested in a subdirectory of the git project", + "title": "Subdirectory" + } + }, + "required": [ + "git" + ], + "title": "GitPackages", + "type": "object" + }, + "HubPackages": { + "additionalProperties": false, + "properties": { + "version": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "number" + }, + { + "items": {}, + "type": "array" + } + ], + "description": "A semantic version string or range, such as [\">=1.0.0\", \"<2.0.0\"]", + "title": "Package version" + }, + "install-prerelease": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Opt in to prerelease versions of a package", + "title": "Install Prerelease" + }, + "package": { + "description": "Must be in format `org_name/package_name`. Refer to hub.getdbt.com for installation instructions", + "examples": [ + "dbt-labs/dbt_utils" + ], + "pattern": "^[\\w\\-\\.]+/[\\w\\-\\.]+$", + "title": "Package identifier", + "type": "string" + } + }, + "required": [ + "version", + "package" + ], + "title": "HubPackages", + "type": "object" + }, + "LocalPackage": { + "additionalProperties": false, + "properties": { + "local": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Local" + } + }, + "title": "LocalPackage", + "type": "object" + } + }, + "additionalProperties": false, + "properties": { + "packages": { + "anyOf": [ + { + "items": { + "anyOf": [ + { + "$ref": "#/$defs/HubPackages" + }, + { + "$ref": "#/$defs/GitPackages" + }, + { + "$ref": "#/$defs/LocalPackage" + } + ] + }, + "minItems": 1, + "type": "array" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Packages" + } + }, + "title": "Packages", + "type": "object" +} \ No newline at end of file diff --git a/schemas/latest-generated/selectors-latest-generated.json b/schemas/latest-generated/selectors-latest-generated.json new file mode 100644 index 0000000..a6bc7ff --- /dev/null +++ b/schemas/latest-generated/selectors-latest-generated.json @@ -0,0 +1,272 @@ +{ + "$defs": { + "BooleanOrJinjaString": { + "anyOf": [ + { + "$ref": "#/$defs/JinjaString" + }, + { + "type": "boolean" + } + ], + "title": "BooleanOrJinjaString" + }, + "Default": { + "pattern": "\\{\\{.*\\}\\}", + "title": "Default", + "type": "string" + }, + "DefinitionBlock": { + "additionalProperties": true, + "properties": { + "method": { + "anyOf": [ + { + "$ref": "#/$defs/Method" + }, + { + "type": "null" + } + ], + "default": null + }, + "value": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Value" + }, + "children": { + "anyOf": [ + { + "$ref": "#/$defs/BooleanOrJinjaString" + }, + { + "type": "null" + } + ], + "default": null + }, + "parents": { + "anyOf": [ + { + "$ref": "#/$defs/BooleanOrJinjaString" + }, + { + "type": "null" + } + ], + "default": null + }, + "children_depth": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Children Depth" + }, + "parents_depth": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Parents Depth" + }, + "childrens_parents": { + "anyOf": [ + { + "$ref": "#/$defs/BooleanOrJinjaString" + }, + { + "type": "null" + } + ], + "default": null + }, + "indirect_selection": { + "anyOf": [ + { + "$ref": "#/$defs/IndirectSelection" + }, + { + "type": "null" + } + ], + "default": null + } + }, + "title": "DefinitionBlock", + "type": "object" + }, + "ExcludeBlock": { + "items": { + "anyOf": [ + { + "$ref": "#/$defs/IntersectionBlock" + }, + { + "$ref": "#/$defs/DefinitionBlock" + } + ] + }, + "title": "ExcludeBlock", + "type": "array" + }, + "IndirectSelection": { + "enum": [ + "buildable", + "cautious", + "eager" + ], + "title": "IndirectSelection", + "type": "string" + }, + "IntersectionBlock": { + "items": { + "$ref": "#/$defs/DefinitionBlock" + }, + "title": "IntersectionBlock", + "type": "array" + }, + "JinjaString": { + "pattern": "\\{\\{.*\\}\\}", + "title": "JinjaString", + "type": "string" + }, + "Method": { + "enum": [ + "tag", + "source", + "path", + "file", + "fqn", + "package", + "config", + "test_type", + "test_name", + "state", + "exposure", + "metric", + "result", + "source_status", + "group", + "wildcard" + ], + "title": "Method", + "type": "string" + }, + "Selector": { + "additionalProperties": false, + "properties": { + "name": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Name" + }, + "description": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Description" + }, + "default": { + "anyOf": [ + { + "$ref": "#/$defs/Default" + }, + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Default" + }, + "definition": { + "anyOf": [ + { + "$ref": "#/$defs/DefinitionBlock" + }, + { + "type": "string" + }, + { + "$ref": "#/$defs/UnionBlock" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Definition" + } + }, + "title": "Selector", + "type": "object" + }, + "UnionBlock": { + "items": { + "anyOf": [ + { + "$ref": "#/$defs/IntersectionBlock" + }, + { + "$ref": "#/$defs/DefinitionBlock" + }, + { + "$ref": "#/$defs/ExcludeBlock" + } + ] + }, + "title": "UnionBlock", + "type": "array" + } + }, + "additionalProperties": false, + "properties": { + "selectors": { + "items": { + "$ref": "#/$defs/Selector" + }, + "minItems": 1, + "title": "Selectors", + "type": "array" + } + }, + "required": [ + "selectors" + ], + "title": "Selectors", + "type": "object" +} \ No newline at end of file From 3fd5b9726f8d0a04f53f14d5a3d136d3629b3ee3 Mon Sep 17 00:00:00 2001 From: Dave Connors Date: Mon, 5 Aug 2024 17:31:12 -0500 Subject: [PATCH 05/17] add a few more tests to tests --- tests/latest/valid/dependencies.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/latest/valid/dependencies.yml b/tests/latest/valid/dependencies.yml index 19c88c5..c088a26 100644 --- a/tests/latest/valid/dependencies.yml +++ b/tests/latest/valid/dependencies.yml @@ -1,6 +1,10 @@ projects: - name: my_dbt_project + - name: other_project packages: - package: dbt-labs/dbt-utils - version: 1.0.0 \ No newline at end of file + version: 1.0.0 + - local: ../my_local_package + - git: "https://github.com/dbt-labs/dbt-utils.git" + revision: 0.9.2 \ No newline at end of file From c68447872bbb06e87b1e2d4f16b2d4bbfb9757d6 Mon Sep 17 00:00:00 2001 From: Dave Connors Date: Mon, 5 Aug 2024 17:45:01 -0500 Subject: [PATCH 06/17] remove pyproject toml in favor of requirements.txt --- README.md | 7 ++++++- pyproject.toml | 28 ---------------------------- requirements.txt | 1 + 3 files changed, 7 insertions(+), 29 deletions(-) delete mode 100644 pyproject.toml create mode 100644 requirements.txt diff --git a/README.md b/README.md index 1cb79fb..27baf0e 100644 --- a/README.md +++ b/README.md @@ -112,4 +112,9 @@ _Do you use a different IDE which also supports JSON Schema? Please open a PR wi ## Contributing PRs that improve these schemata are welcome! -Please ensure that JSON keys are sorted by [vscode-sort-json](https://marketplace.visualstudio.com/items?itemName=richie5um2.vscode-sort-json) according to the rules in `.vscode/settings`. +These schemas are generated from [pydantic models](https://docs.pydantic.dev/latest/concepts/json_schema/). To make updates, the process is as follows: + +1. Create a virtual environment and install the dependencies: `pip install -r requirements.txt` +2. Make changes to the corresponding pydantic models in `src/latest.py` +3. Run the generation script: `python3 src/generate.py` +4. Add tests for valid and invalid JSON files in `tests/latest` \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml deleted file mode 100644 index 598d133..0000000 --- a/pyproject.toml +++ /dev/null @@ -1,28 +0,0 @@ -[build-system] -requires = ["hatchling"] -build-backend = "hatchling.build" - -[project] -name = "dbt-jsonschema" -version = "0.1.0" -description = '' -readme = "README.md" -requires-python = ">=3.11" -keywords = [] -classifiers = [ - "Development Status :: 4 - Beta", - "Programming Language :: Python", - "Programming Language :: Python :: 3.11", - "Programming Language :: Python :: 3.12", - "Programming Language :: Python :: Implementation :: CPython", - "Programming Language :: Python :: Implementation :: PyPy", -] -dependencies = ["pydantic >=2.8.0, <3.0.0"] - -[project.urls] -Documentation = "https://github.com/dbt-labs/dbt-jsonschema/blob/main/README.md" -Issues = "https://github.com/dbt-labs/dbt-jsonschema/issues" -Source = "https://github.com/dbt-labs/dbt-jsonschema" - -[tool.hatch.envs.types] -extra-dependencies = ["mypy>=1.0.0"] diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..1bd28af --- /dev/null +++ b/requirements.txt @@ -0,0 +1 @@ +datamodel-code-generator \ No newline at end of file From 51e3409a3d99c1f8acf4bd160031077c048bab44 Mon Sep 17 00:00:00 2001 From: Joel Labes Date: Fri, 30 Aug 2024 16:39:48 +1200 Subject: [PATCH 07/17] Incorporate Devon's custom generator on top of Alice's generated models --- generate.py | 54 + .../dbt_cloud-latest-generated.json | 26 - .../dbt_project-latest-generated.json | 3043 --------- .../dbt_yml_files-latest-generated.json | 4711 -------------- .../dependencies-latest-generated.json | 172 - .../packages-latest-generated.json | 143 - .../selectors-latest-generated.json | 272 - .../latest-originals/dbt_cloud-latest.json | 14 + .../latest-originals/dbt_project-latest.json | 1112 ++++ .../dbt_yml_files-latest.json | 1961 ++++++ .../latest-originals/dependencies-latest.json | 83 + schemas/latest-originals/packages-latest.json | 84 + .../latest-originals/selectors-latest.json | 153 + schemas/latest/dbt_cloud-latest.json | 21 +- schemas/latest/dbt_project-latest.json | 2481 ++++++-- schemas/latest/dbt_yml_files-latest.json | 5493 +++++++++++------ schemas/latest/dependencies-latest.json | 215 +- schemas/latest/packages-latest.json | 204 +- schemas/latest/selectors-latest.json | 353 +- src/latest/dbt_yml_files.py | 17 +- 20 files changed, 9541 insertions(+), 11071 deletions(-) create mode 100644 generate.py delete mode 100644 schemas/latest-generated/dbt_cloud-latest-generated.json delete mode 100644 schemas/latest-generated/dbt_project-latest-generated.json delete mode 100644 schemas/latest-generated/dbt_yml_files-latest-generated.json delete mode 100644 schemas/latest-generated/dependencies-latest-generated.json delete mode 100644 schemas/latest-generated/packages-latest-generated.json delete mode 100644 schemas/latest-generated/selectors-latest-generated.json create mode 100644 schemas/latest-originals/dbt_cloud-latest.json create mode 100644 schemas/latest-originals/dbt_project-latest.json create mode 100644 schemas/latest-originals/dbt_yml_files-latest.json create mode 100644 schemas/latest-originals/dependencies-latest.json create mode 100644 schemas/latest-originals/packages-latest.json create mode 100644 schemas/latest-originals/selectors-latest.json diff --git a/generate.py b/generate.py new file mode 100644 index 0000000..76010ee --- /dev/null +++ b/generate.py @@ -0,0 +1,54 @@ +import json +from pathlib import Path +from typing import Any, Dict + +from src.latest.dbt_cloud import DbtCloud +from src.latest.dbt_project import DbtProject +from src.latest.dbt_yml_files import DbtYmlFiles +from src.latest.dependencies import Dependencies, Packages +from src.latest.selectors import Selectors +from pydantic.json_schema import GenerateJsonSchema + + +class RemoveNullsGenerateJsonSchema(GenerateJsonSchema): + """A GenerateJsonSchema which removes nullability from types. + + We do not want to include optional values in the json schema because + that would inhibit code completion. + """ + + def _remove_null(self, json_schema: Dict[str, Any]): + if "$comment" in json_schema and json_schema["$comment"] == "truly_nullable": + return + if "anyOf" in json_schema: + json_schema["anyOf"] = [ + item for item in json_schema["anyOf"] if item != {"type": "null"} + ] + for v in json_schema.values(): + if isinstance(v, dict): + self._remove_null(v) + + def generate(self, schema, mode="validation"): + json_schema = super().generate(schema, mode=mode) + self._remove_null(json_schema) + return json_schema + + +if __name__ == "__main__": + files = { + "dbt_yml_files": DbtYmlFiles, + "dependencies": Dependencies, + "packages": Packages, + "selectors": Selectors, + "dbt_project": DbtProject, + "dbt_cloud": DbtCloud, + } + output_directory = Path("schemas/latest") + for file_name, model in files.items(): + schema_file = output_directory / f"{file_name}-latest.json" + schema_file.parent.mkdir(parents=True, exist_ok=True) + schema = model.model_json_schema( + mode="validation", schema_generator=RemoveNullsGenerateJsonSchema + ) + print("Generating", schema_file) + schema_file.write_text(json.dumps(schema, indent=2)) diff --git a/schemas/latest-generated/dbt_cloud-latest-generated.json b/schemas/latest-generated/dbt_cloud-latest-generated.json deleted file mode 100644 index e9d76cd..0000000 --- a/schemas/latest-generated/dbt_cloud-latest-generated.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "additionalProperties": false, - "properties": { - "project-id": { - "title": "Project-Id", - "type": "string" - }, - "defer-env-id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Defer-Env-Id" - } - }, - "required": [ - "project-id" - ], - "title": "DbtCloud", - "type": "object" -} \ No newline at end of file diff --git a/schemas/latest-generated/dbt_project-latest-generated.json b/schemas/latest-generated/dbt_project-latest-generated.json deleted file mode 100644 index 3a7e1a4..0000000 --- a/schemas/latest-generated/dbt_project-latest-generated.json +++ /dev/null @@ -1,3043 +0,0 @@ -{ - "$defs": { - "Access": { - "enum": [ - "private", - "protected", - "public" - ], - "title": "Access", - "type": "string" - }, - "Alias": { - "title": "Alias", - "type": "string" - }, - "ArrayOfStrings": { - "items": { - "type": "string" - }, - "title": "ArrayOfStrings", - "type": "array" - }, - "AuthorizedView": { - "additionalProperties": false, - "properties": { - "database": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Database" - }, - "project": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Project" - } - }, - "title": "AuthorizedView", - "type": "object" - }, - "AuthorizedViews": { - "description": "Configuration, specific to BigQuery adapter, used to setup authorized views.", - "items": { - "$ref": "#/$defs/AuthorizedView" - }, - "title": "AuthorizedViews", - "type": "array" - }, - "AutoRefresh": { - "allOf": [ - { - "$ref": "#/$defs/BooleanOrJinjaString" - } - ], - "title": "AutoRefresh" - }, - "Backup": { - "allOf": [ - { - "$ref": "#/$defs/BooleanOrJinjaString" - } - ], - "title": "Backup" - }, - "BooleanOrJinjaString": { - "anyOf": [ - { - "$ref": "#/$defs/JinjaString" - }, - { - "type": "boolean" - } - ], - "title": "BooleanOrJinjaString" - }, - "ColumnTypes": { - "additionalProperties": { - "type": "string" - }, - "title": "ColumnTypes", - "type": "object" - }, - "Contract": { - "properties": { - "enforced": { - "$ref": "#/$defs/BooleanOrJinjaString" - } - }, - "required": [ - "enforced" - ], - "title": "Contract", - "type": "object" - }, - "DataTestConfigs": { - "properties": { - "+alias": { - "anyOf": [ - { - "$ref": "#/$defs/Alias" - }, - { - "type": "null" - } - ], - "default": null - }, - "+database": { - "anyOf": [ - { - "$ref": "#/$defs/Database" - }, - { - "type": "null" - } - ], - "default": null - }, - "+enabled": { - "anyOf": [ - { - "$ref": "#/$defs/BooleanOrJinjaString" - }, - { - "type": "null" - } - ], - "default": null - }, - "+error_if": { - "anyOf": [ - { - "$ref": "#/$defs/ErrorIf" - }, - { - "type": "null" - } - ], - "default": null - }, - "+fail_calc": { - "anyOf": [ - { - "$ref": "#/$defs/FailCalc" - }, - { - "type": "null" - } - ], - "default": null - }, - "+group": { - "anyOf": [ - { - "$ref": "#/$defs/Group" - }, - { - "type": "null" - } - ], - "default": null - }, - "+limit": { - "anyOf": [ - { - "$ref": "#/$defs/Limit" - }, - { - "type": "null" - } - ], - "default": null - }, - "+meta": { - "anyOf": [ - { - "$ref": "#/$defs/Meta" - }, - { - "type": "null" - } - ], - "default": null - }, - "+schema": { - "anyOf": [ - { - "$ref": "#/$defs/Schema" - }, - { - "type": "null" - } - ], - "default": null - }, - "+severity": { - "anyOf": [ - { - "$ref": "#/$defs/Severity" - }, - { - "type": "null" - } - ], - "default": null - }, - "+store_failures": { - "anyOf": [ - { - "$ref": "#/$defs/BooleanOrJinjaString" - }, - { - "type": "null" - } - ], - "default": null - }, - "+tags": { - "anyOf": [ - { - "$ref": "#/$defs/Tags" - }, - { - "type": "null" - } - ], - "default": null - }, - "+warn_if": { - "anyOf": [ - { - "$ref": "#/$defs/WarnIf" - }, - { - "type": "null" - } - ], - "default": null - }, - "alias": { - "anyOf": [ - { - "$ref": "#/$defs/Alias" - }, - { - "type": "null" - } - ], - "default": null - }, - "database": { - "anyOf": [ - { - "$ref": "#/$defs/Database" - }, - { - "type": "null" - } - ], - "default": null - }, - "enabled": { - "anyOf": [ - { - "$ref": "#/$defs/BooleanOrJinjaString" - }, - { - "type": "null" - } - ], - "default": null - }, - "error_if": { - "anyOf": [ - { - "$ref": "#/$defs/ErrorIf" - }, - { - "type": "null" - } - ], - "default": null - }, - "fail_calc": { - "anyOf": [ - { - "$ref": "#/$defs/FailCalc" - }, - { - "type": "null" - } - ], - "default": null - }, - "group": { - "anyOf": [ - { - "$ref": "#/$defs/Group" - }, - { - "type": "null" - } - ], - "default": null - }, - "limit": { - "anyOf": [ - { - "$ref": "#/$defs/Limit" - }, - { - "type": "null" - } - ], - "default": null - }, - "meta": { - "anyOf": [ - { - "$ref": "#/$defs/Meta" - }, - { - "type": "null" - } - ], - "default": null - }, - "schema": { - "anyOf": [ - { - "$ref": "#/$defs/Schema" - }, - { - "type": "null" - } - ], - "default": null - }, - "severity": { - "anyOf": [ - { - "$ref": "#/$defs/Severity" - }, - { - "type": "null" - } - ], - "default": null - }, - "store_failures": { - "anyOf": [ - { - "$ref": "#/$defs/BooleanOrJinjaString" - }, - { - "type": "null" - } - ], - "default": null - }, - "tags": { - "anyOf": [ - { - "$ref": "#/$defs/Tags" - }, - { - "type": "null" - } - ], - "default": null - }, - "warn_if": { - "anyOf": [ - { - "$ref": "#/$defs/WarnIf" - }, - { - "type": "null" - } - ], - "default": null - } - }, - "title": "DataTestConfigs", - "type": "object" - }, - "Database": { - "title": "Database", - "type": "string" - }, - "DbtCloud": { - "additionalProperties": true, - "properties": { - "project-id": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Project-Id" - } - }, - "title": "DbtCloud", - "type": "object" - }, - "DispatchItem": { - "additionalProperties": false, - "properties": { - "macro_namespace": { - "title": "Macro Namespace", - "type": "string" - }, - "search_order": { - "$ref": "#/$defs/ArrayOfStrings" - } - }, - "required": [ - "macro_namespace", - "search_order" - ], - "title": "DispatchItem", - "type": "object" - }, - "DocsConfig": { - "additionalProperties": false, - "properties": { - "node_color": { - "anyOf": [ - { - "pattern": "^(#[a-fA-F0-9]{3}|#[a-fA-F0-9]{6}|[^#][a-zA-Z]*)$", - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "description": "The color of the node on the DAG in the documentation. It must be an Hex code or a valid CSS color name.", - "title": "Node Color" - }, - "show": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "null" - } - ], - "default": true, - "title": "Show" - } - }, - "title": "DocsConfig", - "type": "object" - }, - "ErrorIf": { - "title": "ErrorIf", - "type": "string" - }, - "FailCalc": { - "title": "FailCalc", - "type": "string" - }, - "FileFormat": { - "title": "FileFormat", - "type": "string" - }, - "Flags": { - "properties": { - "cache_selected_only": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Cache Selected Only" - }, - "debug": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Debug" - }, - "fail_fast": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Fail Fast" - }, - "indirect_selection": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Indirect Selection" - }, - "log_format": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Log Format" - }, - "log_format_file": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Log Format File" - }, - "log_level": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Log Level" - }, - "log_level_file": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Log Level File" - }, - "partial_parse": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Partial Parse" - }, - "populate_cache": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Populate Cache" - }, - "printer_width": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Printer Width" - }, - "require_explicit_package_overrides_for_builtin_materializations": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Require Explicit Package Overrides For Builtin Materializations" - }, - "require_resource_names_without_spaces": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Require Resource Names Without Spaces" - }, - "send_anonymous_usage_stats": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Send Anonymous Usage Stats" - }, - "source_freshness_run_project_hooks": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Source Freshness Run Project Hooks" - }, - "static_parser": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Static Parser" - }, - "use_colors": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Use Colors" - }, - "use_colors_file": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Use Colors File" - }, - "use_experimental_parser": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Use Experimental Parser" - }, - "version_check": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Version Check" - }, - "warn_error": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Warn Error" - }, - "warn_error_options": { - "anyOf": [ - { - "type": "object" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Warn Error Options" - }, - "write_json": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Write Json" - } - }, - "title": "Flags", - "type": "object" - }, - "Grants": { - "additionalProperties": { - "$ref": "#/$defs/StringOrArrayOfStrings" - }, - "description": "grant config. each key is a database permission and the value is the grantee of that permission", - "title": "Grants", - "type": "object" - }, - "Group": { - "title": "Group", - "type": "string" - }, - "HoursToExpiration": { - "description": "Configuration specific to BigQuery adapter used to set an expiration delay (in hours) to a table.", - "title": "HoursToExpiration", - "type": "number" - }, - "IncrementalStrategy": { - "title": "IncrementalStrategy", - "type": "string" - }, - "InvalidateHardDeletes": { - "allOf": [ - { - "$ref": "#/$defs/BooleanOrJinjaString" - } - ], - "title": "InvalidateHardDeletes" - }, - "JinjaString": { - "pattern": "\\{\\{.*\\}\\}", - "title": "JinjaString", - "type": "string" - }, - "KmsKeyName": { - "description": "Configuration, specific to BigQuery adapter, of the KMS key name used for data encryption.", - "title": "KmsKeyName", - "type": "string" - }, - "LabelConfigs": { - "pattern": "^[a-z0-9_-]{0,64}$", - "title": "LabelConfigs", - "type": "string" - }, - "LabelConfigs1": { - "additionalProperties": { - "anyOf": [ - { - "$ref": "#/$defs/LabelConfigs" - }, - { - "$ref": "#/$defs/JinjaString" - } - ] - }, - "description": "Configurations specific to BigQuery adapter used to add labels and tags to tables & views created by dbt.", - "title": "LabelConfigs1", - "type": "object" - }, - "Limit": { - "title": "Limit", - "type": "number" - }, - "Location": { - "title": "Location", - "type": "string" - }, - "Materialized": { - "title": "Materialized", - "type": "string" - }, - "Meta": { - "properties": {}, - "title": "Meta", - "type": "object" - }, - "ModelConfigs": { - "properties": { - "+access": { - "anyOf": [ - { - "$ref": "#/$defs/Access" - }, - { - "type": "null" - } - ], - "default": null - }, - "+alias": { - "anyOf": [ - { - "$ref": "#/$defs/Alias" - }, - { - "type": "null" - } - ], - "default": null - }, - "+auto_refresh": { - "anyOf": [ - { - "$ref": "#/$defs/AutoRefresh" - }, - { - "type": "null" - } - ], - "default": null - }, - "+backup": { - "anyOf": [ - { - "$ref": "#/$defs/Backup" - }, - { - "type": "null" - } - ], - "default": null - }, - "+bind": { - "anyOf": [ - { - "$ref": "#/$defs/BooleanOrJinjaString" - }, - { - "type": "null" - } - ], - "default": false - }, - "+contract": { - "anyOf": [ - { - "$ref": "#/$defs/Contract" - }, - { - "type": "null" - } - ], - "default": null - }, - "+copy_grants": { - "anyOf": [ - { - "$ref": "#/$defs/BooleanOrJinjaString" - }, - { - "type": "null" - } - ], - "default": null - }, - "+database": { - "anyOf": [ - { - "$ref": "#/$defs/Database" - }, - { - "type": "null" - } - ], - "default": null - }, - "+docs": { - "anyOf": [ - { - "$ref": "#/$defs/DocsConfig" - }, - { - "type": "null" - } - ], - "default": null - }, - "+enabled": { - "anyOf": [ - { - "$ref": "#/$defs/BooleanOrJinjaString" - }, - { - "type": "null" - } - ], - "default": null - }, - "+file_format": { - "anyOf": [ - { - "$ref": "#/$defs/FileFormat" - }, - { - "type": "null" - } - ], - "default": null - }, - "+full_refresh": { - "anyOf": [ - { - "$ref": "#/$defs/BooleanOrJinjaString" - }, - { - "type": "null" - } - ], - "default": null - }, - "+grant_access_to": { - "anyOf": [ - { - "$ref": "#/$defs/AuthorizedViews" - }, - { - "type": "null" - } - ], - "default": null - }, - "+grants": { - "anyOf": [ - { - "$ref": "#/$defs/Grants" - }, - { - "type": "null" - } - ], - "default": null - }, - "+group": { - "anyOf": [ - { - "$ref": "#/$defs/Group" - }, - { - "type": "null" - } - ], - "default": null - }, - "+hours_to_expiration": { - "anyOf": [ - { - "$ref": "#/$defs/HoursToExpiration" - }, - { - "type": "null" - } - ], - "default": null - }, - "+incremental_strategy": { - "anyOf": [ - { - "$ref": "#/$defs/IncrementalStrategy" - }, - { - "type": "null" - } - ], - "default": null - }, - "+kms_key_name": { - "anyOf": [ - { - "$ref": "#/$defs/KmsKeyName" - }, - { - "type": "null" - } - ], - "default": null - }, - "+labels": { - "anyOf": [ - { - "$ref": "#/$defs/LabelConfigs1" - }, - { - "type": "null" - } - ], - "default": null - }, - "+location": { - "anyOf": [ - { - "$ref": "#/$defs/Location" - }, - { - "type": "null" - } - ], - "default": null - }, - "+materialized": { - "anyOf": [ - { - "$ref": "#/$defs/Materialized" - }, - { - "type": "null" - } - ], - "default": null - }, - "+meta": { - "anyOf": [ - { - "$ref": "#/$defs/Meta" - }, - { - "type": "null" - } - ], - "default": null - }, - "+on_configuration_change": { - "anyOf": [ - { - "$ref": "#/$defs/OnConfigurationChange" - }, - { - "type": "null" - } - ], - "default": null - }, - "+on_schema_change": { - "anyOf": [ - { - "$ref": "#/$defs/OnSchemaChange" - }, - { - "type": "null" - } - ], - "default": null - }, - "+persist_docs": { - "anyOf": [ - { - "$ref": "#/$defs/PersistDocsConfig" - }, - { - "type": "null" - } - ], - "default": null - }, - "+post-hook": { - "anyOf": [ - { - "$ref": "#/$defs/ArrayOfStrings" - }, - { - "type": "null" - } - ], - "default": null - }, - "+pre-hook": { - "anyOf": [ - { - "$ref": "#/$defs/ArrayOfStrings" - }, - { - "type": "null" - } - ], - "default": null - }, - "+schema": { - "anyOf": [ - { - "$ref": "#/$defs/Schema" - }, - { - "type": "null" - } - ], - "default": null - }, - "+secure": { - "anyOf": [ - { - "$ref": "#/$defs/BooleanOrJinjaString" - }, - { - "type": "null" - } - ], - "default": false - }, - "+snowflake_warehouse": { - "anyOf": [ - { - "$ref": "#/$defs/SnowflakeWarehouse" - }, - { - "type": "null" - } - ], - "default": null - }, - "+sql_header": { - "anyOf": [ - { - "$ref": "#/$defs/SqlHeader" - }, - { - "type": "null" - } - ], - "default": null - }, - "+tags": { - "anyOf": [ - { - "$ref": "#/$defs/Tags" - }, - { - "type": "null" - } - ], - "default": null - }, - "+target_lag": { - "anyOf": [ - { - "$ref": "#/$defs/TargetLag" - }, - { - "type": "null" - } - ], - "default": null - }, - "+transient": { - "anyOf": [ - { - "$ref": "#/$defs/BooleanOrJinjaString" - }, - { - "type": "null" - } - ], - "default": null - }, - "access": { - "anyOf": [ - { - "$ref": "#/$defs/Access" - }, - { - "type": "null" - } - ], - "default": null - }, - "alias": { - "anyOf": [ - { - "$ref": "#/$defs/Alias" - }, - { - "type": "null" - } - ], - "default": null - }, - "auto_refresh": { - "anyOf": [ - { - "$ref": "#/$defs/AutoRefresh" - }, - { - "type": "null" - } - ], - "default": null - }, - "backup": { - "anyOf": [ - { - "$ref": "#/$defs/Backup" - }, - { - "type": "null" - } - ], - "default": null - }, - "bind": { - "anyOf": [ - { - "$ref": "#/$defs/BooleanOrJinjaString" - }, - { - "type": "null" - } - ], - "default": false - }, - "contract": { - "anyOf": [ - { - "$ref": "#/$defs/Contract" - }, - { - "type": "null" - } - ], - "default": null - }, - "copy_grants": { - "anyOf": [ - { - "$ref": "#/$defs/BooleanOrJinjaString" - }, - { - "type": "null" - } - ], - "default": null - }, - "database": { - "anyOf": [ - { - "$ref": "#/$defs/Database" - }, - { - "type": "null" - } - ], - "default": null - }, - "docs": { - "anyOf": [ - { - "$ref": "#/$defs/DocsConfig" - }, - { - "type": "null" - } - ], - "default": null - }, - "enabled": { - "anyOf": [ - { - "$ref": "#/$defs/BooleanOrJinjaString" - }, - { - "type": "null" - } - ], - "default": null - }, - "file_format": { - "anyOf": [ - { - "$ref": "#/$defs/FileFormat" - }, - { - "type": "null" - } - ], - "default": null - }, - "full_refresh": { - "anyOf": [ - { - "$ref": "#/$defs/BooleanOrJinjaString" - }, - { - "type": "null" - } - ], - "default": null - }, - "grant_access_to": { - "anyOf": [ - { - "$ref": "#/$defs/AuthorizedViews" - }, - { - "type": "null" - } - ], - "default": null - }, - "grants": { - "anyOf": [ - { - "$ref": "#/$defs/Grants" - }, - { - "type": "null" - } - ], - "default": null - }, - "group": { - "anyOf": [ - { - "$ref": "#/$defs/Group" - }, - { - "type": "null" - } - ], - "default": null - }, - "hours_to_expiration": { - "anyOf": [ - { - "$ref": "#/$defs/HoursToExpiration" - }, - { - "type": "null" - } - ], - "default": null - }, - "incremental_strategy": { - "anyOf": [ - { - "$ref": "#/$defs/IncrementalStrategy" - }, - { - "type": "null" - } - ], - "default": null - }, - "kms_key_name": { - "anyOf": [ - { - "$ref": "#/$defs/KmsKeyName" - }, - { - "type": "null" - } - ], - "default": null - }, - "labels": { - "anyOf": [ - { - "$ref": "#/$defs/LabelConfigs1" - }, - { - "type": "null" - } - ], - "default": null - }, - "location": { - "anyOf": [ - { - "$ref": "#/$defs/Location" - }, - { - "type": "null" - } - ], - "default": null - }, - "materialized": { - "anyOf": [ - { - "$ref": "#/$defs/Materialized" - }, - { - "type": "null" - } - ], - "default": null - }, - "meta": { - "anyOf": [ - { - "$ref": "#/$defs/Meta" - }, - { - "type": "null" - } - ], - "default": null - }, - "on_configuration_change": { - "anyOf": [ - { - "$ref": "#/$defs/OnConfigurationChange" - }, - { - "type": "null" - } - ], - "default": null - }, - "on_schema_change": { - "anyOf": [ - { - "$ref": "#/$defs/OnSchemaChange" - }, - { - "type": "null" - } - ], - "default": null - }, - "persist_docs": { - "anyOf": [ - { - "$ref": "#/$defs/PersistDocsConfig" - }, - { - "type": "null" - } - ], - "default": null - }, - "post-hook": { - "anyOf": [ - { - "$ref": "#/$defs/ArrayOfStrings" - }, - { - "type": "null" - } - ], - "default": null - }, - "pre-hook": { - "anyOf": [ - { - "$ref": "#/$defs/ArrayOfStrings" - }, - { - "type": "null" - } - ], - "default": null - }, - "schema": { - "anyOf": [ - { - "$ref": "#/$defs/Schema" - }, - { - "type": "null" - } - ], - "default": null - }, - "secure": { - "anyOf": [ - { - "$ref": "#/$defs/BooleanOrJinjaString" - }, - { - "type": "null" - } - ], - "default": false - }, - "snowflake_warehouse": { - "anyOf": [ - { - "$ref": "#/$defs/SnowflakeWarehouse" - }, - { - "type": "null" - } - ], - "default": null - }, - "sql_header": { - "anyOf": [ - { - "$ref": "#/$defs/SqlHeader" - }, - { - "type": "null" - } - ], - "default": null - }, - "tags": { - "anyOf": [ - { - "$ref": "#/$defs/Tags" - }, - { - "type": "null" - } - ], - "default": null - }, - "target_lag": { - "anyOf": [ - { - "$ref": "#/$defs/TargetLag" - }, - { - "type": "null" - } - ], - "default": null - }, - "transient": { - "anyOf": [ - { - "$ref": "#/$defs/BooleanOrJinjaString" - }, - { - "type": "null" - } - ], - "default": null - } - }, - "title": "ModelConfigs", - "type": "object" - }, - "OnConfigurationChange": { - "enum": [ - "apply", - "continue", - "fail" - ], - "title": "OnConfigurationChange", - "type": "string" - }, - "OnSchemaChange": { - "enum": [ - "append_new_columns", - "fail", - "ignore", - "sync_all_columns" - ], - "title": "OnSchemaChange", - "type": "string" - }, - "PersistDocsConfig": { - "additionalProperties": false, - "properties": { - "columns": { - "anyOf": [ - { - "$ref": "#/$defs/BooleanOrJinjaString" - }, - { - "type": "null" - } - ] - }, - "relation": { - "anyOf": [ - { - "$ref": "#/$defs/BooleanOrJinjaString" - }, - { - "type": "null" - } - ] - } - }, - "title": "PersistDocsConfig", - "type": "object" - }, - "QueryComment": { - "additionalProperties": false, - "properties": { - "append": { - "anyOf": [ - { - "$ref": "#/$defs/BooleanOrJinjaString" - }, - { - "type": "null" - } - ], - "default": null - }, - "comment": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Comment" - }, - "job-label": { - "anyOf": [ - { - "$ref": "#/$defs/BooleanOrJinjaString" - }, - { - "type": "null" - } - ], - "default": null - } - }, - "title": "QueryComment", - "type": "object" - }, - "Quoting": { - "properties": { - "database": { - "anyOf": [ - { - "$ref": "#/$defs/BooleanOrJinjaString" - }, - { - "type": "null" - } - ], - "default": null - }, - "identifier": { - "anyOf": [ - { - "$ref": "#/$defs/BooleanOrJinjaString" - }, - { - "type": "null" - } - ], - "default": null - }, - "schema": { - "anyOf": [ - { - "$ref": "#/$defs/BooleanOrJinjaString" - }, - { - "type": "null" - } - ], - "default": null - } - }, - "title": "Quoting", - "type": "object" - }, - "Schema": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Schema" - }, - "SeedConfigs": { - "properties": { - "+column_types": { - "anyOf": [ - { - "$ref": "#/$defs/ColumnTypes" - }, - { - "type": "null" - } - ], - "default": null - }, - "+copy_grants": { - "anyOf": [ - { - "$ref": "#/$defs/BooleanOrJinjaString" - }, - { - "type": "null" - } - ], - "default": null - }, - "+database": { - "anyOf": [ - { - "$ref": "#/$defs/Database" - }, - { - "type": "null" - } - ], - "default": null - }, - "+docs": { - "anyOf": [ - { - "$ref": "#/$defs/DocsConfig" - }, - { - "type": "null" - } - ], - "default": null - }, - "+enabled": { - "anyOf": [ - { - "$ref": "#/$defs/BooleanOrJinjaString" - }, - { - "type": "null" - } - ], - "default": null - }, - "+full_refresh": { - "anyOf": [ - { - "$ref": "#/$defs/BooleanOrJinjaString" - }, - { - "type": "null" - } - ], - "default": null - }, - "+grants": { - "anyOf": [ - { - "$ref": "#/$defs/Grants" - }, - { - "type": "null" - } - ], - "default": null - }, - "+group": { - "anyOf": [ - { - "$ref": "#/$defs/Group" - }, - { - "type": "null" - } - ], - "default": null - }, - "+meta": { - "anyOf": [ - { - "$ref": "#/$defs/Meta" - }, - { - "type": "null" - } - ], - "default": null - }, - "+persist_docs": { - "anyOf": [ - { - "$ref": "#/$defs/PersistDocsConfig" - }, - { - "type": "null" - } - ], - "default": null - }, - "+quote_columns": { - "anyOf": [ - { - "$ref": "#/$defs/BooleanOrJinjaString" - }, - { - "type": "null" - } - ], - "default": null - }, - "+schema": { - "anyOf": [ - { - "$ref": "#/$defs/Schema" - }, - { - "type": "null" - } - ], - "default": null - }, - "+tags": { - "anyOf": [ - { - "$ref": "#/$defs/Tags" - }, - { - "type": "null" - } - ], - "default": null - }, - "+transient": { - "anyOf": [ - { - "$ref": "#/$defs/BooleanOrJinjaString" - }, - { - "type": "null" - } - ], - "default": null - }, - "column_types": { - "anyOf": [ - { - "$ref": "#/$defs/ColumnTypes" - }, - { - "type": "null" - } - ], - "default": null - }, - "copy_grants": { - "anyOf": [ - { - "$ref": "#/$defs/BooleanOrJinjaString" - }, - { - "type": "null" - } - ], - "default": null - }, - "database": { - "anyOf": [ - { - "$ref": "#/$defs/Database" - }, - { - "type": "null" - } - ], - "default": null - }, - "docs": { - "anyOf": [ - { - "$ref": "#/$defs/DocsConfig" - }, - { - "type": "null" - } - ], - "default": null - }, - "enabled": { - "anyOf": [ - { - "$ref": "#/$defs/BooleanOrJinjaString" - }, - { - "type": "null" - } - ], - "default": null - }, - "full_refresh": { - "anyOf": [ - { - "$ref": "#/$defs/BooleanOrJinjaString" - }, - { - "type": "null" - } - ], - "default": null - }, - "grants": { - "anyOf": [ - { - "$ref": "#/$defs/Grants" - }, - { - "type": "null" - } - ], - "default": null - }, - "group": { - "anyOf": [ - { - "$ref": "#/$defs/Group" - }, - { - "type": "null" - } - ], - "default": null - }, - "meta": { - "anyOf": [ - { - "$ref": "#/$defs/Meta" - }, - { - "type": "null" - } - ], - "default": null - }, - "persist_docs": { - "anyOf": [ - { - "$ref": "#/$defs/PersistDocsConfig" - }, - { - "type": "null" - } - ], - "default": null - }, - "quote_columns": { - "anyOf": [ - { - "$ref": "#/$defs/BooleanOrJinjaString" - }, - { - "type": "null" - } - ], - "default": null - }, - "schema": { - "anyOf": [ - { - "$ref": "#/$defs/Schema" - }, - { - "type": "null" - } - ], - "default": null - }, - "tags": { - "anyOf": [ - { - "$ref": "#/$defs/Tags" - }, - { - "type": "null" - } - ], - "default": null - }, - "transient": { - "anyOf": [ - { - "$ref": "#/$defs/BooleanOrJinjaString" - }, - { - "type": "null" - } - ], - "default": null - } - }, - "title": "SeedConfigs", - "type": "object" - }, - "Severity": { - "anyOf": [ - { - "$ref": "#/$defs/JinjaString" - }, - { - "$ref": "#/$defs/Severity1" - } - ], - "title": "Severity" - }, - "Severity1": { - "enum": [ - "warn", - "error" - ], - "title": "Severity1", - "type": "string" - }, - "SnapshotConfigs": { - "properties": { - "+alias": { - "anyOf": [ - { - "$ref": "#/$defs/Alias" - }, - { - "type": "null" - } - ], - "default": null - }, - "+check_cols": { - "anyOf": [ - { - "$ref": "#/$defs/StringOrArrayOfStrings" - }, - { - "type": "null" - } - ], - "default": null - }, - "+docs": { - "anyOf": [ - { - "$ref": "#/$defs/DocsConfig" - }, - { - "type": "null" - } - ], - "default": null - }, - "+enabled": { - "anyOf": [ - { - "$ref": "#/$defs/BooleanOrJinjaString" - }, - { - "type": "null" - } - ], - "default": null - }, - "+grants": { - "anyOf": [ - { - "$ref": "#/$defs/Grants" - }, - { - "type": "null" - } - ], - "default": null - }, - "+group": { - "anyOf": [ - { - "$ref": "#/$defs/Group" - }, - { - "type": "null" - } - ], - "default": null - }, - "+invalidate_hard_deletes": { - "anyOf": [ - { - "$ref": "#/$defs/InvalidateHardDeletes" - }, - { - "type": "null" - } - ], - "default": null - }, - "+meta": { - "anyOf": [ - { - "$ref": "#/$defs/Meta" - }, - { - "type": "null" - } - ], - "default": null - }, - "+persist_docs": { - "anyOf": [ - { - "$ref": "#/$defs/PersistDocsConfig" - }, - { - "type": "null" - } - ], - "default": null - }, - "+post-hook": { - "anyOf": [ - { - "$ref": "#/$defs/ArrayOfStrings" - }, - { - "type": "null" - } - ], - "default": null - }, - "+pre-hook": { - "anyOf": [ - { - "$ref": "#/$defs/ArrayOfStrings" - }, - { - "type": "null" - } - ], - "default": null - }, - "+quote_columns": { - "anyOf": [ - { - "$ref": "#/$defs/BooleanOrJinjaString" - }, - { - "type": "null" - } - ], - "default": null - }, - "+strategy": { - "anyOf": [ - { - "$ref": "#/$defs/Strategy" - }, - { - "type": "null" - } - ], - "default": null - }, - "+tags": { - "anyOf": [ - { - "$ref": "#/$defs/Tags" - }, - { - "type": "null" - } - ], - "default": null - }, - "+target_database": { - "anyOf": [ - { - "$ref": "#/$defs/TargetDatabase" - }, - { - "type": "null" - } - ], - "default": null - }, - "+target_schema": { - "anyOf": [ - { - "$ref": "#/$defs/TargetSchema" - }, - { - "type": "null" - } - ], - "default": null - }, - "+transient": { - "anyOf": [ - { - "$ref": "#/$defs/BooleanOrJinjaString" - }, - { - "type": "null" - } - ], - "default": null - }, - "+unique_key": { - "anyOf": [ - { - "$ref": "#/$defs/StringOrArrayOfStrings" - }, - { - "type": "null" - } - ], - "default": null - }, - "+updated_at": { - "anyOf": [ - { - "$ref": "#/$defs/UpdatedAt" - }, - { - "type": "null" - } - ], - "default": null - }, - "alias": { - "anyOf": [ - { - "$ref": "#/$defs/Alias" - }, - { - "type": "null" - } - ], - "default": null - }, - "check_cols": { - "anyOf": [ - { - "$ref": "#/$defs/StringOrArrayOfStrings" - }, - { - "type": "null" - } - ], - "default": null - }, - "docs": { - "anyOf": [ - { - "$ref": "#/$defs/DocsConfig" - }, - { - "type": "null" - } - ], - "default": null - }, - "enabled": { - "anyOf": [ - { - "$ref": "#/$defs/BooleanOrJinjaString" - }, - { - "type": "null" - } - ], - "default": null - }, - "grants": { - "anyOf": [ - { - "$ref": "#/$defs/Grants" - }, - { - "type": "null" - } - ], - "default": null - }, - "group": { - "anyOf": [ - { - "$ref": "#/$defs/Group" - }, - { - "type": "null" - } - ], - "default": null - }, - "invalidate_hard_deletes": { - "anyOf": [ - { - "$ref": "#/$defs/InvalidateHardDeletes" - }, - { - "type": "null" - } - ], - "default": null - }, - "meta": { - "anyOf": [ - { - "$ref": "#/$defs/Meta" - }, - { - "type": "null" - } - ], - "default": null - }, - "persist_docs": { - "anyOf": [ - { - "$ref": "#/$defs/PersistDocsConfig" - }, - { - "type": "null" - } - ], - "default": null - }, - "post-hook": { - "anyOf": [ - { - "$ref": "#/$defs/ArrayOfStrings" - }, - { - "type": "null" - } - ], - "default": null - }, - "pre-hook": { - "anyOf": [ - { - "$ref": "#/$defs/ArrayOfStrings" - }, - { - "type": "null" - } - ], - "default": null - }, - "quote_columns": { - "anyOf": [ - { - "$ref": "#/$defs/BooleanOrJinjaString" - }, - { - "type": "null" - } - ], - "default": null - }, - "strategy": { - "anyOf": [ - { - "$ref": "#/$defs/Strategy" - }, - { - "type": "null" - } - ], - "default": null - }, - "tags": { - "anyOf": [ - { - "$ref": "#/$defs/Tags" - }, - { - "type": "null" - } - ], - "default": null - }, - "target_database": { - "anyOf": [ - { - "$ref": "#/$defs/TargetDatabase" - }, - { - "type": "null" - } - ], - "default": null - }, - "target_schema": { - "anyOf": [ - { - "$ref": "#/$defs/TargetSchema" - }, - { - "type": "null" - } - ], - "default": null - }, - "transient": { - "anyOf": [ - { - "$ref": "#/$defs/BooleanOrJinjaString" - }, - { - "type": "null" - } - ], - "default": null - }, - "unique_key": { - "anyOf": [ - { - "$ref": "#/$defs/StringOrArrayOfStrings" - }, - { - "type": "null" - } - ], - "default": null - }, - "updated_at": { - "anyOf": [ - { - "$ref": "#/$defs/UpdatedAt" - }, - { - "type": "null" - } - ], - "default": null - } - }, - "title": "SnapshotConfigs", - "type": "object" - }, - "SnowflakeWarehouse": { - "title": "SnowflakeWarehouse", - "type": "string" - }, - "SourceConfigs": { - "properties": { - "+enabled": { - "anyOf": [ - { - "$ref": "#/$defs/BooleanOrJinjaString" - }, - { - "type": "null" - } - ], - "default": null - }, - "+meta": { - "anyOf": [ - { - "$ref": "#/$defs/Meta" - }, - { - "type": "null" - } - ], - "default": null - }, - "+tags": { - "anyOf": [ - { - "$ref": "#/$defs/Tags" - }, - { - "type": "null" - } - ], - "default": null - }, - "enabled": { - "anyOf": [ - { - "$ref": "#/$defs/BooleanOrJinjaString" - }, - { - "type": "null" - } - ], - "default": null - }, - "meta": { - "anyOf": [ - { - "$ref": "#/$defs/Meta" - }, - { - "type": "null" - } - ], - "default": null - }, - "tags": { - "anyOf": [ - { - "$ref": "#/$defs/Tags" - }, - { - "type": "null" - } - ], - "default": null - } - }, - "title": "SourceConfigs", - "type": "object" - }, - "SqlHeader": { - "title": "SqlHeader", - "type": "string" - }, - "Strategy": { - "title": "Strategy", - "type": "string" - }, - "StringOrArrayOfStrings": { - "anyOf": [ - { - "type": "string" - }, - { - "$ref": "#/$defs/ArrayOfStrings" - } - ], - "title": "StringOrArrayOfStrings" - }, - "Tags": { - "allOf": [ - { - "$ref": "#/$defs/StringOrArrayOfStrings" - } - ], - "title": "Tags" - }, - "TargetDatabase": { - "title": "TargetDatabase", - "type": "string" - }, - "TargetLag": { - "pattern": "^(?:downstream|\\d+\\s*(?:seconds|minutes|hours|days))$", - "title": "TargetLag", - "type": "string" - }, - "TargetSchema": { - "title": "TargetSchema", - "type": "string" - }, - "UnitTestConfigs": { - "properties": { - "+meta": { - "anyOf": [ - { - "$ref": "#/$defs/Meta" - }, - { - "type": "null" - } - ], - "default": null - }, - "+tags": { - "anyOf": [ - { - "$ref": "#/$defs/Tags" - }, - { - "type": "null" - } - ], - "default": null - }, - "meta": { - "anyOf": [ - { - "$ref": "#/$defs/Meta" - }, - { - "type": "null" - } - ], - "default": null - }, - "tags": { - "anyOf": [ - { - "$ref": "#/$defs/Tags" - }, - { - "type": "null" - } - ], - "default": null - } - }, - "title": "UnitTestConfigs", - "type": "object" - }, - "UpdatedAt": { - "title": "UpdatedAt", - "type": "string" - }, - "WarnIf": { - "title": "WarnIf", - "type": "string" - } - }, - "additionalProperties": false, - "properties": { - "version": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Version" - }, - "name": { - "title": "Name", - "type": "string" - }, - "analysis-paths": { - "anyOf": [ - { - "$ref": "#/$defs/ArrayOfStrings" - }, - { - "type": "null" - } - ], - "default": null - }, - "asset-paths": { - "anyOf": [ - { - "$ref": "#/$defs/ArrayOfStrings" - }, - { - "type": "null" - } - ], - "default": null - }, - "clean-targets": { - "anyOf": [ - { - "$ref": "#/$defs/ArrayOfStrings" - }, - { - "type": "null" - } - ], - "default": null - }, - "config-version": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "null" - } - ], - "default": 2, - "title": "Config-Version" - }, - "data_tests": { - "anyOf": [ - { - "$ref": "#/$defs/DataTestConfigs" - }, - { - "type": "null" - } - ], - "default": null - }, - "dbt-cloud": { - "anyOf": [ - { - "$ref": "#/$defs/DbtCloud" - }, - { - "type": "null" - } - ], - "default": null - }, - "dispatch": { - "anyOf": [ - { - "items": { - "$ref": "#/$defs/DispatchItem" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Dispatch" - }, - "docs-paths": { - "anyOf": [ - { - "$ref": "#/$defs/ArrayOfStrings" - }, - { - "type": "null" - } - ], - "default": null - }, - "flags": { - "anyOf": [ - { - "$ref": "#/$defs/Flags" - }, - { - "type": "null" - } - ], - "default": null - }, - "log-path": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Log-Path" - }, - "macro-paths": { - "anyOf": [ - { - "$ref": "#/$defs/ArrayOfStrings" - }, - { - "type": "null" - } - ], - "default": null - }, - "model-paths": { - "anyOf": [ - { - "$ref": "#/$defs/ArrayOfStrings" - }, - { - "type": "null" - } - ], - "default": null - }, - "models": { - "anyOf": [ - { - "$ref": "#/$defs/ModelConfigs" - }, - { - "type": "null" - } - ], - "default": null - }, - "on-run-end": { - "anyOf": [ - { - "$ref": "#/$defs/ArrayOfStrings" - }, - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "On-Run-End" - }, - "on-run-start": { - "anyOf": [ - { - "$ref": "#/$defs/ArrayOfStrings" - }, - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "On-Run-Start" - }, - "packages-install-path": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Packages-Install-Path" - }, - "profile": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Profile" - }, - "query-comment": { - "anyOf": [ - { - "type": "string" - }, - { - "$ref": "#/$defs/QueryComment" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Query-Comment" - }, - "quoting": { - "anyOf": [ - { - "$ref": "#/$defs/Quoting" - }, - { - "type": "null" - } - ], - "default": null - }, - "require-dbt-version": { - "anyOf": [ - { - "$ref": "#/$defs/StringOrArrayOfStrings" - }, - { - "type": "null" - } - ], - "default": null - }, - "seed-paths": { - "anyOf": [ - { - "$ref": "#/$defs/ArrayOfStrings" - }, - { - "type": "null" - } - ], - "default": null - }, - "seeds": { - "anyOf": [ - { - "$ref": "#/$defs/SeedConfigs" - }, - { - "type": "null" - } - ], - "default": null - }, - "snapshot-paths": { - "anyOf": [ - { - "$ref": "#/$defs/ArrayOfStrings" - }, - { - "type": "null" - } - ], - "default": null - }, - "snapshots": { - "anyOf": [ - { - "$ref": "#/$defs/SnapshotConfigs" - }, - { - "type": "null" - } - ], - "default": null - }, - "sources": { - "anyOf": [ - { - "$ref": "#/$defs/SourceConfigs" - }, - { - "type": "null" - } - ], - "default": null - }, - "target-path": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Target-Path" - }, - "test-paths": { - "anyOf": [ - { - "$ref": "#/$defs/ArrayOfStrings" - }, - { - "type": "null" - } - ], - "default": null - }, - "tests": { - "anyOf": [ - { - "$ref": "#/$defs/DataTestConfigs" - }, - { - "type": "null" - } - ], - "default": null - }, - "unit_tests": { - "anyOf": [ - { - "$ref": "#/$defs/UnitTestConfigs" - }, - { - "type": "null" - } - ], - "default": null - }, - "vars": { - "anyOf": [ - { - "type": "object" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Vars" - } - }, - "required": [ - "name" - ], - "title": "DbtProject", - "type": "object" -} \ No newline at end of file diff --git a/schemas/latest-generated/dbt_yml_files-latest-generated.json b/schemas/latest-generated/dbt_yml_files-latest-generated.json deleted file mode 100644 index 2f0fcf2..0000000 --- a/schemas/latest-generated/dbt_yml_files-latest-generated.json +++ /dev/null @@ -1,4711 +0,0 @@ -{ - "$defs": { - "AcceptedValues": { - "properties": { - "name": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Name" - }, - "config": { - "anyOf": [ - { - "$ref": "#/$defs/TestConfigs" - }, - { - "type": "null" - } - ], - "default": null - }, - "quote": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Quote" - }, - "values": { - "items": { - "type": "string" - }, - "title": "Values", - "type": "array" - }, - "where": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Where" - } - }, - "required": [ - "values" - ], - "title": "AcceptedValues", - "type": "object" - }, - "AcceptedValuesTest": { - "properties": { - "accepted_values": { - "anyOf": [ - { - "$ref": "#/$defs/AcceptedValues" - }, - { - "type": "null" - } - ], - "default": null - } - }, - "title": "AcceptedValuesTest", - "type": "object" - }, - "Access": { - "enum": [ - "private", - "protected", - "public" - ], - "title": "Access", - "type": "string" - }, - "Agg": { - "enum": [ - "SUM", - "MIN", - "MAX", - "AVG", - "COUNT_DISTINCT", - "SUM_BOOLEAN", - "COUNT", - "PERCENTILE", - "MEDIAN", - "sum", - "min", - "max", - "avg", - "count_distinct", - "sum_boolean", - "count", - "percentile", - "median" - ], - "title": "Agg", - "type": "string" - }, - "AggregationTypeParams": { - "additionalProperties": false, - "properties": { - "percentile": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Percentile" - }, - "use_approximate_percentile": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Use Approximate Percentile" - }, - "use_discrete_percentile": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Use Discrete Percentile" - } - }, - "title": "AggregationTypeParams", - "type": "object" - }, - "Analyse": { - "properties": { - "name": { - "title": "Name", - "type": "string" - }, - "description": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Description" - }, - "columns": { - "anyOf": [ - { - "items": { - "$ref": "#/$defs/Column" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Columns" - }, - "config": { - "anyOf": [ - { - "$ref": "#/$defs/Config" - }, - { - "type": "null" - } - ], - "default": null - }, - "docs": { - "anyOf": [ - { - "$ref": "#/$defs/DocsConfig" - }, - { - "type": "null" - } - ], - "default": null - }, - "group": { - "anyOf": [ - { - "$ref": "#/$defs/GroupName" - }, - { - "type": "null" - } - ], - "default": null - } - }, - "required": [ - "name" - ], - "title": "Analyse", - "type": "object" - }, - "Argument": { - "additionalProperties": false, - "properties": { - "name": { - "title": "Name", - "type": "string" - }, - "description": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Description" - }, - "type": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Type" - } - }, - "required": [ - "name" - ], - "title": "Argument", - "type": "object" - }, - "ArrayOfStrings": { - "items": { - "type": "string" - }, - "title": "ArrayOfStrings", - "type": "array" - }, - "AuthorizedView": { - "additionalProperties": false, - "properties": { - "database": { - "title": "Database", - "type": "string" - }, - "project": { - "title": "Project", - "type": "string" - } - }, - "required": [ - "database", - "project" - ], - "title": "AuthorizedView", - "type": "object" - }, - "BooleanOrJinjaString": { - "anyOf": [ - { - "$ref": "#/$defs/JinjaString" - }, - { - "type": "boolean" - } - ], - "title": "BooleanOrJinjaString" - }, - "Calculation": { - "enum": [ - "conversions", - "conversion_rate", - "CONVERSIONS", - "CONVERSION_RATE" - ], - "title": "Calculation", - "type": "string" - }, - "CategoricalDimension": { - "additionalProperties": false, - "properties": { - "name": { - "pattern": "(?!.*__).*^[a-z][a-z0-9_]*[a-z0-9]$", - "title": "Name", - "type": "string" - }, - "description": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Description" - }, - "expr": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "boolean" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Expr" - }, - "is_partition": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Is Partition" - }, - "type": { - "$ref": "#/$defs/CategoricalDimensionType" - } - }, - "required": [ - "name", - "type" - ], - "title": "CategoricalDimension", - "type": "object" - }, - "CategoricalDimensionType": { - "enum": [ - "CATEGORICAL", - "categorical" - ], - "title": "CategoricalDimensionType", - "type": "string" - }, - "Column": { - "additionalProperties": false, - "properties": { - "name": { - "title": "Name", - "type": "string" - }, - "description": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Description" - }, - "data_type": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Data Type" - } - }, - "required": [ - "name" - ], - "title": "Column", - "type": "object" - }, - "ColumnProperties": { - "additionalProperties": false, - "properties": { - "name": { - "title": "Name", - "type": "string" - }, - "description": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Description" - }, - "constraints": { - "anyOf": [ - { - "$ref": "#/$defs/Constraints" - }, - { - "type": "null" - } - ], - "default": null - }, - "data_tests": { - "anyOf": [ - { - "items": { - "$ref": "#/$defs/DataTests" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Data Tests" - }, - "data_type": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Data Type" - }, - "meta": { - "anyOf": [ - { - "type": "object" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Meta" - }, - "policy_tags": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "description": "Configurations, specific to BigQuery adapter, used to set policy tags on specific columns, enabling column-level security. Only relevant when `persist_docs.columns` is true.", - "title": "Policy tags" - }, - "quote": { - "anyOf": [ - { - "$ref": "#/$defs/BooleanOrJinjaString" - }, - { - "type": "null" - } - ], - "default": null - }, - "tags": { - "anyOf": [ - { - "$ref": "#/$defs/StringOrArrayOfStrings" - }, - { - "type": "null" - } - ], - "default": null - }, - "tests": { - "anyOf": [ - { - "items": { - "$ref": "#/$defs/DataTests" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Tests" - } - }, - "required": [ - "name" - ], - "title": "ColumnProperties", - "type": "object" - }, - "Config": { - "additionalProperties": false, - "properties": { - "tags": { - "anyOf": [ - { - "$ref": "#/$defs/StringOrArrayOfStrings" - }, - { - "type": "null" - } - ], - "default": null - } - }, - "title": "Config", - "type": "object" - }, - "ConstantProperty": { - "properties": { - "base_property": { - "description": "DIMENSION or ENTITY", - "title": "Base Property", - "type": "string" - }, - "conversion_property": { - "description": "DIMENSION or ENTITY", - "title": "Conversion Property", - "type": "string" - } - }, - "required": [ - "base_property", - "conversion_property" - ], - "title": "ConstantProperty", - "type": "object" - }, - "Constraint": { - "properties": { - "name": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Name" - }, - "type": { - "title": "Type", - "type": "string" - }, - "columns": { - "anyOf": [ - { - "$ref": "#/$defs/StringOrArrayOfStrings" - }, - { - "type": "null" - } - ], - "default": null - }, - "expression": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Expression" - }, - "warn_unenforced": { - "anyOf": [ - { - "$ref": "#/$defs/BooleanOrJinjaString" - }, - { - "type": "null" - } - ], - "default": null - }, - "warn_unsupported": { - "anyOf": [ - { - "$ref": "#/$defs/BooleanOrJinjaString" - }, - { - "type": "null" - } - ], - "default": null - } - }, - "required": [ - "type" - ], - "title": "Constraint", - "type": "object" - }, - "Constraints": { - "items": { - "$ref": "#/$defs/Constraint" - }, - "title": "Constraints", - "type": "array" - }, - "Contract": { - "properties": { - "enforced": { - "anyOf": [ - { - "$ref": "#/$defs/BooleanOrJinjaString" - }, - { - "type": "null" - } - ], - "default": null - } - }, - "title": "Contract", - "type": "object" - }, - "ConversionMetric": { - "additionalProperties": false, - "properties": { - "name": { - "pattern": "(?!.*__).*^[a-z][a-z0-9_]*[a-z0-9]$", - "title": "Name", - "type": "string" - }, - "description": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Description" - }, - "filter": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Filter" - }, - "group": { - "anyOf": [ - { - "$ref": "#/$defs/GroupName" - }, - { - "type": "null" - } - ], - "default": null - }, - "label": { - "title": "Label", - "type": "string" - }, - "type": { - "$ref": "#/$defs/ConversionMetricType" - }, - "type_params": { - "$ref": "#/$defs/ConversionMetricTypeParams" - } - }, - "required": [ - "name", - "label", - "type", - "type_params" - ], - "title": "ConversionMetric", - "type": "object" - }, - "ConversionMetricType": { - "enum": [ - "CONVERSION", - "conversion" - ], - "title": "ConversionMetricType", - "type": "string" - }, - "ConversionMetricTypeParams": { - "additionalProperties": false, - "properties": { - "conversion_type_params": { - "anyOf": [ - { - "$ref": "#/$defs/ConversionTypeParams" - }, - { - "type": "null" - } - ], - "default": null - } - }, - "title": "ConversionMetricTypeParams", - "type": "object" - }, - "ConversionTypeParams": { - "additionalProperties": false, - "properties": { - "base_measure": { - "$ref": "#/$defs/MetricInputMeasure" - }, - "calculation": { - "anyOf": [ - { - "$ref": "#/$defs/Calculation" - }, - { - "type": "null" - } - ], - "default": "conversion_rate" - }, - "constant_properties": { - "anyOf": [ - { - "items": { - "$ref": "#/$defs/ConstantProperty" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Constant Properties" - }, - "conversion_measure": { - "$ref": "#/$defs/MetricInputMeasure" - }, - "entity": { - "description": "The entity to calculate over", - "title": "Entity", - "type": "string" - }, - "window": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Window" - } - }, - "required": [ - "base_measure", - "conversion_measure", - "entity" - ], - "title": "ConversionTypeParams", - "type": "object" - }, - "CumulativeMetric": { - "additionalProperties": false, - "properties": { - "name": { - "pattern": "(?!.*__).*^[a-z][a-z0-9_]*[a-z0-9]$", - "title": "Name", - "type": "string" - }, - "description": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Description" - }, - "filter": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Filter" - }, - "group": { - "anyOf": [ - { - "$ref": "#/$defs/GroupName" - }, - { - "type": "null" - } - ], - "default": null - }, - "label": { - "title": "Label", - "type": "string" - }, - "type": { - "$ref": "#/$defs/CumulativeMetricType" - }, - "type_params": { - "$ref": "#/$defs/CumulativeMetricTypeParams" - } - }, - "required": [ - "name", - "label", - "type", - "type_params" - ], - "title": "CumulativeMetric", - "type": "object" - }, - "CumulativeMetricType": { - "enum": [ - "CUMULATIVE", - "cumulative" - ], - "title": "CumulativeMetricType", - "type": "string" - }, - "CumulativeMetricTypeParams": { - "additionalProperties": false, - "properties": { - "grain_to_date": { - "anyOf": [ - { - "$ref": "#/$defs/GrainToDate" - }, - { - "type": "null" - } - ], - "default": null - }, - "measure": { - "anyOf": [ - { - "$ref": "#/$defs/MetricInputMeasure" - }, - { - "type": "null" - } - ], - "default": null - }, - "window": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Window" - } - }, - "title": "CumulativeMetricTypeParams", - "type": "object" - }, - "DataTests": { - "anyOf": [ - { - "type": "string" - }, - { - "$ref": "#/$defs/RelationshipsTest" - }, - { - "$ref": "#/$defs/AcceptedValuesTest" - }, - { - "$ref": "#/$defs/NotNullTest" - }, - { - "$ref": "#/$defs/UniqueTest" - } - ], - "title": "DataTests" - }, - "Defaults": { - "additionalProperties": false, - "properties": { - "agg_time_dimension": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Agg Time Dimension" - } - }, - "title": "Defaults", - "type": "object" - }, - "DerivedMetric": { - "additionalProperties": false, - "properties": { - "name": { - "pattern": "(?!.*__).*^[a-z][a-z0-9_]*[a-z0-9]$", - "title": "Name", - "type": "string" - }, - "description": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Description" - }, - "filter": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Filter" - }, - "group": { - "anyOf": [ - { - "$ref": "#/$defs/GroupName" - }, - { - "type": "null" - } - ], - "default": null - }, - "label": { - "title": "Label", - "type": "string" - }, - "type": { - "$ref": "#/$defs/DerivedMetricType" - }, - "type_params": { - "$ref": "#/$defs/DerivedMetricTypeParams" - } - }, - "required": [ - "name", - "label", - "type", - "type_params" - ], - "title": "DerivedMetric", - "type": "object" - }, - "DerivedMetricType": { - "enum": [ - "DERIVED", - "derived" - ], - "title": "DerivedMetricType", - "type": "string" - }, - "DerivedMetricTypeParams": { - "additionalProperties": false, - "properties": { - "expr": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Expr" - }, - "metrics": { - "anyOf": [ - { - "items": { - "$ref": "#/$defs/MetricInputSchema" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Metrics" - } - }, - "title": "DerivedMetricTypeParams", - "type": "object" - }, - "Dimension": { - "anyOf": [ - { - "$ref": "#/$defs/CategoricalDimension" - }, - { - "$ref": "#/$defs/TimeDimension" - } - ], - "title": "Dimension" - }, - "DimensionTypeParams": { - "additionalProperties": false, - "properties": { - "time_granularity": { - "$ref": "#/$defs/TimeGranularity" - }, - "validity_params": { - "anyOf": [ - { - "$ref": "#/$defs/ValidityParams" - }, - { - "type": "null" - } - ], - "default": null - } - }, - "required": [ - "time_granularity" - ], - "title": "DimensionTypeParams", - "type": "object" - }, - "DocsConfig": { - "additionalProperties": false, - "properties": { - "node_color": { - "anyOf": [ - { - "pattern": "^(#[a-fA-F0-9]{3}|#[a-fA-F0-9]{6}|[^#][a-zA-Z]*)$", - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "description": "The color of the node on the DAG in the documentation. It must be an Hex code or a valid CSS color name.", - "title": "Node Color" - }, - "show": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "null" - } - ], - "default": true, - "title": "Show" - } - }, - "title": "DocsConfig", - "type": "object" - }, - "Entity": { - "additionalProperties": false, - "properties": { - "name": { - "pattern": "(?!.*__).*^[a-z][a-z0-9_]*[a-z0-9]$", - "title": "Name", - "type": "string" - }, - "type": { - "allOf": [ - { - "$ref": "#/$defs/EntityType" - } - ], - "title": "Entity Type" - }, - "entity": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Entity" - }, - "expr": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "boolean" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Expr" - } - }, - "required": [ - "name", - "type" - ], - "title": "Entity", - "type": "object" - }, - "EntityType": { - "enum": [ - "PRIMARY", - "UNIQUE", - "FOREIGN", - "NATURAL", - "primary", - "unique", - "foreign", - "natural" - ], - "title": "EntityType", - "type": "string" - }, - "ExpectCSV": { - "properties": { - "format": { - "const": "csv", - "default": "csv", - "enum": [ - "csv" - ], - "title": "Format", - "type": "string" - }, - "rows": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "description": "When `format` is csv or sql, a string containing comma-separated headers and values. Alternatively provide a fixture. Use the pipe character | to create a multi-line string in YAML.", - "title": "Rows" - }, - "fixture": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "description": "Specify the name of a fixture instead of providing `rows`.", - "title": "Fixture" - } - }, - "title": "ExpectCSV", - "type": "object" - }, - "ExpectDict": { - "properties": { - "format": { - "const": "dict", - "default": "dict", - "enum": [ - "dict" - ], - "title": "Format", - "type": "string" - }, - "rows": { - "description": "When `format` is `dict`, each item should be a dictionary containing a key-value pair for each column and its value, e.g. `{id: 1, code: 'ABC'}`", - "items": { - "type": "object" - }, - "title": "Rows", - "type": "array" - } - }, - "required": [ - "rows" - ], - "title": "ExpectDict", - "type": "object" - }, - "ExpectSQL": { - "properties": { - "format": { - "const": "sql", - "default": "sql", - "enum": [ - "sql" - ], - "title": "Format", - "type": "string" - }, - "rows": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "description": "When `format` is csv or sql, a string containing comma-separated headers and values. Alternatively provide a fixture. Use the pipe character | to create a multi-line string in YAML.", - "title": "Rows" - }, - "fixture": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "description": "Specify the name of a fixture instead of providing `rows`.", - "title": "Fixture" - } - }, - "title": "ExpectSQL", - "type": "object" - }, - "Export": { - "additionalProperties": false, - "properties": { - "name": { - "title": "Name", - "type": "string" - }, - "config": { - "anyOf": [ - { - "$ref": "#/$defs/ExportConfig" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Export Config" - } - }, - "required": [ - "name" - ], - "title": "Export", - "type": "object" - }, - "ExportAs": { - "enum": [ - "table", - "view", - "cache" - ], - "title": "ExportAs", - "type": "string" - }, - "ExportConfig": { - "additionalProperties": true, - "properties": { - "alias": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Alias" - }, - "export_as": { - "anyOf": [ - { - "$ref": "#/$defs/ExportAs" - }, - { - "type": "null" - } - ], - "default": null - }, - "schema": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Schema" - } - }, - "title": "ExportConfig", - "type": "object" - }, - "Exposure": { - "properties": { - "name": { - "title": "Name", - "type": "string" - }, - "description": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Description" - }, - "type": { - "$ref": "#/$defs/Type" - }, - "depends_on": { - "items": { - "type": "string" - }, - "title": "Depends On", - "type": "array" - }, - "label": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Label" - }, - "maturity": { - "anyOf": [ - { - "$ref": "#/$defs/Maturity" - }, - { - "type": "null" - } - ], - "default": null - }, - "meta": { - "anyOf": [ - { - "type": "object" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Meta" - }, - "owner": { - "anyOf": [ - { - "$ref": "#/$defs/OwnerWithEmail" - }, - { - "$ref": "#/$defs/OwnerWithName" - } - ], - "title": "Owner" - }, - "tags": { - "anyOf": [ - { - "$ref": "#/$defs/StringOrArrayOfStrings" - }, - { - "type": "null" - } - ], - "default": null - }, - "url": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Url" - } - }, - "required": [ - "name", - "type", - "depends_on", - "owner" - ], - "title": "Exposure", - "type": "object" - }, - "Format": { - "enum": [ - "csv", - "dict", - "sql" - ], - "title": "Format", - "type": "string" - }, - "FreshnessDefinition": { - "anyOf": [ - { - "$ref": "#/$defs/FreshnessDefinition1" - }, - { - "type": "null" - } - ], - "title": "FreshnessDefinition" - }, - "FreshnessDefinition1": { - "additionalProperties": false, - "properties": { - "error_after": { - "anyOf": [ - { - "$ref": "#/$defs/FreshnessRules" - }, - { - "type": "null" - } - ], - "default": null - }, - "filter": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Filter" - }, - "warn_after": { - "anyOf": [ - { - "$ref": "#/$defs/FreshnessRules" - }, - { - "type": "null" - } - ], - "default": null - } - }, - "title": "FreshnessDefinition1", - "type": "object" - }, - "FreshnessRules": { - "additionalProperties": false, - "properties": { - "count": { - "$ref": "#/$defs/NumberOrJinjaString" - }, - "period": { - "$ref": "#/$defs/Period" - } - }, - "required": [ - "count", - "period" - ], - "title": "FreshnessRules", - "type": "object" - }, - "GivenItem": { - "properties": { - "fixture": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "description": "Only relevant when format is csv. Specify the name of a fixture instead of providing `rows`.", - "title": "Fixture" - }, - "format": { - "anyOf": [ - { - "$ref": "#/$defs/Format" - }, - { - "type": "null" - } - ], - "default": null, - "description": "Defaults to `dict` when not specified" - }, - "input": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "description": "The relation whose inputs you need to mock. Enclose in ref or source without curly braces", - "examples": [ - "ref('model_b')", - "ref('upstream_project', 'model_b')", - "source('schema', 'table')" - ], - "title": "Input" - }, - "additionalProperties": { - "anyOf": [ - {}, - { - "type": "null" - } - ], - "default": null, - "title": "Additionalproperties" - } - }, - "title": "GivenItem", - "type": "object" - }, - "GrainToDate": { - "enum": [ - "day", - "week", - "month", - "quarter", - "year" - ], - "title": "GrainToDate", - "type": "string" - }, - "Grants": { - "additionalProperties": { - "$ref": "#/$defs/StringOrArrayOfStrings" - }, - "description": "grant config. each key is a database permission and the value is the grantee of that permission", - "title": "Grants", - "type": "object" - }, - "Group": { - "additionalProperties": false, - "properties": { - "name": { - "title": "Name", - "type": "string" - }, - "owner": { - "anyOf": [ - { - "$ref": "#/$defs/OwnerWithEmail" - }, - { - "$ref": "#/$defs/OwnerWithName" - } - ], - "title": "Owner" - } - }, - "required": [ - "name", - "owner" - ], - "title": "Group", - "type": "object" - }, - "GroupName": { - "title": "GroupName", - "type": "string" - }, - "IncludeExclude": { - "properties": { - "exclude": { - "anyOf": [ - { - "$ref": "#/$defs/StringOrArrayOfStrings" - }, - { - "type": "null" - } - ], - "default": null - }, - "include": { - "anyOf": [ - { - "$ref": "#/$defs/StringOrArrayOfStrings" - }, - { - "type": "null" - } - ], - "default": null - } - }, - "title": "IncludeExclude", - "type": "object" - }, - "JinjaString": { - "pattern": "\\{\\{.*\\}\\}", - "title": "JinjaString", - "type": "string" - }, - "Macro": { - "additionalProperties": false, - "properties": { - "name": { - "title": "Name", - "type": "string" - }, - "description": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Description" - }, - "arguments": { - "anyOf": [ - { - "items": { - "$ref": "#/$defs/Argument" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Arguments" - }, - "docs": { - "anyOf": [ - { - "$ref": "#/$defs/DocsConfig" - }, - { - "type": "null" - } - ], - "default": null - } - }, - "required": [ - "name" - ], - "title": "Macro", - "type": "object" - }, - "Maturity": { - "enum": [ - "high", - "medium", - "low" - ], - "title": "Maturity", - "type": "string" - }, - "Measure": { - "additionalProperties": false, - "properties": { - "name": { - "pattern": "(?!.*__).*^[a-z][a-z0-9_]*[a-z0-9]$", - "title": "Name", - "type": "string" - }, - "description": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Description" - }, - "agg": { - "$ref": "#/$defs/Agg" - }, - "agg_params": { - "anyOf": [ - { - "$ref": "#/$defs/AggregationTypeParams" - }, - { - "type": "null" - } - ], - "default": null - }, - "agg_time_dimension": { - "anyOf": [ - { - "pattern": "(?!.*__).*^[a-z][a-z0-9_]*[a-z0-9]$", - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Agg Time Dimension" - }, - "create_metric": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Create Metric" - }, - "create_metric_display_name": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Create Metric Display Name" - }, - "expr": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "integer" - }, - { - "type": "boolean" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Expr" - }, - "label": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Label" - }, - "non_additive_dimension": { - "anyOf": [ - { - "$ref": "#/$defs/NonAdditiveDimension" - }, - { - "type": "null" - } - ], - "default": null - } - }, - "required": [ - "name", - "agg" - ], - "title": "Measure", - "type": "object" - }, - "MetricInputMeasure": { - "additionalProperties": false, - "properties": { - "name": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Name" - }, - "fill_nulls_with": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "integer" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Fill Nulls With" - }, - "filter": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Filter" - }, - "join_to_timespine": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Join To Timespine" - } - }, - "title": "MetricInputMeasure", - "type": "object" - }, - "MetricInputSchema": { - "additionalProperties": false, - "properties": { - "name": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Name" - }, - "alias": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Alias" - }, - "filter": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Filter" - }, - "offset_window": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Offset Window" - } - }, - "title": "MetricInputSchema", - "type": "object" - }, - "Model": { - "additionalProperties": false, - "properties": { - "name": { - "title": "Name", - "type": "string" - }, - "description": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Description" - }, - "access": { - "anyOf": [ - { - "$ref": "#/$defs/Access" - }, - { - "type": "null" - } - ], - "default": null - }, - "columns": { - "anyOf": [ - { - "items": { - "$ref": "#/$defs/ColumnProperties" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Columns" - }, - "config": { - "anyOf": [ - { - "$ref": "#/$defs/ModelConfigs" - }, - { - "type": "null" - } - ], - "default": null - }, - "constraints": { - "anyOf": [ - { - "$ref": "#/$defs/Constraints" - }, - { - "type": "null" - } - ], - "default": null - }, - "data_tests": { - "anyOf": [ - { - "items": { - "$ref": "#/$defs/DataTests" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Data Tests" - }, - "deprecation_date": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Deprecation Date" - }, - "docs": { - "anyOf": [ - { - "$ref": "#/$defs/DocsConfig" - }, - { - "type": "null" - } - ], - "default": null - }, - "group": { - "anyOf": [ - { - "$ref": "#/$defs/GroupName" - }, - { - "type": "null" - } - ], - "default": null - }, - "latest_version": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Latest Version" - }, - "meta": { - "anyOf": [ - { - "type": "object" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Meta" - }, - "tests": { - "anyOf": [ - { - "items": { - "$ref": "#/$defs/DataTests" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Tests" - }, - "versions": { - "anyOf": [ - { - "items": { - "$ref": "#/$defs/Version" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Versions" - } - }, - "required": [ - "name" - ], - "title": "Model", - "type": "object" - }, - "ModelConfigs": { - "properties": { - "auto_refresh": { - "anyOf": [ - { - "$ref": "#/$defs/BooleanOrJinjaString" - }, - { - "type": "null" - } - ], - "default": null - }, - "backup": { - "anyOf": [ - { - "$ref": "#/$defs/BooleanOrJinjaString" - }, - { - "type": "null" - } - ], - "default": null - }, - "contract": { - "anyOf": [ - { - "$ref": "#/$defs/Contract" - }, - { - "type": "null" - } - ], - "default": null - }, - "file_format": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "File Format" - }, - "grant_access_to": { - "anyOf": [ - { - "items": { - "$ref": "#/$defs/AuthorizedView" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "description": "Configuration, specific to BigQuery adapter, used to setup authorized views.", - "title": "Authorized views" - }, - "grants": { - "anyOf": [ - { - "$ref": "#/$defs/Grants" - }, - { - "type": "null" - } - ], - "default": null - }, - "hours_to_expiration": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "null" - } - ], - "default": null, - "description": "Configuration specific to BigQuery adapter used to set an expiration delay (in hours) to a table.", - "title": "Hours To Expiration" - }, - "kms_key_name": { - "anyOf": [ - { - "pattern": "projects/[a-zA-Z0-9_-]*/locations/[a-zA-Z0-9_-]*/keyRings/.*/cryptoKeys/.*", - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "description": "Configuration of the KMS key name, specific to BigQuery adapter.", - "title": "Kms Key Name" - }, - "labels": { - "anyOf": [ - { - "additionalProperties": { - "type": "string" - }, - "type": "object" - }, - { - "type": "null" - } - ], - "default": null, - "description": "Configuration specific to BigQuery adapter used to add labels and tags to tables/views created by dbt.", - "title": "Label configs" - }, - "location": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Location" - }, - "materialized": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Materialized" - }, - "on_configuration_change": { - "anyOf": [ - { - "$ref": "#/$defs/OnConfigurationChange" - }, - { - "type": "null" - } - ], - "default": null - }, - "on_schema_change": { - "anyOf": [ - { - "$ref": "#/$defs/OnSchemaChange" - }, - { - "type": "null" - } - ], - "default": null - }, - "snowflake_warehouse": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Snowflake Warehouse" - }, - "sql_header": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Sql Header" - }, - "target_lag": { - "anyOf": [ - { - "pattern": "^(?:downstream|\\d+\\s*(?:seconds|minutes|hours|days))$", - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Target Lag" - } - }, - "title": "ModelConfigs", - "type": "object" - }, - "NonAdditiveDimension": { - "additionalProperties": false, - "properties": { - "name": { - "title": "Name", - "type": "string" - }, - "window_choice": { - "anyOf": [ - { - "$ref": "#/$defs/WindowChoice" - }, - { - "type": "null" - } - ], - "default": null - }, - "window_groupings": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Window Groupings" - } - }, - "required": [ - "name" - ], - "title": "NonAdditiveDimension", - "type": "object" - }, - "NotNull": { - "properties": { - "name": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Name" - }, - "config": { - "anyOf": [ - { - "$ref": "#/$defs/TestConfigs" - }, - { - "type": "null" - } - ], - "default": null - }, - "where": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Where" - } - }, - "title": "NotNull", - "type": "object" - }, - "NotNullTest": { - "properties": { - "not_null": { - "anyOf": [ - { - "$ref": "#/$defs/NotNull" - }, - { - "type": "null" - } - ], - "default": null - } - }, - "title": "NotNullTest", - "type": "object" - }, - "NumberOrJinjaString": { - "anyOf": [ - { - "$ref": "#/$defs/JinjaString" - }, - { - "type": "number" - } - ], - "title": "NumberOrJinjaString" - }, - "OnConfigurationChange": { - "enum": [ - "apply", - "continue", - "fail" - ], - "title": "OnConfigurationChange", - "type": "string" - }, - "OnSchemaChange": { - "enum": [ - "append_new_columns", - "fail", - "ignore", - "sync_all_columns" - ], - "title": "OnSchemaChange", - "type": "string" - }, - "Overrides": { - "additionalProperties": false, - "properties": { - "env_vars": { - "anyOf": [ - { - "type": "object" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Env Vars" - }, - "macros": { - "anyOf": [ - { - "type": "object" - }, - { - "type": "null" - } - ], - "default": null, - "examples": [ - { - "is_incremental": "true" - } - ], - "title": "Macros" - }, - "vars": { - "anyOf": [ - { - "type": "object" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Vars" - } - }, - "title": "Overrides", - "type": "object" - }, - "OwnerWithEmail": { - "additionalProperties": false, - "properties": { - "email": { - "title": "Email", - "type": "string" - } - }, - "required": [ - "email" - ], - "title": "OwnerWithEmail", - "type": "object" - }, - "OwnerWithName": { - "additionalProperties": false, - "properties": { - "name": { - "title": "Name", - "type": "string" - } - }, - "required": [ - "name" - ], - "title": "OwnerWithName", - "type": "object" - }, - "Period": { - "enum": [ - "minute", - "hour", - "day" - ], - "title": "Period", - "type": "string" - }, - "PersistDocsConfig": { - "additionalProperties": false, - "properties": { - "columns": { - "anyOf": [ - { - "$ref": "#/$defs/BooleanOrJinjaString" - }, - { - "type": "null" - } - ] - }, - "relation": { - "anyOf": [ - { - "$ref": "#/$defs/BooleanOrJinjaString" - }, - { - "type": "null" - } - ] - } - }, - "title": "PersistDocsConfig", - "type": "object" - }, - "QueryParams": { - "properties": { - "dimensions": { - "anyOf": [ - { - "$ref": "#/$defs/ArrayOfStrings" - }, - { - "type": "null" - } - ], - "default": null - }, - "metrics": { - "anyOf": [ - { - "$ref": "#/$defs/ArrayOfStrings" - }, - { - "type": "null" - } - ], - "default": null - }, - "where": { - "anyOf": [ - { - "$ref": "#/$defs/ArrayOfStrings" - }, - { - "type": "null" - } - ], - "default": null - }, - "additionalProperties": { - "anyOf": [ - {}, - { - "type": "null" - } - ], - "default": null, - "title": "Additionalproperties" - } - }, - "title": "QueryParams", - "type": "object" - }, - "Quoting": { - "additionalProperties": false, - "properties": { - "database": { - "anyOf": [ - { - "$ref": "#/$defs/BooleanOrJinjaString" - }, - { - "type": "null" - } - ], - "default": null - }, - "identifier": { - "anyOf": [ - { - "$ref": "#/$defs/BooleanOrJinjaString" - }, - { - "type": "null" - } - ], - "default": null - }, - "schema": { - "anyOf": [ - { - "$ref": "#/$defs/BooleanOrJinjaString" - }, - { - "type": "null" - } - ], - "default": null - } - }, - "title": "Quoting", - "type": "object" - }, - "RatioMetric": { - "additionalProperties": false, - "properties": { - "name": { - "pattern": "(?!.*__).*^[a-z][a-z0-9_]*[a-z0-9]$", - "title": "Name", - "type": "string" - }, - "description": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Description" - }, - "filter": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Filter" - }, - "group": { - "anyOf": [ - { - "$ref": "#/$defs/GroupName" - }, - { - "type": "null" - } - ], - "default": null - }, - "label": { - "title": "Label", - "type": "string" - }, - "type": { - "$ref": "#/$defs/RatioMetricType" - }, - "type_params": { - "$ref": "#/$defs/RatioMetricTypeParams" - } - }, - "required": [ - "name", - "label", - "type", - "type_params" - ], - "title": "RatioMetric", - "type": "object" - }, - "RatioMetricType": { - "enum": [ - "RATIO", - "ratio" - ], - "title": "RatioMetricType", - "type": "string" - }, - "RatioMetricTypeParams": { - "additionalProperties": false, - "properties": { - "denominator": { - "anyOf": [ - { - "$ref": "#/$defs/MetricInputSchema" - }, - { - "type": "null" - } - ], - "default": null - }, - "filter": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Filter" - }, - "numerator": { - "anyOf": [ - { - "$ref": "#/$defs/MetricInputSchema" - }, - { - "type": "null" - } - ], - "default": null - } - }, - "title": "RatioMetricTypeParams", - "type": "object" - }, - "Relationships": { - "properties": { - "name": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Name" - }, - "config": { - "anyOf": [ - { - "$ref": "#/$defs/TestConfigs" - }, - { - "type": "null" - } - ], - "default": null - }, - "field": { - "description": "The foreign key column", - "title": "Relationships: Field", - "type": "string" - }, - "to": { - "examples": [ - "ref('parent_model')", - "source('parent_schema', 'parent_table')" - ], - "title": "To", - "type": "string" - }, - "where": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Where" - } - }, - "required": [ - "field", - "to" - ], - "title": "Relationships", - "type": "object" - }, - "RelationshipsTest": { - "properties": { - "relationships": { - "anyOf": [ - { - "$ref": "#/$defs/Relationships" - }, - { - "type": "null" - } - ], - "default": null - } - }, - "title": "RelationshipsTest", - "type": "object" - }, - "SavedQuery": { - "additionalProperties": false, - "properties": { - "name": { - "title": "Name", - "type": "string" - }, - "description": { - "title": "Description", - "type": "string" - }, - "exports": { - "anyOf": [ - { - "items": { - "$ref": "#/$defs/Export" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Exports" - }, - "label": { - "title": "Label", - "type": "string" - }, - "query_params": { - "$ref": "#/$defs/QueryParams" - } - }, - "required": [ - "name", - "description", - "label", - "query_params" - ], - "title": "SavedQuery", - "type": "object" - }, - "Seed": { - "additionalProperties": false, - "properties": { - "name": { - "title": "Name", - "type": "string" - }, - "description": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Description" - }, - "columns": { - "anyOf": [ - { - "items": { - "$ref": "#/$defs/ColumnProperties" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Columns" - }, - "config": { - "anyOf": [ - { - "$ref": "#/$defs/SeedConfig" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Seed Config" - }, - "docs": { - "anyOf": [ - { - "$ref": "#/$defs/DocsConfig" - }, - { - "type": "null" - } - ], - "default": null - }, - "group": { - "anyOf": [ - { - "$ref": "#/$defs/GroupName" - }, - { - "type": "null" - } - ], - "default": null - }, - "tests": { - "anyOf": [ - { - "items": { - "$ref": "#/$defs/DataTests" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Tests" - } - }, - "required": [ - "name" - ], - "title": "Seed", - "type": "object" - }, - "SeedConfig": { - "properties": { - "column_types": { - "anyOf": [ - { - "type": "object" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Column Types" - }, - "copy_grants": { - "anyOf": [ - { - "$ref": "#/$defs/BooleanOrJinjaString" - }, - { - "type": "null" - } - ], - "default": null - }, - "data_tests": { - "anyOf": [ - { - "items": { - "$ref": "#/$defs/DataTests" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Data Tests" - }, - "database": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Database" - }, - "enabled": { - "anyOf": [ - { - "$ref": "#/$defs/BooleanOrJinjaString" - }, - { - "type": "null" - } - ], - "default": null - }, - "grants": { - "anyOf": [ - { - "$ref": "#/$defs/Grants" - }, - { - "type": "null" - } - ], - "default": null - }, - "quote_columns": { - "anyOf": [ - { - "$ref": "#/$defs/BooleanOrJinjaString" - }, - { - "type": "null" - } - ], - "default": null - }, - "schema": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Schema" - } - }, - "title": "SeedConfig", - "type": "object" - }, - "SemanticModel": { - "additionalProperties": false, - "properties": { - "name": { - "pattern": "(?!.*__).*^[a-z][a-z0-9_]*[a-z0-9]$", - "title": "Name", - "type": "string" - }, - "description": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Description" - }, - "defaults": { - "anyOf": [ - { - "$ref": "#/$defs/Defaults" - }, - { - "type": "null" - } - ], - "default": null - }, - "dimensions": { - "anyOf": [ - { - "items": { - "$ref": "#/$defs/Dimension" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Dimensions" - }, - "entities": { - "anyOf": [ - { - "items": { - "$ref": "#/$defs/Entity" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Entities" - }, - "measures": { - "anyOf": [ - { - "items": { - "$ref": "#/$defs/Measure" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Measures" - }, - "model": { - "title": "Model", - "type": "string" - }, - "primary_entity": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Primary Entity" - } - }, - "required": [ - "name", - "model" - ], - "title": "SemanticModel", - "type": "object" - }, - "Severity": { - "enum": [ - "warn", - "error" - ], - "title": "Severity", - "type": "string" - }, - "SimpleMetric": { - "additionalProperties": false, - "properties": { - "name": { - "pattern": "(?!.*__).*^[a-z][a-z0-9_]*[a-z0-9]$", - "title": "Name", - "type": "string" - }, - "description": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Description" - }, - "filter": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Filter" - }, - "group": { - "anyOf": [ - { - "$ref": "#/$defs/GroupName" - }, - { - "type": "null" - } - ], - "default": null - }, - "label": { - "title": "Label", - "type": "string" - }, - "type": { - "$ref": "#/$defs/SimpleMetricType" - }, - "type_params": { - "$ref": "#/$defs/SimpleMetricTypeParams" - } - }, - "required": [ - "name", - "label", - "type", - "type_params" - ], - "title": "SimpleMetric", - "type": "object" - }, - "SimpleMetricType": { - "enum": [ - "SIMPLE", - "simple" - ], - "title": "SimpleMetricType", - "type": "string" - }, - "SimpleMetricTypeParams": { - "additionalProperties": false, - "properties": { - "measure": { - "anyOf": [ - { - "$ref": "#/$defs/MetricInputMeasure" - }, - { - "type": "null" - } - ], - "default": null - } - }, - "title": "SimpleMetricTypeParams", - "type": "object" - }, - "Snapshot": { - "additionalProperties": false, - "properties": { - "name": { - "title": "Name", - "type": "string" - }, - "description": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Description" - }, - "columns": { - "anyOf": [ - { - "items": { - "$ref": "#/$defs/ColumnProperties" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Columns" - }, - "config": { - "anyOf": [ - { - "$ref": "#/$defs/SnapshotConfig" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Snapshot Config" - }, - "data_tests": { - "anyOf": [ - { - "items": { - "$ref": "#/$defs/DataTests" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Data Tests" - }, - "docs": { - "anyOf": [ - { - "$ref": "#/$defs/DocsConfig" - }, - { - "type": "null" - } - ], - "default": null - }, - "group": { - "anyOf": [ - { - "$ref": "#/$defs/GroupName" - }, - { - "type": "null" - } - ], - "default": null - }, - "meta": { - "anyOf": [ - { - "type": "object" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Meta" - }, - "tests": { - "anyOf": [ - { - "items": { - "$ref": "#/$defs/DataTests" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Tests" - } - }, - "required": [ - "name" - ], - "title": "Snapshot", - "type": "object" - }, - "SnapshotConfig": { - "properties": { - "alias": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Alias" - }, - "check_cols": { - "anyOf": [ - { - "$ref": "#/$defs/StringOrArrayOfStrings" - }, - { - "type": "null" - } - ], - "default": null - }, - "enabled": { - "anyOf": [ - { - "$ref": "#/$defs/BooleanOrJinjaString" - }, - { - "type": "null" - } - ], - "default": null - }, - "grants": { - "anyOf": [ - { - "$ref": "#/$defs/Grants" - }, - { - "type": "null" - } - ], - "default": null - }, - "persist_docs": { - "anyOf": [ - { - "$ref": "#/$defs/PersistDocsConfig" - }, - { - "type": "null" - } - ], - "default": null - }, - "post-hook": { - "anyOf": [ - { - "$ref": "#/$defs/ArrayOfStrings" - }, - { - "type": "null" - } - ], - "default": null - }, - "pre-hook": { - "anyOf": [ - { - "$ref": "#/$defs/ArrayOfStrings" - }, - { - "type": "null" - } - ], - "default": null - }, - "quote_columns": { - "anyOf": [ - { - "$ref": "#/$defs/BooleanOrJinjaString" - }, - { - "type": "null" - } - ], - "default": null - }, - "strategy": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Strategy" - }, - "tags": { - "anyOf": [ - { - "$ref": "#/$defs/StringOrArrayOfStrings" - }, - { - "type": "null" - } - ], - "default": null - }, - "target_database": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Target Database" - }, - "target_schema": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Target Schema" - }, - "unique_key": { - "anyOf": [ - { - "$ref": "#/$defs/StringOrArrayOfStrings" - }, - { - "type": "null" - } - ], - "default": null - }, - "updated_at": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Updated At" - } - }, - "title": "SnapshotConfig", - "type": "object" - }, - "Source": { - "properties": { - "name": { - "description": "How you will identify the schema in {{ source() }} calls. Unless `schema` is also set, this will be the name of the schema in the database.", - "title": "Name", - "type": "string" - }, - "description": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Description" - }, - "config": { - "anyOf": [ - { - "type": "object" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Config" - }, - "data_tests": { - "anyOf": [ - { - "items": { - "$ref": "#/$defs/DataTests" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Data Tests" - }, - "database": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Database" - }, - "freshness": { - "anyOf": [ - { - "$ref": "#/$defs/FreshnessDefinition" - }, - { - "type": "null" - } - ], - "default": null - }, - "loaded_at_field": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Loaded At Field" - }, - "loader": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Loader" - }, - "meta": { - "anyOf": [ - { - "type": "object" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Meta" - }, - "overrides": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "description": "The name of another package installed in your project. If that package has a source with the same name as this one, its properties will be applied on top of the base properties of the overridden source. https://docs.getdbt.com/reference/resource-properties/overrides", - "title": "Package to Override" - }, - "quoting": { - "anyOf": [ - { - "$ref": "#/$defs/Quoting" - }, - { - "type": "null" - } - ], - "default": null - }, - "schema": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "description": "The schema name as stored in the database. Only needed if you want to use a different `name` than what exists in the database (otherwise `name` is used by default)", - "title": "Schema" - }, - "tables": { - "anyOf": [ - { - "items": { - "$ref": "#/$defs/Table" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Tables" - }, - "tags": { - "anyOf": [ - { - "$ref": "#/$defs/StringOrArrayOfStrings" - }, - { - "type": "null" - } - ], - "default": null - }, - "tests": { - "anyOf": [ - { - "items": { - "$ref": "#/$defs/DataTests" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Tests" - } - }, - "required": [ - "name" - ], - "title": "Source", - "type": "object" - }, - "StringOrArrayOfStrings": { - "anyOf": [ - { - "type": "string" - }, - { - "$ref": "#/$defs/ArrayOfStrings" - } - ], - "title": "StringOrArrayOfStrings" - }, - "Table": { - "additionalProperties": false, - "properties": { - "name": { - "description": "How you will identify the table in {{ source() }} calls. Unless `identifier` is also set, this will be the name of the table in the database.", - "title": "Name", - "type": "string" - }, - "description": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Description" - }, - "columns": { - "anyOf": [ - { - "items": { - "$ref": "#/$defs/ColumnProperties" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Columns" - }, - "external": { - "anyOf": [ - { - "type": "object" - }, - { - "type": "null" - } - ], - "default": null, - "title": "External" - }, - "freshness": { - "anyOf": [ - { - "$ref": "#/$defs/FreshnessDefinition" - }, - { - "type": "null" - } - ], - "default": null - }, - "identifier": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "description": "The table name as stored in the database. Only needed if you want to give the source a different name than what exists in the database (otherwise `name` is used by default)", - "title": "Identifier" - }, - "loaded_at_field": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "description": "Which column to check during data freshness tests. Only needed if the table has a different loaded_at_field to the one defined on the source overall.", - "title": "Loaded At Field" - }, - "loader": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Loader" - }, - "meta": { - "anyOf": [ - { - "type": "object" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Meta" - }, - "quoting": { - "anyOf": [ - { - "$ref": "#/$defs/Quoting" - }, - { - "type": "null" - } - ], - "default": null - }, - "tags": { - "anyOf": [ - { - "$ref": "#/$defs/StringOrArrayOfStrings" - }, - { - "type": "null" - } - ], - "default": null - }, - "tests": { - "anyOf": [ - { - "items": { - "$ref": "#/$defs/DataTests" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Tests" - } - }, - "required": [ - "name" - ], - "title": "Table", - "type": "object" - }, - "TestConfigs": { - "properties": { - "alias": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "description": "Only relevant when `store_failures` is true", - "title": "Alias" - }, - "database": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "description": "Only relevant when `store_failures` is true", - "title": "Database" - }, - "enabled": { - "anyOf": [ - { - "$ref": "#/$defs/BooleanOrJinjaString" - }, - { - "type": "null" - } - ], - "default": null - }, - "error_if": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Error If" - }, - "fail_calc": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Fail Calc" - }, - "limit": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Limit" - }, - "schema": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "description": "Only relevant when `store_failures` is true", - "title": "Schema" - }, - "severity": { - "anyOf": [ - { - "$ref": "#/$defs/JinjaString" - }, - { - "$ref": "#/$defs/Severity" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Severity" - }, - "store_failures": { - "anyOf": [ - { - "$ref": "#/$defs/BooleanOrJinjaString" - }, - { - "type": "null" - } - ], - "default": null - }, - "tags": { - "anyOf": [ - { - "$ref": "#/$defs/StringOrArrayOfStrings" - }, - { - "type": "null" - } - ], - "default": null - }, - "warn_if": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Warn If" - } - }, - "title": "TestConfigs", - "type": "object" - }, - "TimeDimension": { - "additionalProperties": false, - "properties": { - "name": { - "pattern": "(?!.*__).*^[a-z][a-z0-9_]*[a-z0-9]$", - "title": "Name", - "type": "string" - }, - "description": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Description" - }, - "expr": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "boolean" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Expr" - }, - "is_partition": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Is Partition" - }, - "type": { - "$ref": "#/$defs/TimeDimensionType" - }, - "type_params": { - "$ref": "#/$defs/DimensionTypeParams" - } - }, - "required": [ - "name", - "type", - "type_params" - ], - "title": "TimeDimension", - "type": "object" - }, - "TimeDimensionType": { - "enum": [ - "TIME", - "time" - ], - "title": "TimeDimensionType", - "type": "string" - }, - "TimeGranularity": { - "enum": [ - "DAY", - "WEEK", - "MONTH", - "QUARTER", - "YEAR", - "day", - "week", - "month", - "quarter", - "year" - ], - "title": "TimeGranularity", - "type": "string" - }, - "Type": { - "enum": [ - "dashboard", - "notebook", - "analysis", - "ml", - "application" - ], - "title": "Type", - "type": "string" - }, - "Unique": { - "properties": { - "name": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Name" - }, - "config": { - "anyOf": [ - { - "$ref": "#/$defs/TestConfigs" - }, - { - "type": "null" - } - ], - "default": null - }, - "where": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Where" - } - }, - "title": "Unique", - "type": "object" - }, - "UniqueTest": { - "properties": { - "unique": { - "anyOf": [ - { - "$ref": "#/$defs/Unique" - }, - { - "type": "null" - } - ], - "default": null - } - }, - "title": "UniqueTest", - "type": "object" - }, - "UnitTest": { - "additionalProperties": false, - "properties": { - "name": { - "title": "Name", - "type": "string" - }, - "description": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Description" - }, - "config": { - "anyOf": [ - { - "$ref": "#/$defs/UnitTestConfig" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Unit Test Config" - }, - "expect": { - "anyOf": [ - { - "$ref": "#/$defs/ExpectDict" - }, - { - "$ref": "#/$defs/ExpectCSV" - }, - { - "$ref": "#/$defs/ExpectSQL" - } - ], - "title": "Expect" - }, - "given": { - "anyOf": [ - { - "items": { - "$ref": "#/$defs/GivenItem" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Given" - }, - "model": { - "description": "The name of the model whose behaviour you are testing. Does not need to be wrapped in a ref.", - "examples": [ - "my_model" - ], - "title": "Model", - "type": "string" - }, - "overrides": { - "anyOf": [ - { - "$ref": "#/$defs/Overrides" - }, - { - "type": "null" - } - ], - "default": null - }, - "additionalProperties": { - "anyOf": [ - {}, - { - "type": "null" - } - ], - "default": null, - "title": "Additionalproperties" - } - }, - "required": [ - "name", - "expect", - "model" - ], - "title": "UnitTest", - "type": "object" - }, - "UnitTestConfig": { - "additionalProperties": false, - "properties": { - "meta": { - "anyOf": [ - { - "type": "object" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Meta" - }, - "tags": { - "anyOf": [ - { - "$ref": "#/$defs/StringOrArrayOfStrings" - }, - { - "type": "null" - } - ], - "default": null - } - }, - "title": "UnitTestConfig", - "type": "object" - }, - "ValidityParams": { - "additionalProperties": false, - "properties": { - "is_end": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Is End" - }, - "is_start": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Is Start" - } - }, - "title": "ValidityParams", - "type": "object" - }, - "Version": { - "properties": { - "columns": { - "anyOf": [ - { - "items": { - "anyOf": [ - { - "$ref": "#/$defs/IncludeExclude" - }, - { - "$ref": "#/$defs/ColumnProperties" - } - ] - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Columns" - }, - "config": { - "anyOf": [ - { - "$ref": "#/$defs/ModelConfigs" - }, - { - "type": "null" - } - ], - "default": null - }, - "v": { - "title": "V", - "type": "number" - } - }, - "required": [ - "v" - ], - "title": "Version", - "type": "object" - }, - "WindowChoice": { - "enum": [ - "MIN", - "MAX", - "min", - "max" - ], - "title": "WindowChoice", - "type": "string" - } - }, - "additionalProperties": false, - "properties": { - "version": { - "const": 2, - "default": 2, - "enum": [ - 2 - ], - "title": "Version", - "type": "integer" - }, - "analyses": { - "anyOf": [ - { - "items": { - "$ref": "#/$defs/Analyse" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Analyses" - }, - "exposures": { - "anyOf": [ - { - "items": { - "$ref": "#/$defs/Exposure" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Exposures" - }, - "groups": { - "anyOf": [ - { - "items": { - "$ref": "#/$defs/Group" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Groups" - }, - "macros": { - "anyOf": [ - { - "items": { - "$ref": "#/$defs/Macro" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Macros" - }, - "metrics": { - "anyOf": [ - { - "items": { - "anyOf": [ - { - "$ref": "#/$defs/SimpleMetric" - }, - { - "$ref": "#/$defs/DerivedMetric" - }, - { - "$ref": "#/$defs/CumulativeMetric" - }, - { - "$ref": "#/$defs/ConversionMetric" - }, - { - "$ref": "#/$defs/RatioMetric" - } - ] - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Metrics" - }, - "models": { - "anyOf": [ - { - "items": { - "$ref": "#/$defs/Model" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Models" - }, - "saved_queries": { - "anyOf": [ - { - "items": { - "$ref": "#/$defs/SavedQuery" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Saved Queries" - }, - "seeds": { - "anyOf": [ - { - "items": { - "$ref": "#/$defs/Seed" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Seeds" - }, - "semantic_models": { - "anyOf": [ - { - "items": { - "$ref": "#/$defs/SemanticModel" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Semantic Models" - }, - "snapshots": { - "anyOf": [ - { - "items": { - "$ref": "#/$defs/Snapshot" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Snapshots" - }, - "sources": { - "anyOf": [ - { - "items": { - "$ref": "#/$defs/Source" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Sources" - }, - "unit_tests": { - "anyOf": [ - { - "items": { - "$ref": "#/$defs/UnitTest" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Unit Tests" - } - }, - "title": "DbtYmlFiles", - "type": "object" -} \ No newline at end of file diff --git a/schemas/latest-generated/dependencies-latest-generated.json b/schemas/latest-generated/dependencies-latest-generated.json deleted file mode 100644 index 9ec213f..0000000 --- a/schemas/latest-generated/dependencies-latest-generated.json +++ /dev/null @@ -1,172 +0,0 @@ -{ - "$defs": { - "GitPackages": { - "additionalProperties": false, - "properties": { - "git": { - "title": "Git URL", - "type": "string" - }, - "revision": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "description": "Pin your package to a specific release by specifying a release name", - "title": "Revision" - }, - "subdirectory": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "description": "Only required if the package is nested in a subdirectory of the git project", - "title": "Subdirectory" - } - }, - "required": [ - "git" - ], - "title": "GitPackages", - "type": "object" - }, - "HubPackages": { - "additionalProperties": false, - "properties": { - "version": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "number" - }, - { - "items": {}, - "type": "array" - } - ], - "description": "A semantic version string or range, such as [\">=1.0.0\", \"<2.0.0\"]", - "title": "Package version" - }, - "install-prerelease": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "null" - } - ], - "default": null, - "description": "Opt in to prerelease versions of a package", - "title": "Install Prerelease" - }, - "package": { - "description": "Must be in format `org_name/package_name`. Refer to hub.getdbt.com for installation instructions", - "examples": [ - "dbt-labs/dbt_utils" - ], - "pattern": "^[\\w\\-\\.]+/[\\w\\-\\.]+$", - "title": "Package identifier", - "type": "string" - } - }, - "required": [ - "version", - "package" - ], - "title": "HubPackages", - "type": "object" - }, - "LocalPackage": { - "additionalProperties": false, - "properties": { - "local": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Local" - } - }, - "title": "LocalPackage", - "type": "object" - }, - "Project": { - "additionalProperties": false, - "properties": { - "name": { - "title": "Name", - "type": "string" - } - }, - "required": [ - "name" - ], - "title": "Project", - "type": "object" - } - }, - "additionalProperties": false, - "properties": { - "packages": { - "anyOf": [ - { - "items": { - "anyOf": [ - { - "$ref": "#/$defs/HubPackages" - }, - { - "$ref": "#/$defs/GitPackages" - }, - { - "$ref": "#/$defs/LocalPackage" - } - ] - }, - "minItems": 1, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Packages" - }, - "projects": { - "anyOf": [ - { - "items": { - "$ref": "#/$defs/Project" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Projects" - } - }, - "title": "Dependencies", - "type": "object" -} \ No newline at end of file diff --git a/schemas/latest-generated/packages-latest-generated.json b/schemas/latest-generated/packages-latest-generated.json deleted file mode 100644 index f1ace24..0000000 --- a/schemas/latest-generated/packages-latest-generated.json +++ /dev/null @@ -1,143 +0,0 @@ -{ - "$defs": { - "GitPackages": { - "additionalProperties": false, - "properties": { - "git": { - "title": "Git URL", - "type": "string" - }, - "revision": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "description": "Pin your package to a specific release by specifying a release name", - "title": "Revision" - }, - "subdirectory": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "description": "Only required if the package is nested in a subdirectory of the git project", - "title": "Subdirectory" - } - }, - "required": [ - "git" - ], - "title": "GitPackages", - "type": "object" - }, - "HubPackages": { - "additionalProperties": false, - "properties": { - "version": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "number" - }, - { - "items": {}, - "type": "array" - } - ], - "description": "A semantic version string or range, such as [\">=1.0.0\", \"<2.0.0\"]", - "title": "Package version" - }, - "install-prerelease": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "null" - } - ], - "default": null, - "description": "Opt in to prerelease versions of a package", - "title": "Install Prerelease" - }, - "package": { - "description": "Must be in format `org_name/package_name`. Refer to hub.getdbt.com for installation instructions", - "examples": [ - "dbt-labs/dbt_utils" - ], - "pattern": "^[\\w\\-\\.]+/[\\w\\-\\.]+$", - "title": "Package identifier", - "type": "string" - } - }, - "required": [ - "version", - "package" - ], - "title": "HubPackages", - "type": "object" - }, - "LocalPackage": { - "additionalProperties": false, - "properties": { - "local": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Local" - } - }, - "title": "LocalPackage", - "type": "object" - } - }, - "additionalProperties": false, - "properties": { - "packages": { - "anyOf": [ - { - "items": { - "anyOf": [ - { - "$ref": "#/$defs/HubPackages" - }, - { - "$ref": "#/$defs/GitPackages" - }, - { - "$ref": "#/$defs/LocalPackage" - } - ] - }, - "minItems": 1, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Packages" - } - }, - "title": "Packages", - "type": "object" -} \ No newline at end of file diff --git a/schemas/latest-generated/selectors-latest-generated.json b/schemas/latest-generated/selectors-latest-generated.json deleted file mode 100644 index a6bc7ff..0000000 --- a/schemas/latest-generated/selectors-latest-generated.json +++ /dev/null @@ -1,272 +0,0 @@ -{ - "$defs": { - "BooleanOrJinjaString": { - "anyOf": [ - { - "$ref": "#/$defs/JinjaString" - }, - { - "type": "boolean" - } - ], - "title": "BooleanOrJinjaString" - }, - "Default": { - "pattern": "\\{\\{.*\\}\\}", - "title": "Default", - "type": "string" - }, - "DefinitionBlock": { - "additionalProperties": true, - "properties": { - "method": { - "anyOf": [ - { - "$ref": "#/$defs/Method" - }, - { - "type": "null" - } - ], - "default": null - }, - "value": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Value" - }, - "children": { - "anyOf": [ - { - "$ref": "#/$defs/BooleanOrJinjaString" - }, - { - "type": "null" - } - ], - "default": null - }, - "parents": { - "anyOf": [ - { - "$ref": "#/$defs/BooleanOrJinjaString" - }, - { - "type": "null" - } - ], - "default": null - }, - "children_depth": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Children Depth" - }, - "parents_depth": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Parents Depth" - }, - "childrens_parents": { - "anyOf": [ - { - "$ref": "#/$defs/BooleanOrJinjaString" - }, - { - "type": "null" - } - ], - "default": null - }, - "indirect_selection": { - "anyOf": [ - { - "$ref": "#/$defs/IndirectSelection" - }, - { - "type": "null" - } - ], - "default": null - } - }, - "title": "DefinitionBlock", - "type": "object" - }, - "ExcludeBlock": { - "items": { - "anyOf": [ - { - "$ref": "#/$defs/IntersectionBlock" - }, - { - "$ref": "#/$defs/DefinitionBlock" - } - ] - }, - "title": "ExcludeBlock", - "type": "array" - }, - "IndirectSelection": { - "enum": [ - "buildable", - "cautious", - "eager" - ], - "title": "IndirectSelection", - "type": "string" - }, - "IntersectionBlock": { - "items": { - "$ref": "#/$defs/DefinitionBlock" - }, - "title": "IntersectionBlock", - "type": "array" - }, - "JinjaString": { - "pattern": "\\{\\{.*\\}\\}", - "title": "JinjaString", - "type": "string" - }, - "Method": { - "enum": [ - "tag", - "source", - "path", - "file", - "fqn", - "package", - "config", - "test_type", - "test_name", - "state", - "exposure", - "metric", - "result", - "source_status", - "group", - "wildcard" - ], - "title": "Method", - "type": "string" - }, - "Selector": { - "additionalProperties": false, - "properties": { - "name": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Name" - }, - "description": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Description" - }, - "default": { - "anyOf": [ - { - "$ref": "#/$defs/Default" - }, - { - "type": "boolean" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Default" - }, - "definition": { - "anyOf": [ - { - "$ref": "#/$defs/DefinitionBlock" - }, - { - "type": "string" - }, - { - "$ref": "#/$defs/UnionBlock" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Definition" - } - }, - "title": "Selector", - "type": "object" - }, - "UnionBlock": { - "items": { - "anyOf": [ - { - "$ref": "#/$defs/IntersectionBlock" - }, - { - "$ref": "#/$defs/DefinitionBlock" - }, - { - "$ref": "#/$defs/ExcludeBlock" - } - ] - }, - "title": "UnionBlock", - "type": "array" - } - }, - "additionalProperties": false, - "properties": { - "selectors": { - "items": { - "$ref": "#/$defs/Selector" - }, - "minItems": 1, - "title": "Selectors", - "type": "array" - } - }, - "required": [ - "selectors" - ], - "title": "Selectors", - "type": "object" -} \ No newline at end of file diff --git a/schemas/latest-originals/dbt_cloud-latest.json b/schemas/latest-originals/dbt_cloud-latest.json new file mode 100644 index 0000000..70921f0 --- /dev/null +++ b/schemas/latest-originals/dbt_cloud-latest.json @@ -0,0 +1,14 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "object", + "properties": { + "project-id": { + "type": "string" + }, + "defer-env-id": { + "type": "string" + } + }, + "required": ["project-id"], + "additionalProperties": false +} diff --git a/schemas/latest-originals/dbt_project-latest.json b/schemas/latest-originals/dbt_project-latest.json new file mode 100644 index 0000000..db6bdf0 --- /dev/null +++ b/schemas/latest-originals/dbt_project-latest.json @@ -0,0 +1,1112 @@ +{ + "title": "dbt_project", + "type": "object", + "required": [ + "name" + ], + "$schema": "http://json-schema.org/draft-07/schema#", + "properties": { + "version": { + "type": "string" + }, + "name": { + "type": "string" + }, + "analysis-paths": { + "$ref": "#/$defs/array_of_strings" + }, + "asset-paths": { + "$ref": "#/$defs/array_of_strings" + }, + "clean-targets": { + "$ref": "#/$defs/array_of_strings" + }, + "config-version": { + "type": "number", + "default": 2 + }, + "data_tests": { + "$ref": "#/$defs/data_test_configs" + }, + "dbt-cloud": { + "type": "object", + "properties": { + "project-id": { + "type": "number" + } + }, + "additionalProperties": true + }, + "dispatch": { + "type": "array", + "items": { + "type": "object", + "required": [ + "macro_namespace", + "search_order" + ], + "properties": { + "macro_namespace": { + "type": "string" + }, + "search_order": { + "$ref": "#/$defs/array_of_strings" + } + }, + "additionalProperties": false + } + }, + "docs-paths": { + "$ref": "#/$defs/array_of_strings" + }, + "flags": { + "type": "object", + "properties": { + "cache_selected_only": { + "type": "boolean" + }, + "debug": { + "type": "boolean" + }, + "fail_fast": { + "type": "boolean" + }, + "indirect_selection": { + "type": "string" + }, + "log_format": { + "type": "string" + }, + "log_format_file": { + "type": "string" + }, + "log_level": { + "type": "string" + }, + "log_level_file": { + "type": "string" + }, + "partial_parse": { + "type": "boolean" + }, + "populate_cache": { + "type": "boolean" + }, + "printer_width": { + "type": "integer" + }, + "require_explicit_package_overrides_for_builtin_materializations": { + "type": "boolean" + }, + "require_resource_names_without_spaces": { + "type": "boolean" + }, + "send_anonymous_usage_stats": { + "type": "boolean" + }, + "source_freshness_run_project_hooks": { + "type": "boolean" + }, + "static_parser": { + "type": "boolean" + }, + "use_colors": { + "type": "boolean" + }, + "use_colors_file": { + "type": "boolean" + }, + "use_experimental_parser": { + "type": "boolean" + }, + "version_check": { + "type": "boolean" + }, + "warn_error": { + "type": "boolean" + }, + "warn_error_options": { + "type": "object" + }, + "write_json": { + "type": "boolean" + } + } + }, + "log-path": { + "type": "string" + }, + "macro-paths": { + "$ref": "#/$defs/array_of_strings" + }, + "model-paths": { + "$ref": "#/$defs/array_of_strings" + }, + "models": { + "$ref": "#/$defs/model_configs" + }, + "on-run-end": { + "anyOf": [ + { + "$ref": "#/$defs/array_of_strings" + }, + { + "type": "string" + } + ] + }, + "on-run-start": { + "anyOf": [ + { + "$ref": "#/$defs/array_of_strings" + }, + { + "type": "string" + } + ] + }, + "packages-install-path": { + "type": "string" + }, + "profile": { + "type": "string" + }, + "query-comment": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "object", + "properties": { + "append": { + "$ref": "#/$defs/boolean_or_jinja_string" + }, + "comment": { + "type": "string" + }, + "job-label": { + "$ref": "#/$defs/boolean_or_jinja_string" + } + }, + "additionalProperties": false + } + ] + }, + "quoting": { + "type": "object", + "properties": { + "database": { + "$ref": "#/$defs/boolean_or_jinja_string" + }, + "identifier": { + "$ref": "#/$defs/boolean_or_jinja_string" + }, + "schema": { + "$ref": "#/$defs/boolean_or_jinja_string" + } + } + }, + "require-dbt-version": { + "$ref": "#/$defs/string_or_array_of_strings" + }, + "seed-paths": { + "$ref": "#/$defs/array_of_strings" + }, + "seeds": { + "$ref": "#/$defs/seed_configs" + }, + "snapshot-paths": { + "$ref": "#/$defs/array_of_strings" + }, + "snapshots": { + "$ref": "#/$defs/snapshot_configs" + }, + "sources": { + "$ref": "#/$defs/source_configs" + }, + "target-path": { + "type": "string" + }, + "test-paths": { + "$ref": "#/$defs/array_of_strings" + }, + "tests": { + "$ref": "#/$defs/data_test_configs" + }, + "unit_tests": { + "$ref": "#/$defs/unit_test_configs" + }, + "vars": { + "type": "object" + } + }, + "additionalProperties": false, + "$defs": { + "access": { + "type": "string", + "enum": [ + "private", + "protected", + "public" + ] + }, + "alias": { + "type": "string" + }, + "array_of_strings": { + "type": "array", + "items": { + "type": "string" + } + }, + "auto_refresh": { + "$ref": "#/$defs/boolean_or_jinja_string" + }, + "backup": { + "$ref": "#/$defs/boolean_or_jinja_string" + }, + "boolean_or_jinja_string": { + "oneOf": [ + { + "$ref": "#/$defs/jinja_string" + }, + { + "type": "boolean" + } + ] + }, + "column_types": { + "type": "object", + "patternProperties": { + "": { + "type": "string" + } + } + }, + "contract": { + "type": "object", + "required": [ + "enforced" + ], + "properties": { + "enforced": { + "$ref": "#/$defs/boolean_or_jinja_string", + "default": "true" + } + } + }, + "data_test_configs": { + "title": "Data test configs", + "description": "Configurations set in the dbt_project.yml file will apply to all tests that don't have a more specific configuration set.", + "type": "object", + "properties": { + "+alias": { + "$ref": "#/$defs/alias" + }, + "+database": { + "$ref": "#/$defs/database" + }, + "+enabled": { + "$ref": "#/$defs/boolean_or_jinja_string" + }, + "+error_if": { + "$ref": "#/$defs/error_if" + }, + "+fail_calc": { + "$ref": "#/$defs/fail_calc" + }, + "+group": { + "$ref": "#/$defs/group" + }, + "+limit": { + "$ref": "#/$defs/limit" + }, + "+meta": { + "$ref": "#/$defs/meta" + }, + "+schema": { + "$ref": "#/$defs/schema" + }, + "+severity": { + "$ref": "#/$defs/severity" + }, + "+store_failures": { + "$ref": "#/$defs/boolean_or_jinja_string" + }, + "+tags": { + "$ref": "#/$defs/tags" + }, + "+warn_if": { + "$ref": "#/$defs/warn_if" + }, + "alias": { + "$ref": "#/$defs/alias" + }, + "database": { + "$ref": "#/$defs/database" + }, + "enabled": { + "$ref": "#/$defs/boolean_or_jinja_string" + }, + "error_if": { + "$ref": "#/$defs/error_if" + }, + "fail_calc": { + "$ref": "#/$defs/fail_calc" + }, + "group": { + "$ref": "#/$defs/group" + }, + "limit": { + "$ref": "#/$defs/limit" + }, + "meta": { + "$ref": "#/$defs/meta" + }, + "schema": { + "$ref": "#/$defs/schema" + }, + "severity": { + "$ref": "#/$defs/severity" + }, + "store_failures": { + "$ref": "#/$defs/boolean_or_jinja_string" + }, + "tags": { + "$ref": "#/$defs/tags" + }, + "warn_if": { + "$ref": "#/$defs/warn_if" + } + }, + "additionalProperties": { + "oneOf": [ + { + "$ref": "#/$defs/data_test_configs" + }, + { + "$ref": "#/$defs/empty_directory" + } + ] + } + }, + "database": { + "type": "string" + }, + "docs_config": { + "title": "Docs config", + "description": "Configurations for the appearance of nodes in the dbt documentation.", + "type": "object", + "properties": { + "node_color": { + "description": "The color of the node on the DAG in the documentation. It must be an Hex code or a valid CSS color name.", + "type": "string", + "pattern": "^(#[a-fA-F0-9]{3}|#[a-fA-F0-9]{6}|[^#][a-zA-Z]*)$" + }, + "show": { + "type": "boolean", + "default": true + } + }, + "additionalProperties": false + }, + "empty_directory": { + "type": "null" + }, + "error_if": { + "type": "string" + }, + "fail_calc": { + "type": "string" + }, + "file_format": { + "type": "string" + }, + "grant_access_to": { + "title": "Authorized views", + "description": "Configuration, specific to BigQuery adapter, used to setup authorized views.", + "type": "array", + "items": { + "type": "object", + "properties": { + "database": { + "type": "string" + }, + "project": { + "type": "string" + } + }, + "additionalProperties": false + } + }, + "grants": { + "description": "grant config. each key is a database permission and the value is the grantee of that permission", + "type": "object", + "patternProperties": { + ".*": { + "$ref": "#/$defs/string_or_array_of_strings" + } + }, + "additionalProperties": false + }, + "group": { + "type": "string" + }, + "hours_to_expiration": { + "description": "Configuration specific to BigQuery adapter used to set an expiration delay (in hours) to a table.", + "type": "number" + }, + "incremental_strategy": { + "type": "string" + }, + "invalidate_hard_deletes": { + "$ref": "#/$defs/boolean_or_jinja_string" + }, + "jinja_string": { + "type": "string", + "pattern": "\\{\\{.*\\}\\}" + }, + "kms_key_name": { + "description": "Configuration, specific to BigQuery adapter, of the KMS key name used for data encryption.", + "type": "string" + }, + "label_configs": { + "title": "Label configs", + "description": "Configurations specific to BigQuery adapter used to add labels and tags to tables & views created by dbt.", + "type": "object", + "patternProperties": { + "^[a-z][a-z0-9_-]{0,63}$": { + "oneOf": [ + { + "type": "string", + "pattern": "^[a-z0-9_-]{0,64}$" + }, + { + "$ref": "#/$defs/jinja_string" + } + ] + } + }, + "additionalProperties": false + }, + "limit": { + "type": "number" + }, + "location": { + "type": "string" + }, + "materialized": { + "type": "string" + }, + "meta": { + "type": "object" + }, + "model_configs": { + "title": "Model configs", + "description": "Configurations set in the dbt_project.yml file will apply to all models that don't have a more specific configuration set.", + "type": "object", + "properties": { + "+access": { + "$ref": "#/$defs/access" + }, + "+alias": { + "$ref": "#/$defs/alias" + }, + "+auto_refresh": { + "$ref": "#/$defs/auto_refresh" + }, + "+backup": { + "$ref": "#/$defs/backup" + }, + "+bind": { + "$ref": "#/$defs/boolean_or_jinja_string", + "default": false + }, + "+contract": { + "$ref": "#/$defs/contract" + }, + "+copy_grants": { + "$ref": "#/$defs/boolean_or_jinja_string" + }, + "+database": { + "$ref": "#/$defs/database" + }, + "+docs": { + "$ref": "#/$defs/docs_config" + }, + "+enabled": { + "$ref": "#/$defs/boolean_or_jinja_string" + }, + "+file_format": { + "$ref": "#/$defs/file_format" + }, + "+full_refresh": { + "$ref": "#/$defs/boolean_or_jinja_string" + }, + "+grant_access_to": { + "$ref": "#/$defs/grant_access_to" + }, + "+grants": { + "$ref": "#/$defs/grants" + }, + "+group": { + "$ref": "#/$defs/group" + }, + "+hours_to_expiration": { + "$ref": "#/$defs/hours_to_expiration" + }, + "+incremental_strategy": { + "$ref": "#/$defs/incremental_strategy" + }, + "+kms_key_name": { + "$ref": "#/$defs/kms_key_name" + }, + "+labels": { + "$ref": "#/$defs/label_configs" + }, + "+location": { + "$ref": "#/$defs/location" + }, + "+materialized": { + "$ref": "#/$defs/materialized" + }, + "+meta": { + "$ref": "#/$defs/meta" + }, + "+on_configuration_change": { + "$ref": "#/$defs/on_configuration_change" + }, + "+on_schema_change": { + "$ref": "#/$defs/on_schema_change" + }, + "+persist_docs": { + "$ref": "#/$defs/persist_docs_config" + }, + "+post-hook": { + "$ref": "#/$defs/array_of_strings" + }, + "+pre-hook": { + "$ref": "#/$defs/array_of_strings" + }, + "+schema": { + "$ref": "#/$defs/schema" + }, + "+secure": { + "$ref": "#/$defs/boolean_or_jinja_string", + "default": false + }, + "+snowflake_warehouse": { + "$ref": "#/$defs/snowflake_warehouse" + }, + "+sql_header": { + "$ref": "#/$defs/sql_header" + }, + "+tags": { + "$ref": "#/$defs/tags" + }, + "+target_lag": { + "$ref": "#/$defs/target_lag" + }, + "+transient": { + "$ref": "#/$defs/boolean_or_jinja_string" + }, + "access": { + "$ref": "#/$defs/access" + }, + "alias": { + "$ref": "#/$defs/alias" + }, + "auto_refresh": { + "$ref": "#/$defs/auto_refresh" + }, + "backup": { + "$ref": "#/$defs/backup" + }, + "bind": { + "$ref": "#/$defs/boolean_or_jinja_string", + "default": false + }, + "contract": { + "$ref": "#/$defs/contract" + }, + "copy_grants": { + "$ref": "#/$defs/boolean_or_jinja_string" + }, + "database": { + "$ref": "#/$defs/database" + }, + "docs": { + "$ref": "#/$defs/docs_config" + }, + "enabled": { + "$ref": "#/$defs/boolean_or_jinja_string" + }, + "file_format": { + "$ref": "#/$defs/file_format" + }, + "full_refresh": { + "$ref": "#/$defs/boolean_or_jinja_string" + }, + "grant_access_to": { + "$ref": "#/$defs/grant_access_to" + }, + "grants": { + "$ref": "#/$defs/grants" + }, + "group": { + "$ref": "#/$defs/group" + }, + "hours_to_expiration": { + "$ref": "#/$defs/hours_to_expiration" + }, + "incremental_strategy": { + "$ref": "#/$defs/incremental_strategy" + }, + "kms_key_name": { + "$ref": "#/$defs/kms_key_name" + }, + "labels": { + "$ref": "#/$defs/label_configs" + }, + "location": { + "$ref": "#/$defs/location" + }, + "materialized": { + "$ref": "#/$defs/materialized" + }, + "meta": { + "$ref": "#/$defs/meta" + }, + "on_configuration_change": { + "$ref": "#/$defs/on_configuration_change" + }, + "on_schema_change": { + "$ref": "#/$defs/on_schema_change" + }, + "persist_docs": { + "$ref": "#/$defs/persist_docs_config" + }, + "post-hook": { + "$ref": "#/$defs/array_of_strings" + }, + "pre-hook": { + "$ref": "#/$defs/array_of_strings" + }, + "schema": { + "$ref": "#/$defs/schema" + }, + "secure": { + "$ref": "#/$defs/boolean_or_jinja_string", + "default": false + }, + "snowflake_warehouse": { + "$ref": "#/$defs/snowflake_warehouse" + }, + "sql_header": { + "$ref": "#/$defs/sql_header" + }, + "tags": { + "$ref": "#/$defs/tags" + }, + "target_lag": { + "$ref": "#/$defs/target_lag" + }, + "transient": { + "$ref": "#/$defs/boolean_or_jinja_string" + } + }, + "additionalProperties": { + "oneOf": [ + { + "$ref": "#/$defs/model_configs" + }, + { + "$ref": "#/$defs/empty_directory" + } + ] + } + }, + "on_configuration_change": { + "type": "string", + "enum": [ + "apply", + "continue", + "fail" + ] + }, + "on_schema_change": { + "type": "string", + "enum": [ + "append_new_columns", + "fail", + "ignore", + "sync_all_columns" + ] + }, + "persist_docs_config": { + "title": "Persist docs config", + "description": "Configurations for the persistence of the dbt documentation.", + "type": "object", + "properties": { + "columns": { + "$ref": "#/$defs/boolean_or_jinja_string", + "default": true + }, + "relation": { + "$ref": "#/$defs/boolean_or_jinja_string", + "default": true + } + }, + "additionalProperties": false + }, + "schema": { + "type": [ + "string", + "null" + ] + }, + "seed_configs": { + "title": "Seed configs", + "type": "object", + "properties": { + "+column_types": { + "$ref": "#/$defs/column_types" + }, + "+copy_grants": { + "$ref": "#/$defs/boolean_or_jinja_string" + }, + "+database": { + "$ref": "#/$defs/database" + }, + "+docs": { + "$ref": "#/$defs/docs_config" + }, + "+enabled": { + "$ref": "#/$defs/boolean_or_jinja_string" + }, + "+full_refresh": { + "$ref": "#/$defs/boolean_or_jinja_string" + }, + "+grants": { + "$ref": "#/$defs/grants" + }, + "+group": { + "$ref": "#/$defs/group" + }, + "+meta": { + "$ref": "#/$defs/meta" + }, + "+persist_docs": { + "$ref": "#/$defs/persist_docs_config" + }, + "+quote_columns": { + "$ref": "#/$defs/boolean_or_jinja_string" + }, + "+schema": { + "$ref": "#/$defs/schema" + }, + "+tags": { + "$ref": "#/$defs/tags" + }, + "+transient": { + "$ref": "#/$defs/boolean_or_jinja_string" + }, + "column_types": { + "$ref": "#/$defs/column_types" + }, + "copy_grants": { + "$ref": "#/$defs/boolean_or_jinja_string" + }, + "database": { + "$ref": "#/$defs/database" + }, + "docs": { + "$ref": "#/$defs/docs_config" + }, + "enabled": { + "$ref": "#/$defs/boolean_or_jinja_string" + }, + "full_refresh": { + "$ref": "#/$defs/boolean_or_jinja_string" + }, + "grants": { + "$ref": "#/$defs/grants" + }, + "group": { + "$ref": "#/$defs/group" + }, + "meta": { + "$ref": "#/$defs/meta" + }, + "persist_docs": { + "$ref": "#/$defs/persist_docs_config" + }, + "quote_columns": { + "$ref": "#/$defs/boolean_or_jinja_string" + }, + "schema": { + "$ref": "#/$defs/schema" + }, + "tags": { + "$ref": "#/$defs/tags" + }, + "transient": { + "$ref": "#/$defs/boolean_or_jinja_string" + } + }, + "additionalProperties": { + "oneOf": [ + { + "$ref": "#/$defs/seed_configs" + }, + { + "$ref": "#/$defs/empty_directory" + } + ] + } + }, + "severity": { + "oneOf": [ + { + "$ref": "#/$defs/jinja_string" + }, + { + "type": "string", + "enum": [ + "warn", + "error" + ] + } + ] + }, + "snapshot_configs": { + "title": "Snapshot configs", + "type": "object", + "properties": { + "+alias": { + "$ref": "#/$defs/alias" + }, + "+check_cols": { + "$ref": "#/$defs/string_or_array_of_strings" + }, + "+docs": { + "$ref": "#/$defs/docs_config" + }, + "+enabled": { + "$ref": "#/$defs/boolean_or_jinja_string" + }, + "+grants": { + "$ref": "#/$defs/grants" + }, + "+group": { + "$ref": "#/$defs/group" + }, + "+invalidate_hard_deletes": { + "$ref": "#/$defs/invalidate_hard_deletes" + }, + "+meta": { + "$ref": "#/$defs/meta" + }, + "+persist_docs": { + "$ref": "#/$defs/persist_docs_config" + }, + "+post-hook": { + "$ref": "#/$defs/array_of_strings" + }, + "+pre-hook": { + "$ref": "#/$defs/array_of_strings" + }, + "+quote_columns": { + "$ref": "#/$defs/boolean_or_jinja_string" + }, + "+strategy": { + "$ref": "#/$defs/strategy" + }, + "+tags": { + "$ref": "#/$defs/tags" + }, + "+target_database": { + "$ref": "#/$defs/target_database" + }, + "+target_schema": { + "$ref": "#/$defs/target_schema" + }, + "+transient": { + "$ref": "#/$defs/boolean_or_jinja_string" + }, + "+unique_key": { + "$ref": "#/$defs/string_or_array_of_strings" + }, + "+updated_at": { + "$ref": "#/$defs/updated_at" + }, + "alias": { + "$ref": "#/$defs/alias" + }, + "check_cols": { + "$ref": "#/$defs/string_or_array_of_strings" + }, + "docs": { + "$ref": "#/$defs/docs_config" + }, + "enabled": { + "$ref": "#/$defs/boolean_or_jinja_string" + }, + "grants": { + "$ref": "#/$defs/grants" + }, + "group": { + "$ref": "#/$defs/group" + }, + "invalidate_hard_deletes": { + "$ref": "#/$defs/invalidate_hard_deletes" + }, + "meta": { + "$ref": "#/$defs/meta" + }, + "persist_docs": { + "$ref": "#/$defs/persist_docs_config" + }, + "post-hook": { + "$ref": "#/$defs/array_of_strings" + }, + "pre-hook": { + "$ref": "#/$defs/array_of_strings" + }, + "quote_columns": { + "$ref": "#/$defs/boolean_or_jinja_string" + }, + "strategy": { + "$ref": "#/$defs/strategy" + }, + "tags": { + "$ref": "#/$defs/tags" + }, + "target_database": { + "$ref": "#/$defs/target_database" + }, + "target_schema": { + "$ref": "#/$defs/target_schema" + }, + "transient": { + "$ref": "#/$defs/boolean_or_jinja_string" + }, + "unique_key": { + "$ref": "#/$defs/string_or_array_of_strings" + }, + "updated_at": { + "$ref": "#/$defs/updated_at" + } + }, + "additionalProperties": { + "oneOf": [ + { + "$ref": "#/$defs/snapshot_configs" + }, + { + "$ref": "#/$defs/empty_directory" + } + ] + } + }, + "snowflake_warehouse": { + "type": "string" + }, + "source_configs": { + "title": "Source configs", + "type": "object", + "properties": { + "+enabled": { + "$ref": "#/$defs/boolean_or_jinja_string" + }, + "+meta": { + "$ref": "#/$defs/meta" + }, + "+tags": { + "$ref": "#/$defs/tags" + }, + "enabled": { + "$ref": "#/$defs/boolean_or_jinja_string" + }, + "meta": { + "$ref": "#/$defs/meta" + }, + "tags": { + "$ref": "#/$defs/tags" + } + }, + "additionalProperties": { + "oneOf": [ + { + "$ref": "#/$defs/source_configs" + }, + { + "$ref": "#/$defs/empty_directory" + } + ] + } + }, + "sql_header": { + "type": "string" + }, + "strategy": { + "type": "string" + }, + "string_or_array_of_strings": { + "oneOf": [ + { + "type": "string" + }, + { + "$ref": "#/$defs/array_of_strings" + } + ] + }, + "tags": { + "$ref": "#/$defs/string_or_array_of_strings" + }, + "target_database": { + "type": "string" + }, + "target_lag": { + "type": "string", + "pattern": "^(?:downstream|\\d+\\s*(?:seconds|minutes|hours|days))$" + }, + "target_schema": { + "type": "string" + }, + "unit_test_configs": { + "properties": { + "+meta": { + "$ref": "#/$defs/meta" + }, + "+tags": { + "$ref": "#/$defs/tags" + }, + "meta": { + "$ref": "#/$defs/meta" + }, + "tags": { + "$ref": "#/$defs/tags" + } + }, + "additionalProperties": { + "oneOf": [ + { + "$ref": "#/$defs/unit_test_configs" + }, + { + "$ref": "#/$defs/empty_directory" + } + ] + } + }, + "updated_at": { + "type": "string" + }, + "warn_if": { + "type": "string" + } + } +} \ No newline at end of file diff --git a/schemas/latest-originals/dbt_yml_files-latest.json b/schemas/latest-originals/dbt_yml_files-latest.json new file mode 100644 index 0000000..b8c757b --- /dev/null +++ b/schemas/latest-originals/dbt_yml_files-latest.json @@ -0,0 +1,1961 @@ +{ + "title": "dbt_yml_files", + "type": "object", + "$schema": "http://json-schema.org/draft-07/schema#", + "properties": { + "version": { + "type": "number", + "const": 2 + }, + "analyses": { + "type": "array", + "items": { + "type": "object", + "required": [ + "name" + ], + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "columns": { + "type": "array", + "items": { + "type": "object", + "required": [ + "name" + ], + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "data_type": { + "type": "string" + } + }, + "additionalProperties": false + } + }, + "config": { + "type": "object", + "properties": { + "tags": { + "$ref": "#/$defs/string_or_array_of_strings" + } + }, + "additionalProperties": false + }, + "docs": { + "$ref": "#/$defs/docs_config" + }, + "group": { + "$ref": "#/$defs/group_name" + } + } + } + }, + "exposures": { + "type": "array", + "items": { + "type": "object", + "required": [ + "depends_on", + "name", + "owner", + "type" + ], + "$comment": "NB: depends_on is not strictly required, but is _expected_ according to the documentation", + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "dashboard", + "notebook", + "analysis", + "ml", + "application" + ] + }, + "depends_on": { + "type": "array", + "items": { + "type": "string" + } + }, + "label": { + "type": "string", + "$comment": "Added in dbt Core v1.3" + }, + "maturity": { + "type": "string", + "enum": [ + "high", + "medium", + "low" + ] + }, + "meta": { + "type": "object" + }, + "owner": { + "$ref": "#/$defs/owner" + }, + "tags": { + "$ref": "#/$defs/string_or_array_of_strings" + }, + "url": { + "type": "string" + } + } + } + }, + "groups": { + "type": "array", + "items": { + "type": "object", + "required": [ + "name", + "owner" + ], + "properties": { + "name": { + "type": "string" + }, + "owner": { + "$ref": "#/$defs/owner" + } + }, + "additionalProperties": false + } + }, + "macros": { + "type": "array", + "items": { + "type": "object", + "required": [ + "name" + ], + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "arguments": { + "type": "array", + "items": { + "type": "object", + "required": [ + "name" + ], + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "type": { + "type": "string" + } + }, + "additionalProperties": false + } + }, + "docs": { + "$ref": "#/$defs/docs_config" + } + }, + "additionalProperties": false + } + }, + "metrics": { + "type": "array", + "items": { + "type": "object", + "required": [ + "name", + "label", + "type", + "type_params" + ], + "if": { + "properties": { + "type": { + "enum": [ + "SIMPLE", + "simple" + ] + } + } + }, + "then": { + "properties": { + "type_params": { + "$ref": "#/$defs/simple_metric_type_params" + } + } + }, + "else": { + "if": { + "properties": { + "type": { + "enum": [ + "derived", + "DERIVED" + ] + } + } + }, + "then": { + "properties": { + "type_params": { + "$ref": "#/$defs/derived_metric_type_params" + } + } + }, + "else": { + "if": { + "properties": { + "type": { + "enum": [ + "cumulative", + "CUMULATIVE" + ] + } + } + }, + "then": { + "properties": { + "type_params": { + "$ref": "#/$defs/cumulative_metric_type_params" + } + } + }, + "else": { + "if": { + "properties": { + "type": { + "enum": [ + "conversion", + "CONVERSION" + ] + } + } + }, + "then": { + "properties": { + "type_params": { + "$ref": "#/$defs/conversion_metric_type_params" + } + } + }, + "else": { + "if": { + "properties": { + "type": { + "enum": [ + "ratio", + "RATIO" + ] + } + } + }, + "then": { + "properties": { + "type_params": { + "$ref": "#/$defs/ratio_metric_type_params" + } + } + } + } + } + } + }, + "properties": { + "name": { + "type": "string", + "pattern": "(?!.*__).*^[a-z][a-z0-9_]*[a-z0-9]$" + }, + "description": { + "type": "string" + }, + "type": { + "title": "Metric Type", + "enum": [ + "SIMPLE", + "RATIO", + "CUMULATIVE", + "DERIVED", + "CONVERSION", + "simple", + "ratio", + "cumulative", + "derived", + "conversion" + ] + }, + "filter": { + "type": "string" + }, + "group": { + "$ref": "#/$defs/group_name" + }, + "label": { + "type": "string" + }, + "type_params": { + "type": "object" + } + }, + "additionalProperties": false + } + }, + "models": { + "type": "array", + "items": { + "type": "object", + "required": [ + "name" + ], + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "access": { + "type": "string", + "enum": [ + "private", + "protected", + "public" + ] + }, + "columns": { + "type": "array", + "items": { + "$ref": "#/$defs/column_properties" + } + }, + "config": { + "$ref": "#/$defs/model_configs" + }, + "constraints": { + "$ref": "#/$defs/constraints" + }, + "data_tests": { + "type": "array", + "items": { + "$ref": "#/$defs/data_tests" + } + }, + "deprecation_date": { + "type": "string" + }, + "docs": { + "$ref": "#/$defs/docs_config" + }, + "group": { + "$ref": "#/$defs/group_name" + }, + "latest_version": { + "type": "number" + }, + "meta": { + "type": "object" + }, + "tests": { + "type": "array", + "items": { + "$ref": "#/$defs/data_tests" + } + }, + "versions": { + "type": "array", + "items": { + "type": "object", + "required": [ + "v" + ], + "properties": { + "columns": { + "type": "array", + "items": { + "anyOf": [ + { + "$ref": "#/$defs/include_exclude" + }, + { + "$ref": "#/$defs/column_properties" + } + ] + } + }, + "config": { + "$ref": "#/$defs/model_configs" + }, + "v": { + "type": "number" + } + } + } + } + }, + "additionalProperties": false + } + }, + "saved_queries": { + "type": "array", + "items": { + "type": "object", + "required": [ + "name", + "description", + "label", + "query_params" + ], + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "exports": { + "type": "array", + "items": { + "$ref": "#/$defs/export" + } + }, + "label": { + "type": "string" + }, + "query_params": { + "type": "object", + "properties": { + "dimensions": { + "$ref": "#/$defs/array_of_strings" + }, + "metrics": { + "$ref": "#/$defs/array_of_strings" + }, + "where": { + "$ref": "#/$defs/array_of_strings" + }, + "additionalProperties": false + } + } + }, + "additionalProperties": false + } + }, + "seeds": { + "type": "array", + "items": { + "type": "object", + "required": [ + "name" + ], + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "columns": { + "type": "array", + "items": { + "$ref": "#/$defs/column_properties" + } + }, + "config": { + "title": "Seed Config", + "type": "object", + "properties": { + "column_types": { + "type": "object" + }, + "copy_grants": { + "$ref": "#/$defs/boolean_or_jinja_string" + }, + "data_tests": { + "type": "array", + "items": { + "$ref": "#/$defs/data_tests" + } + }, + "database": { + "type": "string" + }, + "enabled": { + "$ref": "#/$defs/boolean_or_jinja_string" + }, + "grants": { + "$ref": "#/$defs/grants" + }, + "quote_columns": { + "$ref": "#/$defs/boolean_or_jinja_string" + }, + "schema": { + "type": "string" + } + } + }, + "docs": { + "$ref": "#/$defs/docs_config" + }, + "group": { + "$ref": "#/$defs/group_name" + }, + "tests": { + "type": "array", + "items": { + "$ref": "#/$defs/data_tests" + } + } + }, + "additionalProperties": false + } + }, + "semantic_models": { + "type": "array", + "items": { + "type": "object", + "required": [ + "name", + "model" + ], + "properties": { + "name": { + "type": "string", + "pattern": "(?!.*__).*^[a-z][a-z0-9_]*[a-z0-9]$" + }, + "description": { + "type": "string" + }, + "defaults": { + "type": "object", + "properties": { + "agg_time_dimension": { + "type": "string" + } + }, + "additionalProperties": false + }, + "dimensions": { + "type": "array", + "items": { + "$ref": "#/$defs/dimension" + } + }, + "entities": { + "type": "array", + "items": { + "$ref": "#/$defs/entity" + } + }, + "measures": { + "type": "array", + "items": { + "$ref": "#/$defs/measure" + } + }, + "model": { + "type": "string", + "default": "ref('')" + }, + "primary_entity": { + "type": "string" + } + }, + "additionalProperties": false + } + }, + "snapshots": { + "type": "array", + "items": { + "type": "object", + "required": [ + "name" + ], + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "columns": { + "type": "array", + "items": { + "$ref": "#/$defs/column_properties" + } + }, + "config": { + "title": "Snapshot Config", + "type": "object", + "properties": { + "alias": { + "type": "string" + }, + "check_cols": { + "$ref": "#/$defs/string_or_array_of_strings" + }, + "enabled": { + "$ref": "#/$defs/boolean_or_jinja_string" + }, + "grants": { + "$ref": "#/$defs/grants" + }, + "persist_docs": { + "$ref": "#/$defs/persist_docs_config" + }, + "post-hook": { + "$ref": "#/$defs/array_of_strings" + }, + "pre-hook": { + "$ref": "#/$defs/array_of_strings" + }, + "quote_columns": { + "$ref": "#/$defs/boolean_or_jinja_string" + }, + "strategy": { + "type": "string" + }, + "tags": { + "$ref": "#/$defs/string_or_array_of_strings" + }, + "target_database": { + "type": "string" + }, + "target_schema": { + "type": "string" + }, + "unique_key": { + "$ref": "#/$defs/string_or_array_of_strings" + }, + "updated_at": { + "type": "string" + } + } + }, + "data_tests": { + "type": "array", + "items": { + "$ref": "#/$defs/data_tests" + } + }, + "docs": { + "$ref": "#/$defs/docs_config" + }, + "group": { + "$ref": "#/$defs/group_name" + }, + "meta": { + "type": "object" + }, + "tests": { + "type": "array", + "items": { + "$ref": "#/$defs/data_tests" + } + } + }, + "additionalProperties": false + } + }, + "sources": { + "type": "array", + "items": { + "type": "object", + "required": [ + "name" + ], + "properties": { + "name": { + "description": "How you will identify the schema in {{ source() }} calls. Unless `schema` is also set, this will be the name of the schema in the database.", + "type": "string" + }, + "description": { + "type": "string" + }, + "config": { + "type": "object" + }, + "data_tests": { + "type": "array", + "items": { + "$ref": "#/$defs/data_tests" + } + }, + "database": { + "type": "string" + }, + "freshness": { + "$ref": "#/$defs/freshness_definition" + }, + "loaded_at_field": { + "type": "string" + }, + "loader": { + "type": "string" + }, + "meta": { + "type": "object" + }, + "overrides": { + "title": "Package to Override", + "description": "The name of another package installed in your project. If that package has a source with the same name as this one, its properties will be applied on top of the base properties of the overridden source. https://docs.getdbt.com/reference/resource-properties/overrides", + "type": "string" + }, + "quoting": { + "type": "object", + "properties": { + "database": { + "$ref": "#/$defs/boolean_or_jinja_string" + }, + "identifier": { + "$ref": "#/$defs/boolean_or_jinja_string" + }, + "schema": { + "$ref": "#/$defs/boolean_or_jinja_string" + } + }, + "additionalProperties": false + }, + "schema": { + "description": "The schema name as stored in the database. Only needed if you want to use a different `name` than what exists in the database (otherwise `name` is used by default)", + "type": "string" + }, + "tables": { + "type": "array", + "items": { + "type": "object", + "required": [ + "name" + ], + "properties": { + "name": { + "title": "Name", + "description": "How you will identify the table in {{ source() }} calls. Unless `identifier` is also set, this will be the name of the table in the database.", + "type": "string" + }, + "description": { + "type": "string" + }, + "columns": { + "type": "array", + "items": { + "$ref": "#/$defs/column_properties" + } + }, + "external": { + "type": "object" + }, + "freshness": { + "$ref": "#/$defs/freshness_definition" + }, + "identifier": { + "title": "Identifier", + "description": "The table name as stored in the database. Only needed if you want to give the source a different name than what exists in the database (otherwise `name` is used by default)", + "type": "string" + }, + "loaded_at_field": { + "description": "Which column to check during data freshness tests. Only needed if the table has a different loaded_at_field to the one defined on the source overall.", + "type": "string" + }, + "loader": { + "type": "string" + }, + "meta": { + "type": "object" + }, + "quoting": { + "type": "object", + "properties": { + "database": { + "$ref": "#/$defs/boolean_or_jinja_string" + }, + "identifier": { + "$ref": "#/$defs/boolean_or_jinja_string" + }, + "schema": { + "$ref": "#/$defs/boolean_or_jinja_string" + } + }, + "additionalProperties": false + }, + "tags": { + "$ref": "#/$defs/string_or_array_of_strings" + }, + "tests": { + "type": "array", + "items": { + "$ref": "#/$defs/data_tests" + } + } + }, + "additionalProperties": false + } + }, + "tags": { + "$ref": "#/$defs/string_or_array_of_strings" + }, + "tests": { + "type": "array", + "items": { + "$ref": "#/$defs/data_tests" + } + } + } + } + }, + "unit_tests": { + "type": "array", + "items": { + "type": "object", + "required": [ + "name", + "model", + "expect" + ], + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "config": { + "title": "Unit Test Config", + "type": "object", + "properties": { + "meta": { + "type": "object" + }, + "tags": { + "$ref": "#/$defs/string_or_array_of_strings" + } + }, + "additionalProperties": false + }, + "expect": { + "type": "object", + "if": { + "properties": { + "format": { + "const": "dict" + } + } + }, + "then": { + "properties": { + "rows": { + "description": "When `format` is `dict`, each item should be a dictionary containing a key-value pair for each column and its value, e.g. `{id: 1, code: 'ABC'}`", + "type": "array", + "items": { + "type": "object" + } + } + } + }, + "else": { + "properties": { + "rows": { + "description": "When `format` is csv or sql, a string containing comma-separated headers and values. Alternatively provide a fixture. Use the pipe character | to create a multi-line string in YAML.", + "type": "string" + } + } + }, + "properties": { + "fixture": { + "description": "Only relevant when format is csv. Specify the name of a fixture instead of providing `rows`.", + "type": "string" + }, + "format": { + "description": "Defaults to `dict` when not specified", + "type": "string", + "enum": [ + "csv", + "dict", + "sql" + ] + }, + "additionalProperties": false + } + }, + "given": { + "type": "array", + "items": { + "type": "object", + "if": { + "properties": { + "format": { + "const": "dict" + } + } + }, + "then": { + "properties": { + "rows": { + "description": "When `format` is `dict`, each item should be a dictionary containing a key-value pair for each column and its value, e.g. `{id: 1, code: 'ABC'}`", + "type": "array", + "items": { + "type": "object" + } + } + } + }, + "else": { + "properties": { + "rows": { + "description": "When `format` is csv or sql, a string containing comma-separated headers and values. Alternatively provide a fixture. Use the pipe character | to create a multi-line string in YAML.", + "type": "string" + } + } + }, + "properties": { + "fixture": { + "description": "Only relevant when format is csv. Specify the name of a fixture instead of providing `rows`.", + "type": "string" + }, + "format": { + "description": "Defaults to `dict` when not specified", + "type": "string", + "enum": [ + "csv", + "dict", + "sql" + ] + }, + "input": { + "description": "The relation whose inputs you need to mock. Enclose in ref or source without curly braces", + "type": "string", + "examples": [ + "ref('model_b')", + "ref('upstream_project', 'model_b')", + "source('schema', 'table')" + ] + }, + "additionalProperties": false + } + } + }, + "model": { + "description": "The name of the model whose behaviour you are testing. Does not need to be wrapped in a ref.", + "type": "string", + "examples": [ + "my_model" + ] + }, + "overrides": { + "type": "object", + "properties": { + "env_vars": { + "type": "object" + }, + "macros": { + "type": "object", + "examples": [ + { + "is_incremental": "true" + } + ] + }, + "vars": { + "type": "object" + } + }, + "additionalProperties": false + }, + "additionalProperties": false + }, + "additionalProperties": false + } + } + }, + "additionalProperties": false, + "$defs": { + "aggregation_type_params": { + "type": "object", + "properties": { + "percentile": { + "type": "number" + }, + "use_approximate_percentile": { + "type": "boolean" + }, + "use_discrete_percentile": { + "type": "boolean" + } + }, + "additionalProperties": false + }, + "array_of_strings": { + "type": "array", + "items": { + "type": "string" + } + }, + "boolean_or_jinja_string": { + "oneOf": [ + { + "$ref": "#/$defs/jinja_string" + }, + { + "type": "boolean" + } + ], + "additionalProperties": false + }, + "column_properties": { + "type": "object", + "required": [ + "name" + ], + "uniqueItems": true, + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "constraints": { + "$ref": "#/$defs/constraints" + }, + "data_tests": { + "type": "array", + "items": { + "$ref": "#/$defs/data_tests" + } + }, + "data_type": { + "type": "string" + }, + "meta": { + "type": "object" + }, + "policy_tags": { + "title": "Policy tags", + "description": "Configurations, specific to BigQuery adapter, used to set policy tags on specific columns, enabling column-level security. Only relevant when `persist_docs.columns` is true.", + "type": "array", + "items": { + "type": "string" + } + }, + "quote": { + "$ref": "#/$defs/boolean_or_jinja_string" + }, + "tags": { + "$ref": "#/$defs/string_or_array_of_strings" + }, + "tests": { + "type": "array", + "items": { + "$ref": "#/$defs/data_tests" + } + } + }, + "additionalProperties": false + }, + "constraints": { + "type": "array", + "items": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "name": { + "type": "string" + }, + "type": { + "type": "string" + }, + "columns": { + "$ref": "#/$defs/string_or_array_of_strings" + }, + "expression": { + "type": "string" + }, + "warn_unenforced": { + "$ref": "#/$defs/boolean_or_jinja_string" + }, + "warn_unsupported": { + "$ref": "#/$defs/boolean_or_jinja_string" + } + } + } + }, + "conversion_metric_type_params": { + "type": "object", + "properties": { + "conversion_type_params": { + "type": "object", + "required": [ + "entity", + "base_measure", + "conversion_measure" + ], + "properties": { + "base_measure": { + "$ref": "#/$defs/metric_input_measure" + }, + "calculation": { + "type": "string", + "default": "conversion_rate", + "enum": [ + "conversions", + "conversion_rate", + "CONVERSIONS", + "CONVERSION_RATE" + ] + }, + "constant_properties": { + "type": "array", + "items": { + "type": "object", + "required": [ + "base_property", + "conversion_property" + ], + "properties": { + "base_property": { + "description": "DIMENSION or ENTITY", + "type": "string" + }, + "conversion_property": { + "description": "DIMENSION or ENTITY", + "type": "string" + } + } + } + }, + "conversion_measure": { + "$ref": "#/$defs/metric_input_measure" + }, + "entity": { + "description": "The entity to calculate over", + "type": "string" + }, + "window": { + "type": "string" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + "cumulative_metric_type_params": { + "type": "object", + "properties": { + "grain_to_date": { + "enum": [ + "day", + "week", + "month", + "quarter", + "year" + ] + }, + "measure": { + "$ref": "#/$defs/metric_input_measure" + }, + "window": { + "type": "string" + } + }, + "additionalProperties": false + }, + "data_tests": { + "anyOf": [ + { + "type": "string" + }, + { + "title": "Relationships Test", + "type": "object", + "properties": { + "relationships": { + "type": "object", + "required": [ + "to", + "field" + ], + "properties": { + "name": { + "type": "string" + }, + "config": { + "$ref": "#/$defs/test_configs" + }, + "field": { + "title": "Relationships: Field", + "description": "The foreign key column", + "type": "string", + "default": "" + }, + "to": { + "type": "string", + "default": "ref('')", + "examples": [ + "ref('parent_model')", + "source('parent_schema', 'parent_table')" + ] + }, + "where": { + "type": "string" + } + } + } + } + }, + { + "title": "Accepted Values Test", + "type": "object", + "properties": { + "accepted_values": { + "type": "object", + "required": [ + "values" + ], + "properties": { + "name": { + "type": "string" + }, + "config": { + "$ref": "#/$defs/test_configs" + }, + "quote": { + "type": "boolean" + }, + "values": { + "type": "array", + "items": { + "type": "string" + } + }, + "where": { + "type": "string" + } + } + } + } + }, + { + "title": "Not Null Test", + "type": "object", + "properties": { + "not_null": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "config": { + "$ref": "#/$defs/test_configs" + }, + "where": { + "type": "string" + } + } + } + } + }, + { + "title": "Unique Test", + "type": "object", + "properties": { + "unique": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "config": { + "$ref": "#/$defs/test_configs" + }, + "where": { + "type": "string" + } + } + } + } + } + ] + }, + "derived_metric_type_params": { + "type": "object", + "properties": { + "expr": { + "type": "string" + }, + "metrics": { + "type": "array", + "items": { + "$ref": "#/$defs/metric_input_schema" + } + } + }, + "additionalProperties": false + }, + "dimension": { + "type": "object", + "required": [ + "name", + "type" + ], + "anyOf": [ + { + "not": { + "$ref": "#/$defs/is-time-dimension" + } + }, + { + "required": [ + "type_params" + ] + } + ], + "properties": { + "name": { + "type": "string", + "pattern": "(?!.*__).*^[a-z][a-z0-9_]*[a-z0-9]$" + }, + "description": { + "type": "string" + }, + "type": { + "title": "Dimension Type", + "enum": [ + "CATEGORICAL", + "TIME", + "categorical", + "time" + ] + }, + "expr": { + "type": [ + "string", + "boolean" + ] + }, + "is_partition": { + "type": "boolean" + }, + "type_params": { + "$ref": "#/$defs/dimension_type_params" + } + }, + "additionalProperties": false + }, + "dimension_type_params": { + "type": "object", + "required": [ + "time_granularity" + ], + "properties": { + "time_granularity": { + "enum": [ + "DAY", + "WEEK", + "MONTH", + "QUARTER", + "YEAR", + "day", + "week", + "month", + "quarter", + "year" + ] + }, + "validity_params": { + "$ref": "#/$defs/validity_params" + } + }, + "additionalProperties": false + }, + "docs_config": { + "title": "Docs config", + "description": "Configurations for the appearance of nodes in the dbt documentation.", + "type": "object", + "properties": { + "node_color": { + "description": "The color of the node on the DAG in the documentation. It must be an Hex code or a valid CSS color name.", + "type": "string", + "pattern": "^(#[a-fA-F0-9]{3}|#[a-fA-F0-9]{6}|[^#][a-zA-Z]*)$" + }, + "show": { + "type": "boolean", + "default": true + } + }, + "additionalProperties": false + }, + "entity": { + "type": "object", + "required": [ + "name", + "type" + ], + "properties": { + "name": { + "type": "string", + "pattern": "(?!.*__).*^[a-z][a-z0-9_]*[a-z0-9]$" + }, + "type": { + "title": "Entity Type", + "enum": [ + "PRIMARY", + "UNIQUE", + "FOREIGN", + "NATURAL", + "primary", + "unique", + "foreign", + "natural" + ] + }, + "entity": { + "type": "string" + }, + "expr": { + "type": [ + "string", + "boolean" + ] + } + }, + "additionalProperties": false + }, + "export": { + "type": "object", + "required": [ + "name" + ], + "properties": { + "name": { + "type": "string" + }, + "config": { + "title": "Export Config", + "type": "object", + "properties": { + "alias": { + "type": "string" + }, + "export_as": { + "enum": [ + "table", + "view", + "cache" + ] + }, + "schema": { + "type": "string" + } + }, + "additionalProperties": true + } + }, + "additionalProperties": false + }, + "freshness_definition": { + "default": { + "error_after": { + "count": 2, + "period": "day" + }, + "warn_after": { + "count": 1, + "period": "day" + } + }, + "oneOf": [ + { + "type": "object", + "properties": { + "error_after": { + "$ref": "#/$defs/freshness_rules" + }, + "filter": { + "type": "string" + }, + "warn_after": { + "$ref": "#/$defs/freshness_rules" + } + }, + "additionalProperties": false + }, + { + "const": null + } + ] + }, + "freshness_rules": { + "type": "object", + "required": [ + "count", + "period" + ], + "properties": { + "count": { + "$ref": "#/$defs/number_or_jinja_string" + }, + "period": { + "type": "string", + "enum": [ + "minute", + "hour", + "day" + ] + } + }, + "additionalProperties": false + }, + "grants": { + "description": "grant config. each key is a database permission and the value is the grantee of that permission", + "type": "object", + "patternProperties": { + ".*": { + "$ref": "#/$defs/string_or_array_of_strings" + } + }, + "additionalProperties": false + }, + "group_name": { + "type": "string" + }, + "include_exclude": { + "type": "object", + "properties": { + "exclude": { + "$ref": "#/$defs/string_or_array_of_strings" + }, + "include": { + "$ref": "#/$defs/string_or_array_of_strings" + } + } + }, + "is-time-dimension": { + "required": [ + "type" + ], + "properties": { + "type": { + "enum": [ + "TIME", + "time" + ] + } + } + }, + "jinja_string": { + "type": "string", + "pattern": "\\{\\{.*\\}\\}" + }, + "measure": { + "type": "object", + "required": [ + "name", + "agg" + ], + "properties": { + "name": { + "type": "string", + "pattern": "(?!.*__).*^[a-z][a-z0-9_]*[a-z0-9]$" + }, + "description": { + "type": "string" + }, + "agg": { + "enum": [ + "SUM", + "MIN", + "MAX", + "AVG", + "COUNT_DISTINCT", + "SUM_BOOLEAN", + "COUNT", + "PERCENTILE", + "MEDIAN", + "sum", + "min", + "max", + "avg", + "count_distinct", + "sum_boolean", + "count", + "percentile", + "median" + ] + }, + "agg_params": { + "$ref": "#/$defs/aggregation_type_params" + }, + "agg_time_dimension": { + "type": "string", + "pattern": "(?!.*__).*^[a-z][a-z0-9_]*[a-z0-9]$" + }, + "create_metric": { + "type": "boolean" + }, + "create_metric_display_name": { + "type": "string" + }, + "expr": { + "type": [ + "string", + "integer", + "boolean" + ] + }, + "label": { + "type": "string" + }, + "non_additive_dimension": { + "$ref": "#/$defs/non_additive_dimension" + } + }, + "additionalProperties": false + }, + "metric_input_measure": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "fill_nulls_with": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "integer" + } + ] + }, + "filter": { + "type": "string" + }, + "join_to_timespine": { + "type": "boolean" + } + }, + "additionalProperties": false + }, + "metric_input_schema": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "alias": { + "type": "string" + }, + "filter": { + "type": "string" + }, + "offset_window": { + "type": "string" + } + }, + "additionalProperties": false + }, + "model_configs": { + "type": "object", + "properties": { + "auto_refresh": { + "$ref": "#/$defs/boolean_or_jinja_string" + }, + "backup": { + "$ref": "#/$defs/boolean_or_jinja_string" + }, + "contract": { + "type": "object", + "properties": { + "enforced": { + "$ref": "#/$defs/boolean_or_jinja_string" + } + } + }, + "file_format": { + "type": "string" + }, + "grant_access_to": { + "title": "Authorized views", + "description": "Configuration, specific to BigQuery adapter, used to setup authorized views.", + "type": "array", + "items": { + "type": "object", + "required": [ + "database", + "project" + ], + "properties": { + "database": { + "type": "string" + }, + "project": { + "type": "string" + } + }, + "additionalProperties": false + } + }, + "grants": { + "$ref": "#/$defs/grants" + }, + "hours_to_expiration": { + "description": "Configuration specific to BigQuery adapter used to set an expiration delay (in hours) to a table.", + "type": "number" + }, + "kms_key_name": { + "description": "Configuration of the KMS key name, specific to BigQuery adapter.", + "type": "string", + "pattern": "projects/[a-zA-Z0-9_-]*/locations/[a-zA-Z0-9_-]*/keyRings/.*/cryptoKeys/.*" + }, + "labels": { + "title": "Label configs", + "description": "Configuration specific to BigQuery adapter used to add labels and tags to tables/views created by dbt.", + "type": "object", + "patternProperties": { + "^[a-z][a-z0-9_-]{0,62}$": { + "type": "string", + "pattern": "^[a-z0-9_-]{0,63}$" + } + }, + "additionalProperties": false + }, + "location": { + "type": "string" + }, + "materialized": { + "type": "string" + }, + "on_configuration_change": { + "type": "string", + "enum": [ + "apply", + "continue", + "fail" + ] + }, + "on_schema_change": { + "type": "string", + "enum": [ + "append_new_columns", + "fail", + "ignore", + "sync_all_columns" + ] + }, + "snowflake_warehouse": { + "type": "string" + }, + "sql_header": { + "type": "string" + }, + "target_lag": { + "type": "string", + "pattern": "^(?:downstream|\\d+\\s*(?:seconds|minutes|hours|days))$" + } + } + }, + "owner": { + "type": "object", + "anyOf": [ + { + "required": [ + "email" + ] + }, + { + "required": [ + "name" + ] + } + ], + "properties": { + "name": { + "type": "string" + }, + "email": { + "type": "string" + } + }, + "additionalProperties": false + }, + "non_additive_dimension": { + "type": "object", + "required": [ + "name" + ], + "properties": { + "name": { + "type": "string" + }, + "window_choice": { + "enum": [ + "MIN", + "MAX", + "min", + "max" + ] + }, + "window_groupings": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false + }, + "number_or_jinja_string": { + "oneOf": [ + { + "$ref": "#/$defs/jinja_string" + }, + { + "type": "number" + } + ], + "additionalProperties": false + }, + "persist_docs_config": { + "title": "Persist docs config", + "description": "Configurations for the persistence of the dbt documentation.", + "type": "object", + "properties": { + "columns": { + "$ref": "#/$defs/boolean_or_jinja_string", + "default": true + }, + "relation": { + "$ref": "#/$defs/boolean_or_jinja_string", + "default": true + } + }, + "additionalProperties": false + }, + "ratio_metric_type_params": { + "type": "object", + "properties": { + "denominator": { + "$ref": "#/$defs/metric_input_schema" + }, + "filter": { + "type": "string" + }, + "numerator": { + "$ref": "#/$defs/metric_input_schema" + } + }, + "additionalProperties": false + }, + "simple_metric_type_params": { + "type": "object", + "properties": { + "measure": { + "$ref": "#/$defs/metric_input_measure" + } + }, + "additionalProperties": false + }, + "string_or_array_of_strings": { + "oneOf": [ + { + "type": "string" + }, + { + "$ref": "#/$defs/array_of_strings" + } + ] + }, + "test_configs": { + "title": "Test configs", + "description": "Configurations set here will override configs set in dbt_project.yml.", + "type": "object", + "properties": { + "alias": { + "description": "Only relevant when `store_failures` is true", + "type": "string" + }, + "database": { + "description": "Only relevant when `store_failures` is true", + "type": "string" + }, + "enabled": { + "$ref": "#/$defs/boolean_or_jinja_string" + }, + "error_if": { + "type": "string" + }, + "fail_calc": { + "type": "string" + }, + "limit": { + "type": "number" + }, + "schema": { + "description": "Only relevant when `store_failures` is true", + "type": "string" + }, + "severity": { + "oneOf": [ + { + "$ref": "#/$defs/jinja_string" + }, + { + "type": "string", + "enum": [ + "warn", + "error" + ] + } + ] + }, + "store_failures": { + "$ref": "#/$defs/boolean_or_jinja_string" + }, + "tags": { + "$ref": "#/$defs/string_or_array_of_strings" + }, + "warn_if": { + "type": "string" + } + } + }, + "validity_params": { + "type": "object", + "properties": { + "is_end": { + "type": "boolean" + }, + "is_start": { + "type": "boolean" + } + }, + "additionalProperties": false + } + } +} \ No newline at end of file diff --git a/schemas/latest-originals/dependencies-latest.json b/schemas/latest-originals/dependencies-latest.json new file mode 100644 index 0000000..b17802a --- /dev/null +++ b/schemas/latest-originals/dependencies-latest.json @@ -0,0 +1,83 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "object", + "title": "dependencies", + "properties": { + "projects": { + "type": "array", + "items": { + "type": "object", + "required": ["name"], + "properties": { + "name": { + "type": "string" + } + }, + "additionalProperties": false + } + }, + "packages": { + "type": "array", + "items": { + "anyOf": [ + { + "type": "object", + "required": ["package", "version"], + "properties": { + "version": { + "title": "Package version", + "type": ["string", "number", "array"], + "description": "A semantic version string or range, such as [\">=1.0.0\", \"<2.0.0\"]" + }, + "install-prerelease": { + "title": "Install Prerelease", + "type": "boolean", + "description": "Opt in to prerelease versions of a package" + }, + "package": { + "title": "Package identifier", + "type": "string", + "description": "Must be in format `org_name/package_name`. Refer to hub.getdbt.com for installation instructions", + "examples": ["dbt-labs/dbt_utils"], + "pattern": "^[\\w\\-\\.]+/[\\w\\-\\.]+$" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": ["git"], + "properties": { + "git": { + "title": "Git URL", + "type": "string" + }, + "revision": { + "title": "Revision", + "type": "string", + "description": "Pin your package to a specific release by specifying a release name" + }, + "subdirectory": { + "title": "Subdirectory", + "type": "string", + "description": "Only required if the package is nested in a subdirectory of the git project" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "local": { + "type": "string" + } + }, + "additionalProperties": false + } + ] + }, + "minItems": 1 + } + }, + "additionalProperties": false +} diff --git a/schemas/latest-originals/packages-latest.json b/schemas/latest-originals/packages-latest.json new file mode 100644 index 0000000..86cc8a9 --- /dev/null +++ b/schemas/latest-originals/packages-latest.json @@ -0,0 +1,84 @@ +{ + "title": "packages", + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "object", + "required": [ + "packages" + ], + "properties": { + "packages": { + "type": "array", + "items": { + "anyOf": [ + { + "type": "object", + "required": [ + "package", + "version" + ], + "properties": { + "version": { + "title": "Package version", + "type": [ + "string", + "number", + "array" + ], + "description": "A semantic version string or range, such as [\">=1.0.0\", \"<2.0.0\"]" + }, + "install-prerelease": { + "title": "Install Prerelease", + "type": "boolean", + "description": "Opt in to prerelease versions of a package" + }, + "package": { + "title": "Package identifier", + "type": "string", + "description": "Must be in format `org_name/package_name`. Refer to hub.getdbt.com for installation instructions", + "examples": [ + "dbt-labs/dbt_utils" + ], + "pattern": "^[\\w\\-\\.]+/[\\w\\-\\.]+$" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "git" + ], + "properties": { + "git": { + "title": "Git URL", + "type": "string" + }, + "revision": { + "title": "Revision", + "type": "string", + "description": "Pin your package to a specific release by specifying a release name" + }, + "subdirectory": { + "title": "Subdirectory", + "type": "string", + "description": "Only required if the package is nested in a subdirectory of the git project" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "local": { + "type": "string" + } + }, + "additionalProperties": false + } + ] + }, + "minItems": 1 + } + }, + "additionalProperties": false +} diff --git a/schemas/latest-originals/selectors-latest.json b/schemas/latest-originals/selectors-latest.json new file mode 100644 index 0000000..7c818d7 --- /dev/null +++ b/schemas/latest-originals/selectors-latest.json @@ -0,0 +1,153 @@ +{ + "title": "selectors", + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "object", + "required": [ + "selectors" + ], + "properties": { + "selectors": { + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "default": { + "oneOf": [ + { + "type": "string", + "pattern": "\\{\\{.*\\}\\}" + }, + { + "type": "boolean" + } + ], + "additionalProperties": false + }, + "definition": { + "oneOf": [ + { + "$ref": "#/$defs/definition_block" + }, + { + "type": "string" + }, + { + "$ref": "#/$defs/union_block" + } + ] + } + }, + "additionalProperties": false + }, + "minItems": 1 + } + }, + "additionalProperties": false, + "$defs": { + "boolean_or_jinja_string": { + "oneOf": [ + { + "$ref": "#/$defs/jinja_string" + }, + { + "type": "boolean" + } + ], + "additionalProperties": false + }, + "definition_block": { + "type": "object", + "properties": { + "method": { + "type": "string", + "enum": [ + "tag", + "source", + "path", + "file", + "fqn", + "package", + "config", + "test_type", + "test_name", + "state", + "exposure", + "metric", + "result", + "source_status", + "group", + "wildcard" + ] + }, + "value": { + "type": "string" + }, + "children": { + "$ref": "#/$defs/boolean_or_jinja_string" + }, + "parents": { + "$ref": "#/$defs/boolean_or_jinja_string" + }, + "children_depth": { + "type": "number" + }, + "parents_depth": { + "type": "number" + }, + "childrens_parents": { + "$ref": "#/$defs/boolean_or_jinja_string" + }, + "indirect_selection": { + "type": "string", + "enum": ["buildable", "cautious", "eager"] + } + }, + "additionalProperties": true + }, + "exclude_block": { + "type": "array", + "items": { + "anyOf": [ + { + "$ref": "#/$defs/intersection_block" + }, + { + "$ref": "#/$defs/definition_block" + } + ] + } + }, + "intersection_block": { + "type": "array", + "items": { + "$ref": "#/$defs/definition_block" + } + }, + "jinja_string": { + "type": "string", + "pattern": "\\{\\{.*\\}\\}" + }, + "union_block": { + "type": "array", + "items": { + "anyOf": [ + { + "$ref": "#/$defs/intersection_block" + }, + { + "$ref": "#/$defs/definition_block" + }, + { + "$ref": "#/$defs/exclude_block" + } + ] + } + } + } +} diff --git a/schemas/latest/dbt_cloud-latest.json b/schemas/latest/dbt_cloud-latest.json index 70921f0..e024b8f 100644 --- a/schemas/latest/dbt_cloud-latest.json +++ b/schemas/latest/dbt_cloud-latest.json @@ -1,14 +1,23 @@ { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", + "additionalProperties": false, "properties": { "project-id": { + "title": "Project-Id", "type": "string" }, "defer-env-id": { - "type": "string" + "anyOf": [ + { + "type": "string" + } + ], + "default": null, + "title": "Defer-Env-Id" } }, - "required": ["project-id"], - "additionalProperties": false -} + "required": [ + "project-id" + ], + "title": "DbtCloud", + "type": "object" +} \ No newline at end of file diff --git a/schemas/latest/dbt_project-latest.json b/schemas/latest/dbt_project-latest.json index db6bdf0..96a43be 100644 --- a/schemas/latest/dbt_project-latest.json +++ b/schemas/latest/dbt_project-latest.json @@ -1,1112 +1,2329 @@ { - "title": "dbt_project", - "type": "object", - "required": [ - "name" - ], - "$schema": "http://json-schema.org/draft-07/schema#", - "properties": { - "version": { + "$defs": { + "Access": { + "enum": [ + "private", + "protected", + "public" + ], + "title": "Access", "type": "string" }, - "name": { + "Alias": { + "title": "Alias", "type": "string" }, - "analysis-paths": { - "$ref": "#/$defs/array_of_strings" - }, - "asset-paths": { - "$ref": "#/$defs/array_of_strings" - }, - "clean-targets": { - "$ref": "#/$defs/array_of_strings" - }, - "config-version": { - "type": "number", - "default": 2 - }, - "data_tests": { - "$ref": "#/$defs/data_test_configs" - }, - "dbt-cloud": { - "type": "object", - "properties": { - "project-id": { - "type": "number" - } - }, - "additionalProperties": true - }, - "dispatch": { - "type": "array", + "ArrayOfStrings": { "items": { - "type": "object", - "required": [ - "macro_namespace", - "search_order" - ], - "properties": { - "macro_namespace": { - "type": "string" - }, - "search_order": { - "$ref": "#/$defs/array_of_strings" - } - }, - "additionalProperties": false - } - }, - "docs-paths": { - "$ref": "#/$defs/array_of_strings" + "type": "string" + }, + "title": "ArrayOfStrings", + "type": "array" }, - "flags": { - "type": "object", + "AuthorizedView": { + "additionalProperties": false, "properties": { - "cache_selected_only": { - "type": "boolean" - }, - "debug": { - "type": "boolean" - }, - "fail_fast": { - "type": "boolean" - }, - "indirect_selection": { - "type": "string" - }, - "log_format": { - "type": "string" - }, - "log_format_file": { - "type": "string" - }, - "log_level": { - "type": "string" - }, - "log_level_file": { - "type": "string" - }, - "partial_parse": { - "type": "boolean" - }, - "populate_cache": { - "type": "boolean" - }, - "printer_width": { - "type": "integer" - }, - "require_explicit_package_overrides_for_builtin_materializations": { - "type": "boolean" - }, - "require_resource_names_without_spaces": { - "type": "boolean" - }, - "send_anonymous_usage_stats": { - "type": "boolean" - }, - "source_freshness_run_project_hooks": { - "type": "boolean" - }, - "static_parser": { - "type": "boolean" - }, - "use_colors": { - "type": "boolean" - }, - "use_colors_file": { - "type": "boolean" - }, - "use_experimental_parser": { - "type": "boolean" - }, - "version_check": { - "type": "boolean" - }, - "warn_error": { - "type": "boolean" - }, - "warn_error_options": { - "type": "object" + "database": { + "anyOf": [ + { + "type": "string" + } + ], + "default": null, + "title": "Database" }, - "write_json": { - "type": "boolean" + "project": { + "anyOf": [ + { + "type": "string" + } + ], + "default": null, + "title": "Project" } - } - }, - "log-path": { - "type": "string" - }, - "macro-paths": { - "$ref": "#/$defs/array_of_strings" - }, - "model-paths": { - "$ref": "#/$defs/array_of_strings" + }, + "title": "AuthorizedView", + "type": "object" }, - "models": { - "$ref": "#/$defs/model_configs" + "AuthorizedViews": { + "description": "Configuration, specific to BigQuery adapter, used to setup authorized views.", + "items": { + "$ref": "#/$defs/AuthorizedView" + }, + "title": "AuthorizedViews", + "type": "array" }, - "on-run-end": { - "anyOf": [ - { - "$ref": "#/$defs/array_of_strings" - }, + "AutoRefresh": { + "allOf": [ { - "type": "string" + "$ref": "#/$defs/BooleanOrJinjaString" } - ] + ], + "title": "AutoRefresh" }, - "on-run-start": { - "anyOf": [ + "Backup": { + "allOf": [ { - "$ref": "#/$defs/array_of_strings" - }, - { - "type": "string" + "$ref": "#/$defs/BooleanOrJinjaString" } - ] - }, - "packages-install-path": { - "type": "string" - }, - "profile": { - "type": "string" + ], + "title": "Backup" }, - "query-comment": { - "oneOf": [ + "BooleanOrJinjaString": { + "anyOf": [ { - "type": "string" + "$ref": "#/$defs/JinjaString" }, { - "type": "object", - "properties": { - "append": { - "$ref": "#/$defs/boolean_or_jinja_string" - }, - "comment": { - "type": "string" - }, - "job-label": { - "$ref": "#/$defs/boolean_or_jinja_string" - } - }, - "additionalProperties": false - } - ] - }, - "quoting": { - "type": "object", - "properties": { - "database": { - "$ref": "#/$defs/boolean_or_jinja_string" - }, - "identifier": { - "$ref": "#/$defs/boolean_or_jinja_string" - }, - "schema": { - "$ref": "#/$defs/boolean_or_jinja_string" + "type": "boolean" } - } - }, - "require-dbt-version": { - "$ref": "#/$defs/string_or_array_of_strings" - }, - "seed-paths": { - "$ref": "#/$defs/array_of_strings" - }, - "seeds": { - "$ref": "#/$defs/seed_configs" - }, - "snapshot-paths": { - "$ref": "#/$defs/array_of_strings" - }, - "snapshots": { - "$ref": "#/$defs/snapshot_configs" - }, - "sources": { - "$ref": "#/$defs/source_configs" - }, - "target-path": { - "type": "string" - }, - "test-paths": { - "$ref": "#/$defs/array_of_strings" - }, - "tests": { - "$ref": "#/$defs/data_test_configs" - }, - "unit_tests": { - "$ref": "#/$defs/unit_test_configs" - }, - "vars": { - "type": "object" - } - }, - "additionalProperties": false, - "$defs": { - "access": { - "type": "string", - "enum": [ - "private", - "protected", - "public" - ] - }, - "alias": { - "type": "string" + ], + "title": "BooleanOrJinjaString" }, - "array_of_strings": { - "type": "array", - "items": { + "ColumnTypes": { + "additionalProperties": { "type": "string" - } - }, - "auto_refresh": { - "$ref": "#/$defs/boolean_or_jinja_string" - }, - "backup": { - "$ref": "#/$defs/boolean_or_jinja_string" - }, - "boolean_or_jinja_string": { - "oneOf": [ - { - "$ref": "#/$defs/jinja_string" - }, - { - "type": "boolean" - } - ] + }, + "title": "ColumnTypes", + "type": "object" }, - "column_types": { - "type": "object", - "patternProperties": { - "": { - "type": "string" + "Contract": { + "properties": { + "enforced": { + "$ref": "#/$defs/BooleanOrJinjaString" } - } - }, - "contract": { - "type": "object", + }, "required": [ "enforced" ], - "properties": { - "enforced": { - "$ref": "#/$defs/boolean_or_jinja_string", - "default": "true" - } - } + "title": "Contract", + "type": "object" }, - "data_test_configs": { - "title": "Data test configs", - "description": "Configurations set in the dbt_project.yml file will apply to all tests that don't have a more specific configuration set.", - "type": "object", + "DataTestConfigs": { "properties": { "+alias": { - "$ref": "#/$defs/alias" + "anyOf": [ + { + "$ref": "#/$defs/Alias" + } + ], + "default": null }, "+database": { - "$ref": "#/$defs/database" + "anyOf": [ + { + "$ref": "#/$defs/Database" + } + ], + "default": null }, "+enabled": { - "$ref": "#/$defs/boolean_or_jinja_string" + "anyOf": [ + { + "$ref": "#/$defs/BooleanOrJinjaString" + } + ], + "default": null }, "+error_if": { - "$ref": "#/$defs/error_if" + "anyOf": [ + { + "$ref": "#/$defs/ErrorIf" + } + ], + "default": null }, "+fail_calc": { - "$ref": "#/$defs/fail_calc" + "anyOf": [ + { + "$ref": "#/$defs/FailCalc" + } + ], + "default": null }, "+group": { - "$ref": "#/$defs/group" + "anyOf": [ + { + "$ref": "#/$defs/Group" + } + ], + "default": null }, "+limit": { - "$ref": "#/$defs/limit" + "anyOf": [ + { + "$ref": "#/$defs/Limit" + } + ], + "default": null }, "+meta": { - "$ref": "#/$defs/meta" + "anyOf": [ + { + "$ref": "#/$defs/Meta" + } + ], + "default": null }, "+schema": { - "$ref": "#/$defs/schema" + "anyOf": [ + { + "$ref": "#/$defs/Schema" + } + ], + "default": null }, "+severity": { - "$ref": "#/$defs/severity" + "anyOf": [ + { + "$ref": "#/$defs/Severity" + } + ], + "default": null }, "+store_failures": { - "$ref": "#/$defs/boolean_or_jinja_string" + "anyOf": [ + { + "$ref": "#/$defs/BooleanOrJinjaString" + } + ], + "default": null }, "+tags": { - "$ref": "#/$defs/tags" + "anyOf": [ + { + "$ref": "#/$defs/Tags" + } + ], + "default": null }, "+warn_if": { - "$ref": "#/$defs/warn_if" + "anyOf": [ + { + "$ref": "#/$defs/WarnIf" + } + ], + "default": null }, "alias": { - "$ref": "#/$defs/alias" + "anyOf": [ + { + "$ref": "#/$defs/Alias" + } + ], + "default": null }, "database": { - "$ref": "#/$defs/database" + "anyOf": [ + { + "$ref": "#/$defs/Database" + } + ], + "default": null }, "enabled": { - "$ref": "#/$defs/boolean_or_jinja_string" + "anyOf": [ + { + "$ref": "#/$defs/BooleanOrJinjaString" + } + ], + "default": null }, "error_if": { - "$ref": "#/$defs/error_if" + "anyOf": [ + { + "$ref": "#/$defs/ErrorIf" + } + ], + "default": null }, "fail_calc": { - "$ref": "#/$defs/fail_calc" + "anyOf": [ + { + "$ref": "#/$defs/FailCalc" + } + ], + "default": null }, "group": { - "$ref": "#/$defs/group" + "anyOf": [ + { + "$ref": "#/$defs/Group" + } + ], + "default": null }, "limit": { - "$ref": "#/$defs/limit" + "anyOf": [ + { + "$ref": "#/$defs/Limit" + } + ], + "default": null }, "meta": { - "$ref": "#/$defs/meta" + "anyOf": [ + { + "$ref": "#/$defs/Meta" + } + ], + "default": null }, "schema": { - "$ref": "#/$defs/schema" + "anyOf": [ + { + "$ref": "#/$defs/Schema" + } + ], + "default": null }, "severity": { - "$ref": "#/$defs/severity" + "anyOf": [ + { + "$ref": "#/$defs/Severity" + } + ], + "default": null }, "store_failures": { - "$ref": "#/$defs/boolean_or_jinja_string" + "anyOf": [ + { + "$ref": "#/$defs/BooleanOrJinjaString" + } + ], + "default": null }, "tags": { - "$ref": "#/$defs/tags" + "anyOf": [ + { + "$ref": "#/$defs/Tags" + } + ], + "default": null }, "warn_if": { - "$ref": "#/$defs/warn_if" + "anyOf": [ + { + "$ref": "#/$defs/WarnIf" + } + ], + "default": null } }, - "additionalProperties": { - "oneOf": [ - { - "$ref": "#/$defs/data_test_configs" - }, - { - "$ref": "#/$defs/empty_directory" - } - ] - } + "title": "DataTestConfigs", + "type": "object" }, - "database": { + "Database": { + "title": "Database", "type": "string" }, - "docs_config": { - "title": "Docs config", - "description": "Configurations for the appearance of nodes in the dbt documentation.", - "type": "object", + "DbtCloud": { + "additionalProperties": true, + "properties": { + "project-id": { + "anyOf": [ + { + "type": "number" + } + ], + "default": null, + "title": "Project-Id" + } + }, + "title": "DbtCloud", + "type": "object" + }, + "DispatchItem": { + "additionalProperties": false, + "properties": { + "macro_namespace": { + "title": "Macro Namespace", + "type": "string" + }, + "search_order": { + "$ref": "#/$defs/ArrayOfStrings" + } + }, + "required": [ + "macro_namespace", + "search_order" + ], + "title": "DispatchItem", + "type": "object" + }, + "DocsConfig": { + "additionalProperties": false, "properties": { "node_color": { + "anyOf": [ + { + "pattern": "^(#[a-fA-F0-9]{3}|#[a-fA-F0-9]{6}|[^#][a-zA-Z]*)$", + "type": "string" + } + ], + "default": null, "description": "The color of the node on the DAG in the documentation. It must be an Hex code or a valid CSS color name.", - "type": "string", - "pattern": "^(#[a-fA-F0-9]{3}|#[a-fA-F0-9]{6}|[^#][a-zA-Z]*)$" + "title": "Node Color" }, "show": { - "type": "boolean", - "default": true + "anyOf": [ + { + "type": "boolean" + } + ], + "default": true, + "title": "Show" } }, - "additionalProperties": false - }, - "empty_directory": { - "type": "null" + "title": "DocsConfig", + "type": "object" }, - "error_if": { + "ErrorIf": { + "title": "ErrorIf", "type": "string" }, - "fail_calc": { + "FailCalc": { + "title": "FailCalc", "type": "string" }, - "file_format": { + "FileFormat": { + "title": "FileFormat", "type": "string" }, - "grant_access_to": { - "title": "Authorized views", - "description": "Configuration, specific to BigQuery adapter, used to setup authorized views.", - "type": "array", - "items": { - "type": "object", - "properties": { - "database": { - "type": "string" - }, - "project": { - "type": "string" - } + "Flags": { + "properties": { + "cache_selected_only": { + "anyOf": [ + { + "type": "boolean" + } + ], + "default": null, + "title": "Cache Selected Only" }, - "additionalProperties": false - } - }, - "grants": { - "description": "grant config. each key is a database permission and the value is the grantee of that permission", - "type": "object", - "patternProperties": { - ".*": { - "$ref": "#/$defs/string_or_array_of_strings" + "debug": { + "anyOf": [ + { + "type": "boolean" + } + ], + "default": null, + "title": "Debug" + }, + "fail_fast": { + "anyOf": [ + { + "type": "boolean" + } + ], + "default": null, + "title": "Fail Fast" + }, + "indirect_selection": { + "anyOf": [ + { + "type": "string" + } + ], + "default": null, + "title": "Indirect Selection" + }, + "log_format": { + "anyOf": [ + { + "type": "string" + } + ], + "default": null, + "title": "Log Format" + }, + "log_format_file": { + "anyOf": [ + { + "type": "string" + } + ], + "default": null, + "title": "Log Format File" + }, + "log_level": { + "anyOf": [ + { + "type": "string" + } + ], + "default": null, + "title": "Log Level" + }, + "log_level_file": { + "anyOf": [ + { + "type": "string" + } + ], + "default": null, + "title": "Log Level File" + }, + "partial_parse": { + "anyOf": [ + { + "type": "boolean" + } + ], + "default": null, + "title": "Partial Parse" + }, + "populate_cache": { + "anyOf": [ + { + "type": "boolean" + } + ], + "default": null, + "title": "Populate Cache" + }, + "printer_width": { + "anyOf": [ + { + "type": "integer" + } + ], + "default": null, + "title": "Printer Width" + }, + "require_explicit_package_overrides_for_builtin_materializations": { + "anyOf": [ + { + "type": "boolean" + } + ], + "default": null, + "title": "Require Explicit Package Overrides For Builtin Materializations" + }, + "require_resource_names_without_spaces": { + "anyOf": [ + { + "type": "boolean" + } + ], + "default": null, + "title": "Require Resource Names Without Spaces" + }, + "send_anonymous_usage_stats": { + "anyOf": [ + { + "type": "boolean" + } + ], + "default": null, + "title": "Send Anonymous Usage Stats" + }, + "source_freshness_run_project_hooks": { + "anyOf": [ + { + "type": "boolean" + } + ], + "default": null, + "title": "Source Freshness Run Project Hooks" + }, + "static_parser": { + "anyOf": [ + { + "type": "boolean" + } + ], + "default": null, + "title": "Static Parser" + }, + "use_colors": { + "anyOf": [ + { + "type": "boolean" + } + ], + "default": null, + "title": "Use Colors" + }, + "use_colors_file": { + "anyOf": [ + { + "type": "boolean" + } + ], + "default": null, + "title": "Use Colors File" + }, + "use_experimental_parser": { + "anyOf": [ + { + "type": "boolean" + } + ], + "default": null, + "title": "Use Experimental Parser" + }, + "version_check": { + "anyOf": [ + { + "type": "boolean" + } + ], + "default": null, + "title": "Version Check" + }, + "warn_error": { + "anyOf": [ + { + "type": "boolean" + } + ], + "default": null, + "title": "Warn Error" + }, + "warn_error_options": { + "anyOf": [ + { + "type": "object" + } + ], + "default": null, + "title": "Warn Error Options" + }, + "write_json": { + "anyOf": [ + { + "type": "boolean" + } + ], + "default": null, + "title": "Write Json" } }, - "additionalProperties": false + "title": "Flags", + "type": "object" + }, + "Grants": { + "additionalProperties": { + "$ref": "#/$defs/StringOrArrayOfStrings" + }, + "description": "grant config. each key is a database permission and the value is the grantee of that permission", + "title": "Grants", + "type": "object" }, - "group": { + "Group": { + "title": "Group", "type": "string" }, - "hours_to_expiration": { + "HoursToExpiration": { "description": "Configuration specific to BigQuery adapter used to set an expiration delay (in hours) to a table.", + "title": "HoursToExpiration", "type": "number" }, - "incremental_strategy": { + "IncrementalStrategy": { + "title": "IncrementalStrategy", "type": "string" }, - "invalidate_hard_deletes": { - "$ref": "#/$defs/boolean_or_jinja_string" + "InvalidateHardDeletes": { + "allOf": [ + { + "$ref": "#/$defs/BooleanOrJinjaString" + } + ], + "title": "InvalidateHardDeletes" }, - "jinja_string": { - "type": "string", - "pattern": "\\{\\{.*\\}\\}" + "JinjaString": { + "pattern": "\\{\\{.*\\}\\}", + "title": "JinjaString", + "type": "string" }, - "kms_key_name": { + "KmsKeyName": { "description": "Configuration, specific to BigQuery adapter, of the KMS key name used for data encryption.", + "title": "KmsKeyName", "type": "string" }, - "label_configs": { - "title": "Label configs", - "description": "Configurations specific to BigQuery adapter used to add labels and tags to tables & views created by dbt.", - "type": "object", - "patternProperties": { - "^[a-z][a-z0-9_-]{0,63}$": { - "oneOf": [ - { - "type": "string", - "pattern": "^[a-z0-9_-]{0,64}$" - }, - { - "$ref": "#/$defs/jinja_string" - } - ] - } + "LabelConfigs": { + "pattern": "^[a-z0-9_-]{0,64}$", + "title": "LabelConfigs", + "type": "string" + }, + "LabelConfigs1": { + "additionalProperties": { + "anyOf": [ + { + "$ref": "#/$defs/LabelConfigs" + }, + { + "$ref": "#/$defs/JinjaString" + } + ] }, - "additionalProperties": false + "description": "Configurations specific to BigQuery adapter used to add labels and tags to tables & views created by dbt.", + "title": "LabelConfigs1", + "type": "object" }, - "limit": { + "Limit": { + "title": "Limit", "type": "number" }, - "location": { + "Location": { + "title": "Location", "type": "string" }, - "materialized": { + "Materialized": { + "title": "Materialized", "type": "string" }, - "meta": { + "Meta": { + "properties": {}, + "title": "Meta", "type": "object" }, - "model_configs": { - "title": "Model configs", - "description": "Configurations set in the dbt_project.yml file will apply to all models that don't have a more specific configuration set.", - "type": "object", + "ModelConfigs": { "properties": { "+access": { - "$ref": "#/$defs/access" + "anyOf": [ + { + "$ref": "#/$defs/Access" + } + ], + "default": null }, "+alias": { - "$ref": "#/$defs/alias" + "anyOf": [ + { + "$ref": "#/$defs/Alias" + } + ], + "default": null }, "+auto_refresh": { - "$ref": "#/$defs/auto_refresh" + "anyOf": [ + { + "$ref": "#/$defs/AutoRefresh" + } + ], + "default": null }, "+backup": { - "$ref": "#/$defs/backup" + "anyOf": [ + { + "$ref": "#/$defs/Backup" + } + ], + "default": null }, "+bind": { - "$ref": "#/$defs/boolean_or_jinja_string", + "anyOf": [ + { + "$ref": "#/$defs/BooleanOrJinjaString" + } + ], "default": false }, "+contract": { - "$ref": "#/$defs/contract" + "anyOf": [ + { + "$ref": "#/$defs/Contract" + } + ], + "default": null }, "+copy_grants": { - "$ref": "#/$defs/boolean_or_jinja_string" + "anyOf": [ + { + "$ref": "#/$defs/BooleanOrJinjaString" + } + ], + "default": null }, "+database": { - "$ref": "#/$defs/database" + "anyOf": [ + { + "$ref": "#/$defs/Database" + } + ], + "default": null }, "+docs": { - "$ref": "#/$defs/docs_config" + "anyOf": [ + { + "$ref": "#/$defs/DocsConfig" + } + ], + "default": null }, "+enabled": { - "$ref": "#/$defs/boolean_or_jinja_string" + "anyOf": [ + { + "$ref": "#/$defs/BooleanOrJinjaString" + } + ], + "default": null }, "+file_format": { - "$ref": "#/$defs/file_format" + "anyOf": [ + { + "$ref": "#/$defs/FileFormat" + } + ], + "default": null }, "+full_refresh": { - "$ref": "#/$defs/boolean_or_jinja_string" + "anyOf": [ + { + "$ref": "#/$defs/BooleanOrJinjaString" + } + ], + "default": null }, "+grant_access_to": { - "$ref": "#/$defs/grant_access_to" + "anyOf": [ + { + "$ref": "#/$defs/AuthorizedViews" + } + ], + "default": null }, "+grants": { - "$ref": "#/$defs/grants" + "anyOf": [ + { + "$ref": "#/$defs/Grants" + } + ], + "default": null }, "+group": { - "$ref": "#/$defs/group" + "anyOf": [ + { + "$ref": "#/$defs/Group" + } + ], + "default": null }, "+hours_to_expiration": { - "$ref": "#/$defs/hours_to_expiration" + "anyOf": [ + { + "$ref": "#/$defs/HoursToExpiration" + } + ], + "default": null }, "+incremental_strategy": { - "$ref": "#/$defs/incremental_strategy" + "anyOf": [ + { + "$ref": "#/$defs/IncrementalStrategy" + } + ], + "default": null }, "+kms_key_name": { - "$ref": "#/$defs/kms_key_name" + "anyOf": [ + { + "$ref": "#/$defs/KmsKeyName" + } + ], + "default": null }, "+labels": { - "$ref": "#/$defs/label_configs" + "anyOf": [ + { + "$ref": "#/$defs/LabelConfigs1" + } + ], + "default": null }, "+location": { - "$ref": "#/$defs/location" + "anyOf": [ + { + "$ref": "#/$defs/Location" + } + ], + "default": null }, "+materialized": { - "$ref": "#/$defs/materialized" + "anyOf": [ + { + "$ref": "#/$defs/Materialized" + } + ], + "default": null }, "+meta": { - "$ref": "#/$defs/meta" + "anyOf": [ + { + "$ref": "#/$defs/Meta" + } + ], + "default": null }, "+on_configuration_change": { - "$ref": "#/$defs/on_configuration_change" + "anyOf": [ + { + "$ref": "#/$defs/OnConfigurationChange" + } + ], + "default": null }, "+on_schema_change": { - "$ref": "#/$defs/on_schema_change" + "anyOf": [ + { + "$ref": "#/$defs/OnSchemaChange" + } + ], + "default": null }, "+persist_docs": { - "$ref": "#/$defs/persist_docs_config" + "anyOf": [ + { + "$ref": "#/$defs/PersistDocsConfig" + } + ], + "default": null }, "+post-hook": { - "$ref": "#/$defs/array_of_strings" + "anyOf": [ + { + "$ref": "#/$defs/ArrayOfStrings" + } + ], + "default": null }, "+pre-hook": { - "$ref": "#/$defs/array_of_strings" + "anyOf": [ + { + "$ref": "#/$defs/ArrayOfStrings" + } + ], + "default": null }, "+schema": { - "$ref": "#/$defs/schema" + "anyOf": [ + { + "$ref": "#/$defs/Schema" + } + ], + "default": null }, "+secure": { - "$ref": "#/$defs/boolean_or_jinja_string", + "anyOf": [ + { + "$ref": "#/$defs/BooleanOrJinjaString" + } + ], "default": false }, "+snowflake_warehouse": { - "$ref": "#/$defs/snowflake_warehouse" + "anyOf": [ + { + "$ref": "#/$defs/SnowflakeWarehouse" + } + ], + "default": null }, "+sql_header": { - "$ref": "#/$defs/sql_header" + "anyOf": [ + { + "$ref": "#/$defs/SqlHeader" + } + ], + "default": null }, "+tags": { - "$ref": "#/$defs/tags" + "anyOf": [ + { + "$ref": "#/$defs/Tags" + } + ], + "default": null }, "+target_lag": { - "$ref": "#/$defs/target_lag" + "anyOf": [ + { + "$ref": "#/$defs/TargetLag" + } + ], + "default": null }, "+transient": { - "$ref": "#/$defs/boolean_or_jinja_string" + "anyOf": [ + { + "$ref": "#/$defs/BooleanOrJinjaString" + } + ], + "default": null }, "access": { - "$ref": "#/$defs/access" + "anyOf": [ + { + "$ref": "#/$defs/Access" + } + ], + "default": null }, "alias": { - "$ref": "#/$defs/alias" + "anyOf": [ + { + "$ref": "#/$defs/Alias" + } + ], + "default": null }, "auto_refresh": { - "$ref": "#/$defs/auto_refresh" + "anyOf": [ + { + "$ref": "#/$defs/AutoRefresh" + } + ], + "default": null }, "backup": { - "$ref": "#/$defs/backup" + "anyOf": [ + { + "$ref": "#/$defs/Backup" + } + ], + "default": null }, "bind": { - "$ref": "#/$defs/boolean_or_jinja_string", + "anyOf": [ + { + "$ref": "#/$defs/BooleanOrJinjaString" + } + ], "default": false }, "contract": { - "$ref": "#/$defs/contract" + "anyOf": [ + { + "$ref": "#/$defs/Contract" + } + ], + "default": null }, "copy_grants": { - "$ref": "#/$defs/boolean_or_jinja_string" + "anyOf": [ + { + "$ref": "#/$defs/BooleanOrJinjaString" + } + ], + "default": null }, "database": { - "$ref": "#/$defs/database" + "anyOf": [ + { + "$ref": "#/$defs/Database" + } + ], + "default": null }, "docs": { - "$ref": "#/$defs/docs_config" + "anyOf": [ + { + "$ref": "#/$defs/DocsConfig" + } + ], + "default": null }, "enabled": { - "$ref": "#/$defs/boolean_or_jinja_string" - }, + "anyOf": [ + { + "$ref": "#/$defs/BooleanOrJinjaString" + } + ], + "default": null + }, "file_format": { - "$ref": "#/$defs/file_format" + "anyOf": [ + { + "$ref": "#/$defs/FileFormat" + } + ], + "default": null }, "full_refresh": { - "$ref": "#/$defs/boolean_or_jinja_string" + "anyOf": [ + { + "$ref": "#/$defs/BooleanOrJinjaString" + } + ], + "default": null }, "grant_access_to": { - "$ref": "#/$defs/grant_access_to" + "anyOf": [ + { + "$ref": "#/$defs/AuthorizedViews" + } + ], + "default": null }, "grants": { - "$ref": "#/$defs/grants" + "anyOf": [ + { + "$ref": "#/$defs/Grants" + } + ], + "default": null }, "group": { - "$ref": "#/$defs/group" + "anyOf": [ + { + "$ref": "#/$defs/Group" + } + ], + "default": null }, "hours_to_expiration": { - "$ref": "#/$defs/hours_to_expiration" + "anyOf": [ + { + "$ref": "#/$defs/HoursToExpiration" + } + ], + "default": null }, "incremental_strategy": { - "$ref": "#/$defs/incremental_strategy" + "anyOf": [ + { + "$ref": "#/$defs/IncrementalStrategy" + } + ], + "default": null }, "kms_key_name": { - "$ref": "#/$defs/kms_key_name" + "anyOf": [ + { + "$ref": "#/$defs/KmsKeyName" + } + ], + "default": null }, "labels": { - "$ref": "#/$defs/label_configs" + "anyOf": [ + { + "$ref": "#/$defs/LabelConfigs1" + } + ], + "default": null }, "location": { - "$ref": "#/$defs/location" + "anyOf": [ + { + "$ref": "#/$defs/Location" + } + ], + "default": null }, "materialized": { - "$ref": "#/$defs/materialized" + "anyOf": [ + { + "$ref": "#/$defs/Materialized" + } + ], + "default": null }, "meta": { - "$ref": "#/$defs/meta" + "anyOf": [ + { + "$ref": "#/$defs/Meta" + } + ], + "default": null }, "on_configuration_change": { - "$ref": "#/$defs/on_configuration_change" + "anyOf": [ + { + "$ref": "#/$defs/OnConfigurationChange" + } + ], + "default": null }, "on_schema_change": { - "$ref": "#/$defs/on_schema_change" + "anyOf": [ + { + "$ref": "#/$defs/OnSchemaChange" + } + ], + "default": null }, "persist_docs": { - "$ref": "#/$defs/persist_docs_config" + "anyOf": [ + { + "$ref": "#/$defs/PersistDocsConfig" + } + ], + "default": null }, "post-hook": { - "$ref": "#/$defs/array_of_strings" + "anyOf": [ + { + "$ref": "#/$defs/ArrayOfStrings" + } + ], + "default": null }, "pre-hook": { - "$ref": "#/$defs/array_of_strings" + "anyOf": [ + { + "$ref": "#/$defs/ArrayOfStrings" + } + ], + "default": null }, "schema": { - "$ref": "#/$defs/schema" + "anyOf": [ + { + "$ref": "#/$defs/Schema" + } + ], + "default": null }, "secure": { - "$ref": "#/$defs/boolean_or_jinja_string", + "anyOf": [ + { + "$ref": "#/$defs/BooleanOrJinjaString" + } + ], "default": false }, "snowflake_warehouse": { - "$ref": "#/$defs/snowflake_warehouse" + "anyOf": [ + { + "$ref": "#/$defs/SnowflakeWarehouse" + } + ], + "default": null }, "sql_header": { - "$ref": "#/$defs/sql_header" + "anyOf": [ + { + "$ref": "#/$defs/SqlHeader" + } + ], + "default": null }, "tags": { - "$ref": "#/$defs/tags" + "anyOf": [ + { + "$ref": "#/$defs/Tags" + } + ], + "default": null }, "target_lag": { - "$ref": "#/$defs/target_lag" + "anyOf": [ + { + "$ref": "#/$defs/TargetLag" + } + ], + "default": null }, "transient": { - "$ref": "#/$defs/boolean_or_jinja_string" + "anyOf": [ + { + "$ref": "#/$defs/BooleanOrJinjaString" + } + ], + "default": null } }, - "additionalProperties": { - "oneOf": [ - { - "$ref": "#/$defs/model_configs" - }, - { - "$ref": "#/$defs/empty_directory" - } - ] - } + "title": "ModelConfigs", + "type": "object" }, - "on_configuration_change": { - "type": "string", + "OnConfigurationChange": { "enum": [ "apply", "continue", "fail" - ] + ], + "title": "OnConfigurationChange", + "type": "string" }, - "on_schema_change": { - "type": "string", + "OnSchemaChange": { "enum": [ "append_new_columns", "fail", "ignore", "sync_all_columns" - ] + ], + "title": "OnSchemaChange", + "type": "string" }, - "persist_docs_config": { - "title": "Persist docs config", - "description": "Configurations for the persistence of the dbt documentation.", - "type": "object", + "PersistDocsConfig": { + "additionalProperties": false, "properties": { "columns": { - "$ref": "#/$defs/boolean_or_jinja_string", - "default": true + "anyOf": [ + { + "$ref": "#/$defs/BooleanOrJinjaString" + } + ] }, "relation": { - "$ref": "#/$defs/boolean_or_jinja_string", - "default": true + "anyOf": [ + { + "$ref": "#/$defs/BooleanOrJinjaString" + } + ] + } + }, + "title": "PersistDocsConfig", + "type": "object" + }, + "QueryComment": { + "additionalProperties": false, + "properties": { + "append": { + "anyOf": [ + { + "$ref": "#/$defs/BooleanOrJinjaString" + } + ], + "default": null + }, + "comment": { + "anyOf": [ + { + "type": "string" + } + ], + "default": null, + "title": "Comment" + }, + "job-label": { + "anyOf": [ + { + "$ref": "#/$defs/BooleanOrJinjaString" + } + ], + "default": null + } + }, + "title": "QueryComment", + "type": "object" + }, + "Quoting": { + "properties": { + "database": { + "anyOf": [ + { + "$ref": "#/$defs/BooleanOrJinjaString" + } + ], + "default": null + }, + "identifier": { + "anyOf": [ + { + "$ref": "#/$defs/BooleanOrJinjaString" + } + ], + "default": null + }, + "schema": { + "anyOf": [ + { + "$ref": "#/$defs/BooleanOrJinjaString" + } + ], + "default": null } }, - "additionalProperties": false + "title": "Quoting", + "type": "object" }, - "schema": { - "type": [ - "string", - "null" - ] + "Schema": { + "anyOf": [ + { + "type": "string" + } + ], + "title": "Schema" }, - "seed_configs": { - "title": "Seed configs", - "type": "object", + "SeedConfigs": { "properties": { "+column_types": { - "$ref": "#/$defs/column_types" + "anyOf": [ + { + "$ref": "#/$defs/ColumnTypes" + } + ], + "default": null }, "+copy_grants": { - "$ref": "#/$defs/boolean_or_jinja_string" + "anyOf": [ + { + "$ref": "#/$defs/BooleanOrJinjaString" + } + ], + "default": null }, "+database": { - "$ref": "#/$defs/database" + "anyOf": [ + { + "$ref": "#/$defs/Database" + } + ], + "default": null }, "+docs": { - "$ref": "#/$defs/docs_config" + "anyOf": [ + { + "$ref": "#/$defs/DocsConfig" + } + ], + "default": null }, "+enabled": { - "$ref": "#/$defs/boolean_or_jinja_string" + "anyOf": [ + { + "$ref": "#/$defs/BooleanOrJinjaString" + } + ], + "default": null }, "+full_refresh": { - "$ref": "#/$defs/boolean_or_jinja_string" + "anyOf": [ + { + "$ref": "#/$defs/BooleanOrJinjaString" + } + ], + "default": null }, "+grants": { - "$ref": "#/$defs/grants" + "anyOf": [ + { + "$ref": "#/$defs/Grants" + } + ], + "default": null }, "+group": { - "$ref": "#/$defs/group" + "anyOf": [ + { + "$ref": "#/$defs/Group" + } + ], + "default": null }, "+meta": { - "$ref": "#/$defs/meta" + "anyOf": [ + { + "$ref": "#/$defs/Meta" + } + ], + "default": null }, "+persist_docs": { - "$ref": "#/$defs/persist_docs_config" + "anyOf": [ + { + "$ref": "#/$defs/PersistDocsConfig" + } + ], + "default": null }, "+quote_columns": { - "$ref": "#/$defs/boolean_or_jinja_string" + "anyOf": [ + { + "$ref": "#/$defs/BooleanOrJinjaString" + } + ], + "default": null }, "+schema": { - "$ref": "#/$defs/schema" + "anyOf": [ + { + "$ref": "#/$defs/Schema" + } + ], + "default": null }, "+tags": { - "$ref": "#/$defs/tags" + "anyOf": [ + { + "$ref": "#/$defs/Tags" + } + ], + "default": null }, "+transient": { - "$ref": "#/$defs/boolean_or_jinja_string" + "anyOf": [ + { + "$ref": "#/$defs/BooleanOrJinjaString" + } + ], + "default": null }, "column_types": { - "$ref": "#/$defs/column_types" + "anyOf": [ + { + "$ref": "#/$defs/ColumnTypes" + } + ], + "default": null }, "copy_grants": { - "$ref": "#/$defs/boolean_or_jinja_string" + "anyOf": [ + { + "$ref": "#/$defs/BooleanOrJinjaString" + } + ], + "default": null }, "database": { - "$ref": "#/$defs/database" + "anyOf": [ + { + "$ref": "#/$defs/Database" + } + ], + "default": null }, "docs": { - "$ref": "#/$defs/docs_config" + "anyOf": [ + { + "$ref": "#/$defs/DocsConfig" + } + ], + "default": null }, "enabled": { - "$ref": "#/$defs/boolean_or_jinja_string" + "anyOf": [ + { + "$ref": "#/$defs/BooleanOrJinjaString" + } + ], + "default": null }, "full_refresh": { - "$ref": "#/$defs/boolean_or_jinja_string" + "anyOf": [ + { + "$ref": "#/$defs/BooleanOrJinjaString" + } + ], + "default": null }, "grants": { - "$ref": "#/$defs/grants" + "anyOf": [ + { + "$ref": "#/$defs/Grants" + } + ], + "default": null }, "group": { - "$ref": "#/$defs/group" + "anyOf": [ + { + "$ref": "#/$defs/Group" + } + ], + "default": null }, "meta": { - "$ref": "#/$defs/meta" + "anyOf": [ + { + "$ref": "#/$defs/Meta" + } + ], + "default": null }, "persist_docs": { - "$ref": "#/$defs/persist_docs_config" + "anyOf": [ + { + "$ref": "#/$defs/PersistDocsConfig" + } + ], + "default": null }, "quote_columns": { - "$ref": "#/$defs/boolean_or_jinja_string" + "anyOf": [ + { + "$ref": "#/$defs/BooleanOrJinjaString" + } + ], + "default": null }, "schema": { - "$ref": "#/$defs/schema" + "anyOf": [ + { + "$ref": "#/$defs/Schema" + } + ], + "default": null }, "tags": { - "$ref": "#/$defs/tags" + "anyOf": [ + { + "$ref": "#/$defs/Tags" + } + ], + "default": null }, "transient": { - "$ref": "#/$defs/boolean_or_jinja_string" + "anyOf": [ + { + "$ref": "#/$defs/BooleanOrJinjaString" + } + ], + "default": null } }, - "additionalProperties": { - "oneOf": [ - { - "$ref": "#/$defs/seed_configs" - }, - { - "$ref": "#/$defs/empty_directory" - } - ] - } + "title": "SeedConfigs", + "type": "object" }, - "severity": { - "oneOf": [ + "Severity": { + "anyOf": [ { - "$ref": "#/$defs/jinja_string" + "$ref": "#/$defs/JinjaString" }, { - "type": "string", - "enum": [ - "warn", - "error" - ] + "$ref": "#/$defs/Severity1" } - ] + ], + "title": "Severity" + }, + "Severity1": { + "enum": [ + "warn", + "error" + ], + "title": "Severity1", + "type": "string" }, - "snapshot_configs": { - "title": "Snapshot configs", - "type": "object", + "SnapshotConfigs": { "properties": { "+alias": { - "$ref": "#/$defs/alias" + "anyOf": [ + { + "$ref": "#/$defs/Alias" + } + ], + "default": null }, "+check_cols": { - "$ref": "#/$defs/string_or_array_of_strings" + "anyOf": [ + { + "$ref": "#/$defs/StringOrArrayOfStrings" + } + ], + "default": null }, "+docs": { - "$ref": "#/$defs/docs_config" + "anyOf": [ + { + "$ref": "#/$defs/DocsConfig" + } + ], + "default": null }, "+enabled": { - "$ref": "#/$defs/boolean_or_jinja_string" + "anyOf": [ + { + "$ref": "#/$defs/BooleanOrJinjaString" + } + ], + "default": null }, "+grants": { - "$ref": "#/$defs/grants" + "anyOf": [ + { + "$ref": "#/$defs/Grants" + } + ], + "default": null }, "+group": { - "$ref": "#/$defs/group" + "anyOf": [ + { + "$ref": "#/$defs/Group" + } + ], + "default": null }, "+invalidate_hard_deletes": { - "$ref": "#/$defs/invalidate_hard_deletes" + "anyOf": [ + { + "$ref": "#/$defs/InvalidateHardDeletes" + } + ], + "default": null }, "+meta": { - "$ref": "#/$defs/meta" + "anyOf": [ + { + "$ref": "#/$defs/Meta" + } + ], + "default": null }, "+persist_docs": { - "$ref": "#/$defs/persist_docs_config" + "anyOf": [ + { + "$ref": "#/$defs/PersistDocsConfig" + } + ], + "default": null }, "+post-hook": { - "$ref": "#/$defs/array_of_strings" + "anyOf": [ + { + "$ref": "#/$defs/ArrayOfStrings" + } + ], + "default": null }, "+pre-hook": { - "$ref": "#/$defs/array_of_strings" + "anyOf": [ + { + "$ref": "#/$defs/ArrayOfStrings" + } + ], + "default": null }, "+quote_columns": { - "$ref": "#/$defs/boolean_or_jinja_string" + "anyOf": [ + { + "$ref": "#/$defs/BooleanOrJinjaString" + } + ], + "default": null }, "+strategy": { - "$ref": "#/$defs/strategy" + "anyOf": [ + { + "$ref": "#/$defs/Strategy" + } + ], + "default": null }, "+tags": { - "$ref": "#/$defs/tags" + "anyOf": [ + { + "$ref": "#/$defs/Tags" + } + ], + "default": null }, "+target_database": { - "$ref": "#/$defs/target_database" + "anyOf": [ + { + "$ref": "#/$defs/TargetDatabase" + } + ], + "default": null }, "+target_schema": { - "$ref": "#/$defs/target_schema" + "anyOf": [ + { + "$ref": "#/$defs/TargetSchema" + } + ], + "default": null }, "+transient": { - "$ref": "#/$defs/boolean_or_jinja_string" + "anyOf": [ + { + "$ref": "#/$defs/BooleanOrJinjaString" + } + ], + "default": null }, "+unique_key": { - "$ref": "#/$defs/string_or_array_of_strings" + "anyOf": [ + { + "$ref": "#/$defs/StringOrArrayOfStrings" + } + ], + "default": null }, "+updated_at": { - "$ref": "#/$defs/updated_at" + "anyOf": [ + { + "$ref": "#/$defs/UpdatedAt" + } + ], + "default": null }, "alias": { - "$ref": "#/$defs/alias" + "anyOf": [ + { + "$ref": "#/$defs/Alias" + } + ], + "default": null }, "check_cols": { - "$ref": "#/$defs/string_or_array_of_strings" + "anyOf": [ + { + "$ref": "#/$defs/StringOrArrayOfStrings" + } + ], + "default": null }, "docs": { - "$ref": "#/$defs/docs_config" + "anyOf": [ + { + "$ref": "#/$defs/DocsConfig" + } + ], + "default": null }, "enabled": { - "$ref": "#/$defs/boolean_or_jinja_string" + "anyOf": [ + { + "$ref": "#/$defs/BooleanOrJinjaString" + } + ], + "default": null }, "grants": { - "$ref": "#/$defs/grants" + "anyOf": [ + { + "$ref": "#/$defs/Grants" + } + ], + "default": null }, "group": { - "$ref": "#/$defs/group" + "anyOf": [ + { + "$ref": "#/$defs/Group" + } + ], + "default": null }, "invalidate_hard_deletes": { - "$ref": "#/$defs/invalidate_hard_deletes" + "anyOf": [ + { + "$ref": "#/$defs/InvalidateHardDeletes" + } + ], + "default": null }, "meta": { - "$ref": "#/$defs/meta" + "anyOf": [ + { + "$ref": "#/$defs/Meta" + } + ], + "default": null }, "persist_docs": { - "$ref": "#/$defs/persist_docs_config" + "anyOf": [ + { + "$ref": "#/$defs/PersistDocsConfig" + } + ], + "default": null }, "post-hook": { - "$ref": "#/$defs/array_of_strings" + "anyOf": [ + { + "$ref": "#/$defs/ArrayOfStrings" + } + ], + "default": null }, "pre-hook": { - "$ref": "#/$defs/array_of_strings" + "anyOf": [ + { + "$ref": "#/$defs/ArrayOfStrings" + } + ], + "default": null }, "quote_columns": { - "$ref": "#/$defs/boolean_or_jinja_string" + "anyOf": [ + { + "$ref": "#/$defs/BooleanOrJinjaString" + } + ], + "default": null }, "strategy": { - "$ref": "#/$defs/strategy" + "anyOf": [ + { + "$ref": "#/$defs/Strategy" + } + ], + "default": null }, "tags": { - "$ref": "#/$defs/tags" + "anyOf": [ + { + "$ref": "#/$defs/Tags" + } + ], + "default": null }, "target_database": { - "$ref": "#/$defs/target_database" + "anyOf": [ + { + "$ref": "#/$defs/TargetDatabase" + } + ], + "default": null }, "target_schema": { - "$ref": "#/$defs/target_schema" + "anyOf": [ + { + "$ref": "#/$defs/TargetSchema" + } + ], + "default": null }, "transient": { - "$ref": "#/$defs/boolean_or_jinja_string" + "anyOf": [ + { + "$ref": "#/$defs/BooleanOrJinjaString" + } + ], + "default": null }, "unique_key": { - "$ref": "#/$defs/string_or_array_of_strings" + "anyOf": [ + { + "$ref": "#/$defs/StringOrArrayOfStrings" + } + ], + "default": null }, "updated_at": { - "$ref": "#/$defs/updated_at" + "anyOf": [ + { + "$ref": "#/$defs/UpdatedAt" + } + ], + "default": null } }, - "additionalProperties": { - "oneOf": [ - { - "$ref": "#/$defs/snapshot_configs" - }, - { - "$ref": "#/$defs/empty_directory" - } - ] - } + "title": "SnapshotConfigs", + "type": "object" }, - "snowflake_warehouse": { + "SnowflakeWarehouse": { + "title": "SnowflakeWarehouse", "type": "string" }, - "source_configs": { - "title": "Source configs", - "type": "object", + "SourceConfigs": { "properties": { "+enabled": { - "$ref": "#/$defs/boolean_or_jinja_string" + "anyOf": [ + { + "$ref": "#/$defs/BooleanOrJinjaString" + } + ], + "default": null }, "+meta": { - "$ref": "#/$defs/meta" + "anyOf": [ + { + "$ref": "#/$defs/Meta" + } + ], + "default": null }, "+tags": { - "$ref": "#/$defs/tags" + "anyOf": [ + { + "$ref": "#/$defs/Tags" + } + ], + "default": null }, "enabled": { - "$ref": "#/$defs/boolean_or_jinja_string" + "anyOf": [ + { + "$ref": "#/$defs/BooleanOrJinjaString" + } + ], + "default": null }, "meta": { - "$ref": "#/$defs/meta" + "anyOf": [ + { + "$ref": "#/$defs/Meta" + } + ], + "default": null }, "tags": { - "$ref": "#/$defs/tags" + "anyOf": [ + { + "$ref": "#/$defs/Tags" + } + ], + "default": null } }, - "additionalProperties": { - "oneOf": [ - { - "$ref": "#/$defs/source_configs" - }, - { - "$ref": "#/$defs/empty_directory" - } - ] - } + "title": "SourceConfigs", + "type": "object" }, - "sql_header": { + "SqlHeader": { + "title": "SqlHeader", "type": "string" }, - "strategy": { + "Strategy": { + "title": "Strategy", "type": "string" }, - "string_or_array_of_strings": { - "oneOf": [ + "StringOrArrayOfStrings": { + "anyOf": [ { "type": "string" }, { - "$ref": "#/$defs/array_of_strings" + "$ref": "#/$defs/ArrayOfStrings" } - ] + ], + "title": "StringOrArrayOfStrings" }, - "tags": { - "$ref": "#/$defs/string_or_array_of_strings" + "Tags": { + "allOf": [ + { + "$ref": "#/$defs/StringOrArrayOfStrings" + } + ], + "title": "Tags" }, - "target_database": { + "TargetDatabase": { + "title": "TargetDatabase", "type": "string" }, - "target_lag": { - "type": "string", - "pattern": "^(?:downstream|\\d+\\s*(?:seconds|minutes|hours|days))$" + "TargetLag": { + "pattern": "^(?:downstream|\\d+\\s*(?:seconds|minutes|hours|days))$", + "title": "TargetLag", + "type": "string" }, - "target_schema": { + "TargetSchema": { + "title": "TargetSchema", "type": "string" }, - "unit_test_configs": { + "UnitTestConfigs": { "properties": { "+meta": { - "$ref": "#/$defs/meta" + "anyOf": [ + { + "$ref": "#/$defs/Meta" + } + ], + "default": null }, "+tags": { - "$ref": "#/$defs/tags" + "anyOf": [ + { + "$ref": "#/$defs/Tags" + } + ], + "default": null }, "meta": { - "$ref": "#/$defs/meta" + "anyOf": [ + { + "$ref": "#/$defs/Meta" + } + ], + "default": null }, "tags": { - "$ref": "#/$defs/tags" + "anyOf": [ + { + "$ref": "#/$defs/Tags" + } + ], + "default": null } }, - "additionalProperties": { - "oneOf": [ - { - "$ref": "#/$defs/unit_test_configs" - }, - { - "$ref": "#/$defs/empty_directory" - } - ] - } + "title": "UnitTestConfigs", + "type": "object" }, - "updated_at": { + "UpdatedAt": { + "title": "UpdatedAt", "type": "string" }, - "warn_if": { + "WarnIf": { + "title": "WarnIf", "type": "string" } - } + }, + "additionalProperties": false, + "properties": { + "version": { + "anyOf": [ + { + "type": "string" + } + ], + "default": null, + "title": "Version" + }, + "name": { + "title": "Name", + "type": "string" + }, + "analysis-paths": { + "anyOf": [ + { + "$ref": "#/$defs/ArrayOfStrings" + } + ], + "default": null + }, + "asset-paths": { + "anyOf": [ + { + "$ref": "#/$defs/ArrayOfStrings" + } + ], + "default": null + }, + "clean-targets": { + "anyOf": [ + { + "$ref": "#/$defs/ArrayOfStrings" + } + ], + "default": null + }, + "config-version": { + "anyOf": [ + { + "type": "number" + } + ], + "default": 2, + "title": "Config-Version" + }, + "data_tests": { + "anyOf": [ + { + "$ref": "#/$defs/DataTestConfigs" + } + ], + "default": null + }, + "dbt-cloud": { + "anyOf": [ + { + "$ref": "#/$defs/DbtCloud" + } + ], + "default": null + }, + "dispatch": { + "anyOf": [ + { + "items": { + "$ref": "#/$defs/DispatchItem" + }, + "type": "array" + } + ], + "default": null, + "title": "Dispatch" + }, + "docs-paths": { + "anyOf": [ + { + "$ref": "#/$defs/ArrayOfStrings" + } + ], + "default": null + }, + "flags": { + "anyOf": [ + { + "$ref": "#/$defs/Flags" + } + ], + "default": null + }, + "log-path": { + "anyOf": [ + { + "type": "string" + } + ], + "default": null, + "title": "Log-Path" + }, + "macro-paths": { + "anyOf": [ + { + "$ref": "#/$defs/ArrayOfStrings" + } + ], + "default": null + }, + "model-paths": { + "anyOf": [ + { + "$ref": "#/$defs/ArrayOfStrings" + } + ], + "default": null + }, + "models": { + "anyOf": [ + { + "$ref": "#/$defs/ModelConfigs" + } + ], + "default": null + }, + "on-run-end": { + "anyOf": [ + { + "$ref": "#/$defs/ArrayOfStrings" + }, + { + "type": "string" + } + ], + "default": null, + "title": "On-Run-End" + }, + "on-run-start": { + "anyOf": [ + { + "$ref": "#/$defs/ArrayOfStrings" + }, + { + "type": "string" + } + ], + "default": null, + "title": "On-Run-Start" + }, + "packages-install-path": { + "anyOf": [ + { + "type": "string" + } + ], + "default": null, + "title": "Packages-Install-Path" + }, + "profile": { + "anyOf": [ + { + "type": "string" + } + ], + "default": null, + "title": "Profile" + }, + "query-comment": { + "anyOf": [ + { + "type": "string" + }, + { + "$ref": "#/$defs/QueryComment" + } + ], + "default": null, + "title": "Query-Comment" + }, + "quoting": { + "anyOf": [ + { + "$ref": "#/$defs/Quoting" + } + ], + "default": null + }, + "require-dbt-version": { + "anyOf": [ + { + "$ref": "#/$defs/StringOrArrayOfStrings" + } + ], + "default": null + }, + "seed-paths": { + "anyOf": [ + { + "$ref": "#/$defs/ArrayOfStrings" + } + ], + "default": null + }, + "seeds": { + "anyOf": [ + { + "$ref": "#/$defs/SeedConfigs" + } + ], + "default": null + }, + "snapshot-paths": { + "anyOf": [ + { + "$ref": "#/$defs/ArrayOfStrings" + } + ], + "default": null + }, + "snapshots": { + "anyOf": [ + { + "$ref": "#/$defs/SnapshotConfigs" + } + ], + "default": null + }, + "sources": { + "anyOf": [ + { + "$ref": "#/$defs/SourceConfigs" + } + ], + "default": null + }, + "target-path": { + "anyOf": [ + { + "type": "string" + } + ], + "default": null, + "title": "Target-Path" + }, + "test-paths": { + "anyOf": [ + { + "$ref": "#/$defs/ArrayOfStrings" + } + ], + "default": null + }, + "tests": { + "anyOf": [ + { + "$ref": "#/$defs/DataTestConfigs" + } + ], + "default": null + }, + "unit_tests": { + "anyOf": [ + { + "$ref": "#/$defs/UnitTestConfigs" + } + ], + "default": null + }, + "vars": { + "anyOf": [ + { + "type": "object" + } + ], + "default": null, + "title": "Vars" + } + }, + "required": [ + "name" + ], + "title": "DbtProject", + "type": "object" } \ No newline at end of file diff --git a/schemas/latest/dbt_yml_files-latest.json b/schemas/latest/dbt_yml_files-latest.json index b8c757b..21fa4ba 100644 --- a/schemas/latest/dbt_yml_files-latest.json +++ b/schemas/latest/dbt_yml_files-latest.json @@ -1,1961 +1,3918 @@ { - "title": "dbt_yml_files", - "type": "object", - "$schema": "http://json-schema.org/draft-07/schema#", - "properties": { - "version": { - "type": "number", - "const": 2 - }, - "analyses": { - "type": "array", - "items": { - "type": "object", - "required": [ - "name" - ], - "properties": { - "name": { - "type": "string" - }, - "description": { + "$defs": { + "AcceptedValues": { + "properties": { + "name": { + "anyOf": [ + { + "type": "string" + } + ], + "default": null, + "title": "Name" + }, + "config": { + "anyOf": [ + { + "$ref": "#/$defs/TestConfigs" + } + ], + "default": null + }, + "quote": { + "anyOf": [ + { + "type": "boolean" + } + ], + "default": null, + "title": "Quote" + }, + "values": { + "items": { "type": "string" }, - "columns": { - "type": "array", - "items": { - "type": "object", - "required": [ - "name" - ], - "properties": { - "name": { - "type": "string" - }, - "description": { - "type": "string" - }, - "data_type": { - "type": "string" - } - }, - "additionalProperties": false + "title": "Values", + "type": "array" + }, + "where": { + "anyOf": [ + { + "type": "string" } - }, - "config": { - "type": "object", - "properties": { - "tags": { - "$ref": "#/$defs/string_or_array_of_strings" - } - }, - "additionalProperties": false - }, - "docs": { - "$ref": "#/$defs/docs_config" - }, - "group": { - "$ref": "#/$defs/group_name" - } + ], + "default": null, + "title": "Where" } - } + }, + "required": [ + "values" + ], + "title": "AcceptedValues", + "type": "object" }, - "exposures": { - "type": "array", - "items": { - "type": "object", - "required": [ - "depends_on", - "name", - "owner", - "type" - ], - "$comment": "NB: depends_on is not strictly required, but is _expected_ according to the documentation", - "properties": { - "name": { - "type": "string" - }, - "description": { - "type": "string" - }, - "type": { - "type": "string", - "enum": [ - "dashboard", - "notebook", - "analysis", - "ml", - "application" - ] - }, - "depends_on": { - "type": "array", - "items": { - "type": "string" + "AcceptedValuesTest": { + "properties": { + "accepted_values": { + "anyOf": [ + { + "$ref": "#/$defs/AcceptedValues" } - }, - "label": { - "type": "string", - "$comment": "Added in dbt Core v1.3" - }, - "maturity": { - "type": "string", - "enum": [ - "high", - "medium", - "low" - ] - }, - "meta": { - "type": "object" - }, - "owner": { - "$ref": "#/$defs/owner" - }, - "tags": { - "$ref": "#/$defs/string_or_array_of_strings" - }, - "url": { - "type": "string" - } + ], + "default": null } - } + }, + "title": "AcceptedValuesTest", + "type": "object" }, - "groups": { - "type": "array", - "items": { - "type": "object", - "required": [ - "name", - "owner" - ], - "properties": { - "name": { - "type": "string" - }, - "owner": { - "$ref": "#/$defs/owner" - } - }, - "additionalProperties": false - } + "Access": { + "enum": [ + "private", + "protected", + "public" + ], + "title": "Access", + "type": "string" }, - "macros": { - "type": "array", - "items": { - "type": "object", - "required": [ - "name" - ], - "properties": { - "name": { - "type": "string" - }, - "description": { - "type": "string" - }, - "arguments": { - "type": "array", - "items": { - "type": "object", - "required": [ - "name" - ], - "properties": { - "name": { - "type": "string" - }, - "description": { - "type": "string" - }, - "type": { - "type": "string" - } - }, - "additionalProperties": false - } - }, - "docs": { - "$ref": "#/$defs/docs_config" - } - }, - "additionalProperties": false - } + "Agg": { + "enum": [ + "SUM", + "MIN", + "MAX", + "AVG", + "COUNT_DISTINCT", + "SUM_BOOLEAN", + "COUNT", + "PERCENTILE", + "MEDIAN", + "sum", + "min", + "max", + "avg", + "count_distinct", + "sum_boolean", + "count", + "percentile", + "median" + ], + "title": "Agg", + "type": "string" }, - "metrics": { - "type": "array", - "items": { - "type": "object", - "required": [ - "name", - "label", - "type", - "type_params" - ], - "if": { - "properties": { - "type": { - "enum": [ - "SIMPLE", - "simple" - ] + "AggregationTypeParams": { + "additionalProperties": false, + "properties": { + "percentile": { + "anyOf": [ + { + "type": "number" } - } + ], + "default": null, + "title": "Percentile" }, - "then": { - "properties": { - "type_params": { - "$ref": "#/$defs/simple_metric_type_params" + "use_approximate_percentile": { + "anyOf": [ + { + "type": "boolean" } - } + ], + "default": null, + "title": "Use Approximate Percentile" }, - "else": { - "if": { - "properties": { - "type": { - "enum": [ - "derived", - "DERIVED" - ] - } + "use_discrete_percentile": { + "anyOf": [ + { + "type": "boolean" } - }, - "then": { - "properties": { - "type_params": { - "$ref": "#/$defs/derived_metric_type_params" - } + ], + "default": null, + "title": "Use Discrete Percentile" + } + }, + "title": "AggregationTypeParams", + "type": "object" + }, + "Analyse": { + "properties": { + "name": { + "title": "Name", + "type": "string" + }, + "description": { + "anyOf": [ + { + "type": "string" } - }, - "else": { - "if": { - "properties": { - "type": { - "enum": [ - "cumulative", - "CUMULATIVE" - ] - } - } - }, - "then": { - "properties": { - "type_params": { - "$ref": "#/$defs/cumulative_metric_type_params" - } - } - }, - "else": { - "if": { - "properties": { - "type": { - "enum": [ - "conversion", - "CONVERSION" - ] - } - } - }, - "then": { - "properties": { - "type_params": { - "$ref": "#/$defs/conversion_metric_type_params" - } - } + ], + "default": null, + "title": "Description" + }, + "columns": { + "anyOf": [ + { + "items": { + "$ref": "#/$defs/Column" }, - "else": { - "if": { - "properties": { - "type": { - "enum": [ - "ratio", - "RATIO" - ] - } - } - }, - "then": { - "properties": { - "type_params": { - "$ref": "#/$defs/ratio_metric_type_params" - } - } - } - } + "type": "array" } - } - }, - "properties": { - "name": { - "type": "string", - "pattern": "(?!.*__).*^[a-z][a-z0-9_]*[a-z0-9]$" - }, - "description": { - "type": "string" - }, - "type": { - "title": "Metric Type", - "enum": [ - "SIMPLE", - "RATIO", - "CUMULATIVE", - "DERIVED", - "CONVERSION", - "simple", - "ratio", - "cumulative", - "derived", - "conversion" - ] - }, - "filter": { - "type": "string" - }, - "group": { - "$ref": "#/$defs/group_name" - }, - "label": { - "type": "string" - }, - "type_params": { - "type": "object" - } + ], + "default": null, + "title": "Columns" }, - "additionalProperties": false - } - }, - "models": { - "type": "array", - "items": { - "type": "object", - "required": [ - "name" - ], - "properties": { - "name": { - "type": "string" - }, - "description": { - "type": "string" - }, - "access": { - "type": "string", - "enum": [ - "private", - "protected", - "public" - ] - }, - "columns": { - "type": "array", - "items": { - "$ref": "#/$defs/column_properties" - } - }, - "config": { - "$ref": "#/$defs/model_configs" - }, - "constraints": { - "$ref": "#/$defs/constraints" - }, - "data_tests": { - "type": "array", - "items": { - "$ref": "#/$defs/data_tests" - } - }, - "deprecation_date": { - "type": "string" - }, - "docs": { - "$ref": "#/$defs/docs_config" - }, - "group": { - "$ref": "#/$defs/group_name" - }, - "latest_version": { - "type": "number" - }, - "meta": { - "type": "object" - }, - "tests": { - "type": "array", - "items": { - "$ref": "#/$defs/data_tests" - } - }, - "versions": { - "type": "array", - "items": { - "type": "object", - "required": [ - "v" - ], - "properties": { - "columns": { - "type": "array", - "items": { - "anyOf": [ - { - "$ref": "#/$defs/include_exclude" - }, - { - "$ref": "#/$defs/column_properties" - } - ] - } - }, - "config": { - "$ref": "#/$defs/model_configs" - }, - "v": { - "type": "number" - } - } + "config": { + "anyOf": [ + { + "$ref": "#/$defs/Config" } - } + ], + "default": null }, - "additionalProperties": false - } - }, - "saved_queries": { - "type": "array", - "items": { - "type": "object", - "required": [ - "name", - "description", - "label", - "query_params" - ], - "properties": { - "name": { - "type": "string" - }, - "description": { - "type": "string" - }, - "exports": { - "type": "array", - "items": { - "$ref": "#/$defs/export" - } - }, - "label": { - "type": "string" - }, - "query_params": { - "type": "object", - "properties": { - "dimensions": { - "$ref": "#/$defs/array_of_strings" - }, - "metrics": { - "$ref": "#/$defs/array_of_strings" - }, - "where": { - "$ref": "#/$defs/array_of_strings" - }, - "additionalProperties": false + "docs": { + "anyOf": [ + { + "$ref": "#/$defs/DocsConfig" } - } + ], + "default": null }, - "additionalProperties": false - } - }, - "seeds": { - "type": "array", - "items": { - "type": "object", - "required": [ - "name" - ], - "properties": { - "name": { - "type": "string" - }, - "description": { - "type": "string" - }, - "columns": { - "type": "array", - "items": { - "$ref": "#/$defs/column_properties" - } - }, - "config": { - "title": "Seed Config", - "type": "object", - "properties": { - "column_types": { - "type": "object" - }, - "copy_grants": { - "$ref": "#/$defs/boolean_or_jinja_string" - }, - "data_tests": { - "type": "array", - "items": { - "$ref": "#/$defs/data_tests" - } - }, - "database": { - "type": "string" - }, - "enabled": { - "$ref": "#/$defs/boolean_or_jinja_string" - }, - "grants": { - "$ref": "#/$defs/grants" - }, - "quote_columns": { - "$ref": "#/$defs/boolean_or_jinja_string" - }, - "schema": { - "type": "string" - } + "group": { + "anyOf": [ + { + "$ref": "#/$defs/GroupName" } - }, - "docs": { - "$ref": "#/$defs/docs_config" - }, - "group": { - "$ref": "#/$defs/group_name" - }, - "tests": { - "type": "array", - "items": { - "$ref": "#/$defs/data_tests" + ], + "default": null + } + }, + "required": [ + "name" + ], + "title": "Analyse", + "type": "object" + }, + "Argument": { + "additionalProperties": false, + "properties": { + "name": { + "title": "Name", + "type": "string" + }, + "description": { + "anyOf": [ + { + "type": "string" } - } + ], + "default": null, + "title": "Description" }, - "additionalProperties": false - } + "type": { + "anyOf": [ + { + "type": "string" + } + ], + "default": null, + "title": "Type" + } + }, + "required": [ + "name" + ], + "title": "Argument", + "type": "object" }, - "semantic_models": { - "type": "array", + "ArrayOfStrings": { "items": { - "type": "object", - "required": [ - "name", - "model" - ], - "properties": { - "name": { - "type": "string", - "pattern": "(?!.*__).*^[a-z][a-z0-9_]*[a-z0-9]$" - }, - "description": { - "type": "string" - }, - "defaults": { - "type": "object", - "properties": { - "agg_time_dimension": { - "type": "string" - } + "type": "string" + }, + "title": "ArrayOfStrings", + "type": "array" + }, + "AuthorizedView": { + "additionalProperties": false, + "properties": { + "database": { + "title": "Database", + "type": "string" + }, + "project": { + "title": "Project", + "type": "string" + } + }, + "required": [ + "database", + "project" + ], + "title": "AuthorizedView", + "type": "object" + }, + "BooleanOrJinjaString": { + "anyOf": [ + { + "$ref": "#/$defs/JinjaString" + }, + { + "type": "boolean" + } + ], + "title": "BooleanOrJinjaString" + }, + "Calculation": { + "enum": [ + "conversions", + "conversion_rate", + "CONVERSIONS", + "CONVERSION_RATE" + ], + "title": "Calculation", + "type": "string" + }, + "CategoricalDimension": { + "additionalProperties": false, + "properties": { + "name": { + "pattern": "(?!.*__).*^[a-z][a-z0-9_]*[a-z0-9]$", + "title": "Name", + "type": "string" + }, + "description": { + "anyOf": [ + { + "type": "string" + } + ], + "default": null, + "title": "Description" + }, + "expr": { + "anyOf": [ + { + "type": "string" }, - "additionalProperties": false - }, - "dimensions": { - "type": "array", - "items": { - "$ref": "#/$defs/dimension" + { + "type": "boolean" + } + ], + "default": null, + "title": "Expr" + }, + "is_partition": { + "anyOf": [ + { + "type": "boolean" + } + ], + "default": null, + "title": "Is Partition" + }, + "type": { + "$ref": "#/$defs/CategoricalDimensionType" + } + }, + "required": [ + "name", + "type" + ], + "title": "CategoricalDimension", + "type": "object" + }, + "CategoricalDimensionType": { + "enum": [ + "CATEGORICAL", + "categorical" + ], + "title": "CategoricalDimensionType", + "type": "string" + }, + "Column": { + "additionalProperties": false, + "properties": { + "name": { + "title": "Name", + "type": "string" + }, + "description": { + "anyOf": [ + { + "type": "string" + } + ], + "default": null, + "title": "Description" + }, + "data_type": { + "anyOf": [ + { + "type": "string" + } + ], + "default": null, + "title": "Data Type" + } + }, + "required": [ + "name" + ], + "title": "Column", + "type": "object" + }, + "ColumnProperties": { + "additionalProperties": false, + "properties": { + "name": { + "title": "Name", + "type": "string" + }, + "description": { + "anyOf": [ + { + "type": "string" + } + ], + "default": null, + "title": "Description" + }, + "constraints": { + "anyOf": [ + { + "$ref": "#/$defs/Constraints" + } + ], + "default": null + }, + "data_tests": { + "anyOf": [ + { + "items": { + "$ref": "#/$defs/DataTests" + }, + "type": "array" + } + ], + "default": null, + "title": "Data Tests" + }, + "data_type": { + "anyOf": [ + { + "type": "string" + } + ], + "default": null, + "title": "Data Type" + }, + "meta": { + "anyOf": [ + { + "type": "object" + } + ], + "default": null, + "title": "Meta" + }, + "policy_tags": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + } + ], + "default": null, + "description": "Configurations, specific to BigQuery adapter, used to set policy tags on specific columns, enabling column-level security. Only relevant when `persist_docs.columns` is true.", + "title": "Policy tags" + }, + "quote": { + "anyOf": [ + { + "$ref": "#/$defs/BooleanOrJinjaString" + } + ], + "default": null + }, + "tags": { + "anyOf": [ + { + "$ref": "#/$defs/StringOrArrayOfStrings" + } + ], + "default": null + }, + "tests": { + "anyOf": [ + { + "items": { + "$ref": "#/$defs/DataTests" + }, + "type": "array" + } + ], + "default": null, + "title": "Tests" + } + }, + "required": [ + "name" + ], + "title": "ColumnProperties", + "type": "object" + }, + "Config": { + "additionalProperties": false, + "properties": { + "tags": { + "anyOf": [ + { + "$ref": "#/$defs/StringOrArrayOfStrings" + } + ], + "default": null + } + }, + "title": "Config", + "type": "object" + }, + "ConstantProperty": { + "properties": { + "base_property": { + "description": "DIMENSION or ENTITY", + "title": "Base Property", + "type": "string" + }, + "conversion_property": { + "description": "DIMENSION or ENTITY", + "title": "Conversion Property", + "type": "string" + } + }, + "required": [ + "base_property", + "conversion_property" + ], + "title": "ConstantProperty", + "type": "object" + }, + "Constraint": { + "properties": { + "name": { + "anyOf": [ + { + "type": "string" + } + ], + "default": null, + "title": "Name" + }, + "type": { + "title": "Type", + "type": "string" + }, + "columns": { + "anyOf": [ + { + "$ref": "#/$defs/StringOrArrayOfStrings" + } + ], + "default": null + }, + "expression": { + "anyOf": [ + { + "type": "string" + } + ], + "default": null, + "title": "Expression" + }, + "warn_unenforced": { + "anyOf": [ + { + "$ref": "#/$defs/BooleanOrJinjaString" + } + ], + "default": null + }, + "warn_unsupported": { + "anyOf": [ + { + "$ref": "#/$defs/BooleanOrJinjaString" + } + ], + "default": null + } + }, + "required": [ + "type" + ], + "title": "Constraint", + "type": "object" + }, + "Constraints": { + "items": { + "$ref": "#/$defs/Constraint" + }, + "title": "Constraints", + "type": "array" + }, + "Contract": { + "properties": { + "enforced": { + "anyOf": [ + { + "$ref": "#/$defs/BooleanOrJinjaString" + } + ], + "default": null + } + }, + "title": "Contract", + "type": "object" + }, + "ConversionMetric": { + "additionalProperties": false, + "properties": { + "name": { + "pattern": "(?!.*__).*^[a-z][a-z0-9_]*[a-z0-9]$", + "title": "Name", + "type": "string" + }, + "description": { + "anyOf": [ + { + "type": "string" + } + ], + "default": null, + "title": "Description" + }, + "filter": { + "anyOf": [ + { + "type": "string" + } + ], + "default": null, + "title": "Filter" + }, + "group": { + "anyOf": [ + { + "$ref": "#/$defs/GroupName" + } + ], + "default": null + }, + "label": { + "title": "Label", + "type": "string" + }, + "type": { + "$ref": "#/$defs/ConversionMetricType" + }, + "type_params": { + "$ref": "#/$defs/ConversionMetricTypeParams" + } + }, + "required": [ + "name", + "label", + "type", + "type_params" + ], + "title": "ConversionMetric", + "type": "object" + }, + "ConversionMetricType": { + "enum": [ + "CONVERSION", + "conversion" + ], + "title": "ConversionMetricType", + "type": "string" + }, + "ConversionMetricTypeParams": { + "additionalProperties": false, + "properties": { + "conversion_type_params": { + "anyOf": [ + { + "$ref": "#/$defs/ConversionTypeParams" + } + ], + "default": null + } + }, + "title": "ConversionMetricTypeParams", + "type": "object" + }, + "ConversionTypeParams": { + "additionalProperties": false, + "properties": { + "base_measure": { + "$ref": "#/$defs/MetricInputMeasure" + }, + "calculation": { + "anyOf": [ + { + "$ref": "#/$defs/Calculation" + } + ], + "default": "conversion_rate" + }, + "constant_properties": { + "anyOf": [ + { + "items": { + "$ref": "#/$defs/ConstantProperty" + }, + "type": "array" + } + ], + "default": null, + "title": "Constant Properties" + }, + "conversion_measure": { + "$ref": "#/$defs/MetricInputMeasure" + }, + "entity": { + "description": "The entity to calculate over", + "title": "Entity", + "type": "string" + }, + "window": { + "anyOf": [ + { + "type": "string" + } + ], + "default": null, + "title": "Window" + } + }, + "required": [ + "base_measure", + "conversion_measure", + "entity" + ], + "title": "ConversionTypeParams", + "type": "object" + }, + "CumulativeMetric": { + "additionalProperties": false, + "properties": { + "name": { + "pattern": "(?!.*__).*^[a-z][a-z0-9_]*[a-z0-9]$", + "title": "Name", + "type": "string" + }, + "description": { + "anyOf": [ + { + "type": "string" + } + ], + "default": null, + "title": "Description" + }, + "filter": { + "anyOf": [ + { + "type": "string" + } + ], + "default": null, + "title": "Filter" + }, + "group": { + "anyOf": [ + { + "$ref": "#/$defs/GroupName" + } + ], + "default": null + }, + "label": { + "title": "Label", + "type": "string" + }, + "type": { + "$ref": "#/$defs/CumulativeMetricType" + }, + "type_params": { + "$ref": "#/$defs/CumulativeMetricTypeParams" + } + }, + "required": [ + "name", + "label", + "type", + "type_params" + ], + "title": "CumulativeMetric", + "type": "object" + }, + "CumulativeMetricType": { + "enum": [ + "CUMULATIVE", + "cumulative" + ], + "title": "CumulativeMetricType", + "type": "string" + }, + "CumulativeMetricTypeParams": { + "additionalProperties": false, + "properties": { + "grain_to_date": { + "anyOf": [ + { + "$ref": "#/$defs/GrainToDate" + } + ], + "default": null + }, + "measure": { + "anyOf": [ + { + "$ref": "#/$defs/MetricInputMeasure" + } + ], + "default": null + }, + "window": { + "anyOf": [ + { + "type": "string" + } + ], + "default": null, + "title": "Window" + } + }, + "title": "CumulativeMetricTypeParams", + "type": "object" + }, + "DataTests": { + "anyOf": [ + { + "type": "string" + }, + { + "$ref": "#/$defs/RelationshipsTest" + }, + { + "$ref": "#/$defs/AcceptedValuesTest" + }, + { + "$ref": "#/$defs/NotNullTest" + }, + { + "$ref": "#/$defs/UniqueTest" + } + ], + "title": "DataTests" + }, + "Defaults": { + "additionalProperties": false, + "properties": { + "agg_time_dimension": { + "anyOf": [ + { + "type": "string" + } + ], + "default": null, + "title": "Agg Time Dimension" + } + }, + "title": "Defaults", + "type": "object" + }, + "DerivedMetric": { + "additionalProperties": false, + "properties": { + "name": { + "pattern": "(?!.*__).*^[a-z][a-z0-9_]*[a-z0-9]$", + "title": "Name", + "type": "string" + }, + "description": { + "anyOf": [ + { + "type": "string" + } + ], + "default": null, + "title": "Description" + }, + "filter": { + "anyOf": [ + { + "type": "string" + } + ], + "default": null, + "title": "Filter" + }, + "group": { + "anyOf": [ + { + "$ref": "#/$defs/GroupName" + } + ], + "default": null + }, + "label": { + "title": "Label", + "type": "string" + }, + "type": { + "$ref": "#/$defs/DerivedMetricType" + }, + "type_params": { + "$ref": "#/$defs/DerivedMetricTypeParams" + } + }, + "required": [ + "name", + "label", + "type", + "type_params" + ], + "title": "DerivedMetric", + "type": "object" + }, + "DerivedMetricType": { + "enum": [ + "DERIVED", + "derived" + ], + "title": "DerivedMetricType", + "type": "string" + }, + "DerivedMetricTypeParams": { + "additionalProperties": false, + "properties": { + "expr": { + "anyOf": [ + { + "type": "string" + } + ], + "default": null, + "title": "Expr" + }, + "metrics": { + "anyOf": [ + { + "items": { + "$ref": "#/$defs/MetricInputSchema" + }, + "type": "array" + } + ], + "default": null, + "title": "Metrics" + } + }, + "title": "DerivedMetricTypeParams", + "type": "object" + }, + "Dimension": { + "anyOf": [ + { + "$ref": "#/$defs/CategoricalDimension" + }, + { + "$ref": "#/$defs/TimeDimension" + } + ], + "title": "Dimension" + }, + "DimensionTypeParams": { + "additionalProperties": false, + "properties": { + "time_granularity": { + "$ref": "#/$defs/TimeGranularity" + }, + "validity_params": { + "anyOf": [ + { + "$ref": "#/$defs/ValidityParams" + } + ], + "default": null + } + }, + "required": [ + "time_granularity" + ], + "title": "DimensionTypeParams", + "type": "object" + }, + "DocsConfig": { + "additionalProperties": false, + "properties": { + "node_color": { + "anyOf": [ + { + "pattern": "^(#[a-fA-F0-9]{3}|#[a-fA-F0-9]{6}|[^#][a-zA-Z]*)$", + "type": "string" + } + ], + "default": null, + "description": "The color of the node on the DAG in the documentation. It must be an Hex code or a valid CSS color name.", + "title": "Node Color" + }, + "show": { + "anyOf": [ + { + "type": "boolean" + } + ], + "default": true, + "title": "Show" + } + }, + "title": "DocsConfig", + "type": "object" + }, + "Entity": { + "additionalProperties": false, + "properties": { + "name": { + "pattern": "(?!.*__).*^[a-z][a-z0-9_]*[a-z0-9]$", + "title": "Name", + "type": "string" + }, + "type": { + "allOf": [ + { + "$ref": "#/$defs/EntityType" + } + ], + "title": "Entity Type" + }, + "entity": { + "anyOf": [ + { + "type": "string" + } + ], + "default": null, + "title": "Entity" + }, + "expr": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "boolean" + } + ], + "default": null, + "title": "Expr" + } + }, + "required": [ + "name", + "type" + ], + "title": "Entity", + "type": "object" + }, + "EntityType": { + "enum": [ + "PRIMARY", + "UNIQUE", + "FOREIGN", + "NATURAL", + "primary", + "unique", + "foreign", + "natural" + ], + "title": "EntityType", + "type": "string" + }, + "ExpectCSV": { + "properties": { + "format": { + "const": "csv", + "default": "csv", + "enum": [ + "csv" + ], + "title": "Format", + "type": "string" + }, + "rows": { + "anyOf": [ + { + "type": "string" + } + ], + "default": null, + "description": "When `format` is csv or sql, a string containing comma-separated headers and values. Alternatively provide a fixture. Use the pipe character | to create a multi-line string in YAML.", + "title": "Rows" + }, + "fixture": { + "anyOf": [ + { + "type": "string" + } + ], + "default": null, + "description": "Specify the name of a fixture instead of providing `rows`.", + "title": "Fixture" + } + }, + "title": "ExpectCSV", + "type": "object" + }, + "ExpectDict": { + "properties": { + "format": { + "const": "dict", + "default": "dict", + "enum": [ + "dict" + ], + "title": "Format", + "type": "string" + }, + "rows": { + "description": "When `format` is `dict`, each item should be a dictionary containing a key-value pair for each column and its value, e.g. `{id: 1, code: 'ABC'}`", + "items": { + "type": "object" + }, + "title": "Rows", + "type": "array" + } + }, + "required": [ + "rows" + ], + "title": "ExpectDict", + "type": "object" + }, + "ExpectSQL": { + "properties": { + "format": { + "const": "sql", + "default": "sql", + "enum": [ + "sql" + ], + "title": "Format", + "type": "string" + }, + "rows": { + "anyOf": [ + { + "type": "string" + } + ], + "default": null, + "description": "When `format` is csv or sql, a string containing comma-separated headers and values. Alternatively provide a fixture. Use the pipe character | to create a multi-line string in YAML.", + "title": "Rows" + }, + "fixture": { + "anyOf": [ + { + "type": "string" + } + ], + "default": null, + "description": "Specify the name of a fixture instead of providing `rows`.", + "title": "Fixture" + } + }, + "title": "ExpectSQL", + "type": "object" + }, + "Export": { + "additionalProperties": false, + "properties": { + "name": { + "title": "Name", + "type": "string" + }, + "config": { + "anyOf": [ + { + "$ref": "#/$defs/ExportConfig" + } + ], + "default": null, + "title": "Export Config" + } + }, + "required": [ + "name" + ], + "title": "Export", + "type": "object" + }, + "ExportAs": { + "enum": [ + "table", + "view", + "cache" + ], + "title": "ExportAs", + "type": "string" + }, + "ExportConfig": { + "additionalProperties": true, + "properties": { + "alias": { + "anyOf": [ + { + "type": "string" + } + ], + "default": null, + "title": "Alias" + }, + "export_as": { + "anyOf": [ + { + "$ref": "#/$defs/ExportAs" + } + ], + "default": null + }, + "schema": { + "anyOf": [ + { + "type": "string" + } + ], + "default": null, + "title": "Schema" + } + }, + "title": "ExportConfig", + "type": "object" + }, + "Exposure": { + "properties": { + "name": { + "title": "Name", + "type": "string" + }, + "description": { + "anyOf": [ + { + "type": "string" + } + ], + "default": null, + "title": "Description" + }, + "type": { + "$ref": "#/$defs/Type" + }, + "depends_on": { + "items": { + "type": "string" + }, + "title": "Depends On", + "type": "array" + }, + "label": { + "anyOf": [ + { + "type": "string" + } + ], + "default": null, + "title": "Label" + }, + "maturity": { + "anyOf": [ + { + "$ref": "#/$defs/Maturity" + } + ], + "default": null + }, + "meta": { + "anyOf": [ + { + "type": "object" + } + ], + "default": null, + "title": "Meta" + }, + "owner": { + "anyOf": [ + { + "$ref": "#/$defs/OwnerWithEmail" + }, + { + "$ref": "#/$defs/OwnerWithName" + } + ], + "title": "Owner" + }, + "tags": { + "anyOf": [ + { + "$ref": "#/$defs/StringOrArrayOfStrings" + } + ], + "default": null + }, + "url": { + "anyOf": [ + { + "type": "string" + } + ], + "default": null, + "title": "Url" + } + }, + "required": [ + "name", + "type", + "depends_on", + "owner" + ], + "title": "Exposure", + "type": "object" + }, + "Format": { + "enum": [ + "csv", + "dict", + "sql" + ], + "title": "Format", + "type": "string" + }, + "FreshnessDefinition": { + "additionalProperties": false, + "properties": { + "warn_after": { + "anyOf": [ + { + "$ref": "#/$defs/FreshnessRules" + } + ], + "default": { + "count": 1.0, + "period": "hour" + } + }, + "error_after": { + "anyOf": [ + { + "$ref": "#/$defs/FreshnessRules" + } + ], + "default": { + "count": 1.0, + "period": "day" + } + }, + "filter": { + "anyOf": [ + { + "type": "string" + } + ], + "default": "", + "title": "Filter" + } + }, + "title": "FreshnessDefinition", + "type": "object" + }, + "FreshnessRules": { + "additionalProperties": false, + "properties": { + "count": { + "$ref": "#/$defs/NumberOrJinjaString" + }, + "period": { + "$ref": "#/$defs/Period" + } + }, + "required": [ + "count", + "period" + ], + "title": "FreshnessRules", + "type": "object" + }, + "GivenItem": { + "properties": { + "fixture": { + "anyOf": [ + { + "type": "string" + } + ], + "default": null, + "description": "Only relevant when format is csv. Specify the name of a fixture instead of providing `rows`.", + "title": "Fixture" + }, + "format": { + "anyOf": [ + { + "$ref": "#/$defs/Format" + } + ], + "default": null, + "description": "Defaults to `dict` when not specified" + }, + "input": { + "anyOf": [ + { + "type": "string" + } + ], + "default": null, + "description": "The relation whose inputs you need to mock. Enclose in ref or source without curly braces", + "examples": [ + "ref('model_b')", + "ref('upstream_project', 'model_b')", + "source('schema', 'table')" + ], + "title": "Input" + }, + "additionalProperties": { + "anyOf": [ + {} + ], + "default": null, + "title": "Additionalproperties" + } + }, + "title": "GivenItem", + "type": "object" + }, + "GrainToDate": { + "enum": [ + "day", + "week", + "month", + "quarter", + "year" + ], + "title": "GrainToDate", + "type": "string" + }, + "Grants": { + "additionalProperties": { + "$ref": "#/$defs/StringOrArrayOfStrings" + }, + "description": "grant config. each key is a database permission and the value is the grantee of that permission", + "title": "Grants", + "type": "object" + }, + "Group": { + "additionalProperties": false, + "properties": { + "name": { + "title": "Name", + "type": "string" + }, + "owner": { + "anyOf": [ + { + "$ref": "#/$defs/OwnerWithEmail" + }, + { + "$ref": "#/$defs/OwnerWithName" + } + ], + "title": "Owner" + } + }, + "required": [ + "name", + "owner" + ], + "title": "Group", + "type": "object" + }, + "GroupName": { + "title": "GroupName", + "type": "string" + }, + "IncludeExclude": { + "properties": { + "exclude": { + "anyOf": [ + { + "$ref": "#/$defs/StringOrArrayOfStrings" + } + ], + "default": null + }, + "include": { + "anyOf": [ + { + "$ref": "#/$defs/StringOrArrayOfStrings" + } + ], + "default": null + } + }, + "title": "IncludeExclude", + "type": "object" + }, + "JinjaString": { + "pattern": "\\{\\{.*\\}\\}", + "title": "JinjaString", + "type": "string" + }, + "Macro": { + "additionalProperties": false, + "properties": { + "name": { + "title": "Name", + "type": "string" + }, + "description": { + "anyOf": [ + { + "type": "string" + } + ], + "default": null, + "title": "Description" + }, + "arguments": { + "anyOf": [ + { + "items": { + "$ref": "#/$defs/Argument" + }, + "type": "array" + } + ], + "default": null, + "title": "Arguments" + }, + "docs": { + "anyOf": [ + { + "$ref": "#/$defs/DocsConfig" + } + ], + "default": null + } + }, + "required": [ + "name" + ], + "title": "Macro", + "type": "object" + }, + "Maturity": { + "enum": [ + "high", + "medium", + "low" + ], + "title": "Maturity", + "type": "string" + }, + "Measure": { + "additionalProperties": false, + "properties": { + "name": { + "pattern": "(?!.*__).*^[a-z][a-z0-9_]*[a-z0-9]$", + "title": "Name", + "type": "string" + }, + "description": { + "anyOf": [ + { + "type": "string" + } + ], + "default": null, + "title": "Description" + }, + "agg": { + "$ref": "#/$defs/Agg" + }, + "agg_params": { + "anyOf": [ + { + "$ref": "#/$defs/AggregationTypeParams" + } + ], + "default": null + }, + "agg_time_dimension": { + "anyOf": [ + { + "pattern": "(?!.*__).*^[a-z][a-z0-9_]*[a-z0-9]$", + "type": "string" + } + ], + "default": null, + "title": "Agg Time Dimension" + }, + "create_metric": { + "anyOf": [ + { + "type": "boolean" + } + ], + "default": null, + "title": "Create Metric" + }, + "create_metric_display_name": { + "anyOf": [ + { + "type": "string" + } + ], + "default": null, + "title": "Create Metric Display Name" + }, + "expr": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "integer" + }, + { + "type": "boolean" + } + ], + "default": null, + "title": "Expr" + }, + "label": { + "anyOf": [ + { + "type": "string" + } + ], + "default": null, + "title": "Label" + }, + "non_additive_dimension": { + "anyOf": [ + { + "$ref": "#/$defs/NonAdditiveDimension" + } + ], + "default": null + } + }, + "required": [ + "name", + "agg" + ], + "title": "Measure", + "type": "object" + }, + "MetricInputMeasure": { + "additionalProperties": false, + "properties": { + "name": { + "anyOf": [ + { + "type": "string" + } + ], + "default": null, + "title": "Name" + }, + "fill_nulls_with": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "integer" + } + ], + "default": null, + "title": "Fill Nulls With" + }, + "filter": { + "anyOf": [ + { + "type": "string" + } + ], + "default": null, + "title": "Filter" + }, + "join_to_timespine": { + "anyOf": [ + { + "type": "boolean" + } + ], + "default": null, + "title": "Join To Timespine" + } + }, + "title": "MetricInputMeasure", + "type": "object" + }, + "MetricInputSchema": { + "additionalProperties": false, + "properties": { + "name": { + "anyOf": [ + { + "type": "string" + } + ], + "default": null, + "title": "Name" + }, + "alias": { + "anyOf": [ + { + "type": "string" + } + ], + "default": null, + "title": "Alias" + }, + "filter": { + "anyOf": [ + { + "type": "string" + } + ], + "default": null, + "title": "Filter" + }, + "offset_window": { + "anyOf": [ + { + "type": "string" + } + ], + "default": null, + "title": "Offset Window" + } + }, + "title": "MetricInputSchema", + "type": "object" + }, + "Model": { + "additionalProperties": false, + "properties": { + "name": { + "title": "Name", + "type": "string" + }, + "description": { + "anyOf": [ + { + "type": "string" + } + ], + "default": null, + "title": "Description" + }, + "access": { + "anyOf": [ + { + "$ref": "#/$defs/Access" + } + ], + "default": null + }, + "columns": { + "anyOf": [ + { + "items": { + "$ref": "#/$defs/ColumnProperties" + }, + "type": "array" + } + ], + "default": null, + "title": "Columns" + }, + "config": { + "anyOf": [ + { + "$ref": "#/$defs/ModelConfigs" + } + ], + "default": null + }, + "constraints": { + "anyOf": [ + { + "$ref": "#/$defs/Constraints" + } + ], + "default": null + }, + "data_tests": { + "anyOf": [ + { + "items": { + "$ref": "#/$defs/DataTests" + }, + "type": "array" + } + ], + "default": null, + "title": "Data Tests" + }, + "deprecation_date": { + "anyOf": [ + { + "type": "string" + } + ], + "default": null, + "title": "Deprecation Date" + }, + "docs": { + "anyOf": [ + { + "$ref": "#/$defs/DocsConfig" + } + ], + "default": null + }, + "group": { + "anyOf": [ + { + "$ref": "#/$defs/GroupName" + } + ], + "default": null + }, + "latest_version": { + "anyOf": [ + { + "type": "number" + } + ], + "default": null, + "title": "Latest Version" + }, + "meta": { + "anyOf": [ + { + "type": "object" + } + ], + "default": null, + "title": "Meta" + }, + "tests": { + "anyOf": [ + { + "items": { + "$ref": "#/$defs/DataTests" + }, + "type": "array" + } + ], + "default": null, + "title": "Tests" + }, + "versions": { + "anyOf": [ + { + "items": { + "$ref": "#/$defs/Version" + }, + "type": "array" + } + ], + "default": null, + "title": "Versions" + } + }, + "required": [ + "name" + ], + "title": "Model", + "type": "object" + }, + "ModelConfigs": { + "properties": { + "auto_refresh": { + "anyOf": [ + { + "$ref": "#/$defs/BooleanOrJinjaString" + } + ], + "default": null + }, + "backup": { + "anyOf": [ + { + "$ref": "#/$defs/BooleanOrJinjaString" + } + ], + "default": null + }, + "contract": { + "anyOf": [ + { + "$ref": "#/$defs/Contract" + } + ], + "default": null + }, + "file_format": { + "anyOf": [ + { + "type": "string" + } + ], + "default": null, + "title": "File Format" + }, + "grant_access_to": { + "anyOf": [ + { + "items": { + "$ref": "#/$defs/AuthorizedView" + }, + "type": "array" + } + ], + "default": null, + "description": "Configuration, specific to BigQuery adapter, used to setup authorized views.", + "title": "Authorized views" + }, + "grants": { + "anyOf": [ + { + "$ref": "#/$defs/Grants" + } + ], + "default": null + }, + "hours_to_expiration": { + "anyOf": [ + { + "type": "number" + } + ], + "default": null, + "description": "Configuration specific to BigQuery adapter used to set an expiration delay (in hours) to a table.", + "title": "Hours To Expiration" + }, + "kms_key_name": { + "anyOf": [ + { + "pattern": "projects/[a-zA-Z0-9_-]*/locations/[a-zA-Z0-9_-]*/keyRings/.*/cryptoKeys/.*", + "type": "string" + } + ], + "default": null, + "description": "Configuration of the KMS key name, specific to BigQuery adapter.", + "title": "Kms Key Name" + }, + "labels": { + "anyOf": [ + { + "additionalProperties": { + "type": "string" + }, + "type": "object" + } + ], + "default": null, + "description": "Configuration specific to BigQuery adapter used to add labels and tags to tables/views created by dbt.", + "title": "Label configs" + }, + "location": { + "anyOf": [ + { + "type": "string" + } + ], + "default": null, + "title": "Location" + }, + "materialized": { + "anyOf": [ + { + "type": "string" + } + ], + "default": null, + "title": "Materialized" + }, + "on_configuration_change": { + "anyOf": [ + { + "$ref": "#/$defs/OnConfigurationChange" + } + ], + "default": null + }, + "on_schema_change": { + "anyOf": [ + { + "$ref": "#/$defs/OnSchemaChange" + } + ], + "default": null + }, + "snowflake_warehouse": { + "anyOf": [ + { + "type": "string" + } + ], + "default": null, + "title": "Snowflake Warehouse" + }, + "sql_header": { + "anyOf": [ + { + "type": "string" + } + ], + "default": null, + "title": "Sql Header" + }, + "target_lag": { + "anyOf": [ + { + "pattern": "^(?:downstream|\\d+\\s*(?:seconds|minutes|hours|days))$", + "type": "string" + } + ], + "default": null, + "title": "Target Lag" + } + }, + "title": "ModelConfigs", + "type": "object" + }, + "NonAdditiveDimension": { + "additionalProperties": false, + "properties": { + "name": { + "title": "Name", + "type": "string" + }, + "window_choice": { + "anyOf": [ + { + "$ref": "#/$defs/WindowChoice" + } + ], + "default": null + }, + "window_groupings": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + } + ], + "default": null, + "title": "Window Groupings" + } + }, + "required": [ + "name" + ], + "title": "NonAdditiveDimension", + "type": "object" + }, + "NotNull": { + "properties": { + "name": { + "anyOf": [ + { + "type": "string" + } + ], + "default": null, + "title": "Name" + }, + "config": { + "anyOf": [ + { + "$ref": "#/$defs/TestConfigs" + } + ], + "default": null + }, + "where": { + "anyOf": [ + { + "type": "string" + } + ], + "default": null, + "title": "Where" + } + }, + "title": "NotNull", + "type": "object" + }, + "NotNullTest": { + "properties": { + "not_null": { + "anyOf": [ + { + "$ref": "#/$defs/NotNull" + } + ], + "default": null + } + }, + "title": "NotNullTest", + "type": "object" + }, + "NumberOrJinjaString": { + "anyOf": [ + { + "$ref": "#/$defs/JinjaString" + }, + { + "type": "number" + } + ], + "title": "NumberOrJinjaString" + }, + "OnConfigurationChange": { + "enum": [ + "apply", + "continue", + "fail" + ], + "title": "OnConfigurationChange", + "type": "string" + }, + "OnSchemaChange": { + "enum": [ + "append_new_columns", + "fail", + "ignore", + "sync_all_columns" + ], + "title": "OnSchemaChange", + "type": "string" + }, + "Overrides": { + "additionalProperties": false, + "properties": { + "env_vars": { + "anyOf": [ + { + "type": "object" + } + ], + "default": null, + "title": "Env Vars" + }, + "macros": { + "anyOf": [ + { + "type": "object" + } + ], + "default": null, + "examples": [ + { + "is_incremental": "true" + } + ], + "title": "Macros" + }, + "vars": { + "anyOf": [ + { + "type": "object" + } + ], + "default": null, + "title": "Vars" + } + }, + "title": "Overrides", + "type": "object" + }, + "OwnerWithEmail": { + "additionalProperties": false, + "properties": { + "email": { + "title": "Email", + "type": "string" + } + }, + "required": [ + "email" + ], + "title": "OwnerWithEmail", + "type": "object" + }, + "OwnerWithName": { + "additionalProperties": false, + "properties": { + "name": { + "title": "Name", + "type": "string" + } + }, + "required": [ + "name" + ], + "title": "OwnerWithName", + "type": "object" + }, + "Period": { + "enum": [ + "minute", + "hour", + "day" + ], + "title": "Period", + "type": "string" + }, + "PersistDocsConfig": { + "additionalProperties": false, + "properties": { + "columns": { + "anyOf": [ + { + "$ref": "#/$defs/BooleanOrJinjaString" + } + ] + }, + "relation": { + "anyOf": [ + { + "$ref": "#/$defs/BooleanOrJinjaString" + } + ] + } + }, + "title": "PersistDocsConfig", + "type": "object" + }, + "QueryParams": { + "properties": { + "dimensions": { + "anyOf": [ + { + "$ref": "#/$defs/ArrayOfStrings" + } + ], + "default": null + }, + "metrics": { + "anyOf": [ + { + "$ref": "#/$defs/ArrayOfStrings" + } + ], + "default": null + }, + "where": { + "anyOf": [ + { + "$ref": "#/$defs/ArrayOfStrings" + } + ], + "default": null + }, + "additionalProperties": { + "anyOf": [ + {} + ], + "default": null, + "title": "Additionalproperties" + } + }, + "title": "QueryParams", + "type": "object" + }, + "Quoting": { + "additionalProperties": false, + "properties": { + "database": { + "anyOf": [ + { + "$ref": "#/$defs/BooleanOrJinjaString" + } + ], + "default": null + }, + "identifier": { + "anyOf": [ + { + "$ref": "#/$defs/BooleanOrJinjaString" + } + ], + "default": null + }, + "schema": { + "anyOf": [ + { + "$ref": "#/$defs/BooleanOrJinjaString" + } + ], + "default": null + } + }, + "title": "Quoting", + "type": "object" + }, + "RatioMetric": { + "additionalProperties": false, + "properties": { + "name": { + "pattern": "(?!.*__).*^[a-z][a-z0-9_]*[a-z0-9]$", + "title": "Name", + "type": "string" + }, + "description": { + "anyOf": [ + { + "type": "string" + } + ], + "default": null, + "title": "Description" + }, + "filter": { + "anyOf": [ + { + "type": "string" + } + ], + "default": null, + "title": "Filter" + }, + "group": { + "anyOf": [ + { + "$ref": "#/$defs/GroupName" + } + ], + "default": null + }, + "label": { + "title": "Label", + "type": "string" + }, + "type": { + "$ref": "#/$defs/RatioMetricType" + }, + "type_params": { + "$ref": "#/$defs/RatioMetricTypeParams" + } + }, + "required": [ + "name", + "label", + "type", + "type_params" + ], + "title": "RatioMetric", + "type": "object" + }, + "RatioMetricType": { + "enum": [ + "RATIO", + "ratio" + ], + "title": "RatioMetricType", + "type": "string" + }, + "RatioMetricTypeParams": { + "additionalProperties": false, + "properties": { + "denominator": { + "anyOf": [ + { + "$ref": "#/$defs/MetricInputSchema" + } + ], + "default": null + }, + "filter": { + "anyOf": [ + { + "type": "string" + } + ], + "default": null, + "title": "Filter" + }, + "numerator": { + "anyOf": [ + { + "$ref": "#/$defs/MetricInputSchema" + } + ], + "default": null + } + }, + "title": "RatioMetricTypeParams", + "type": "object" + }, + "Relationships": { + "properties": { + "name": { + "anyOf": [ + { + "type": "string" + } + ], + "default": null, + "title": "Name" + }, + "config": { + "anyOf": [ + { + "$ref": "#/$defs/TestConfigs" + } + ], + "default": null + }, + "field": { + "description": "The foreign key column", + "title": "Relationships: Field", + "type": "string" + }, + "to": { + "examples": [ + "ref('parent_model')", + "source('parent_schema', 'parent_table')" + ], + "title": "To", + "type": "string" + }, + "where": { + "anyOf": [ + { + "type": "string" + } + ], + "default": null, + "title": "Where" + } + }, + "required": [ + "field", + "to" + ], + "title": "Relationships", + "type": "object" + }, + "RelationshipsTest": { + "properties": { + "relationships": { + "anyOf": [ + { + "$ref": "#/$defs/Relationships" + } + ], + "default": null + } + }, + "title": "RelationshipsTest", + "type": "object" + }, + "SavedQuery": { + "additionalProperties": false, + "properties": { + "name": { + "title": "Name", + "type": "string" + }, + "description": { + "title": "Description", + "type": "string" + }, + "exports": { + "anyOf": [ + { + "items": { + "$ref": "#/$defs/Export" + }, + "type": "array" + } + ], + "default": null, + "title": "Exports" + }, + "label": { + "title": "Label", + "type": "string" + }, + "query_params": { + "$ref": "#/$defs/QueryParams" + } + }, + "required": [ + "name", + "description", + "label", + "query_params" + ], + "title": "SavedQuery", + "type": "object" + }, + "Seed": { + "additionalProperties": false, + "properties": { + "name": { + "title": "Name", + "type": "string" + }, + "description": { + "anyOf": [ + { + "type": "string" + } + ], + "default": null, + "title": "Description" + }, + "columns": { + "anyOf": [ + { + "items": { + "$ref": "#/$defs/ColumnProperties" + }, + "type": "array" + } + ], + "default": null, + "title": "Columns" + }, + "config": { + "anyOf": [ + { + "$ref": "#/$defs/SeedConfig" + } + ], + "default": null, + "title": "Seed Config" + }, + "docs": { + "anyOf": [ + { + "$ref": "#/$defs/DocsConfig" + } + ], + "default": null + }, + "group": { + "anyOf": [ + { + "$ref": "#/$defs/GroupName" + } + ], + "default": null + }, + "tests": { + "anyOf": [ + { + "items": { + "$ref": "#/$defs/DataTests" + }, + "type": "array" + } + ], + "default": null, + "title": "Tests" + } + }, + "required": [ + "name" + ], + "title": "Seed", + "type": "object" + }, + "SeedConfig": { + "properties": { + "column_types": { + "anyOf": [ + { + "type": "object" + } + ], + "default": null, + "title": "Column Types" + }, + "copy_grants": { + "anyOf": [ + { + "$ref": "#/$defs/BooleanOrJinjaString" + } + ], + "default": null + }, + "data_tests": { + "anyOf": [ + { + "items": { + "$ref": "#/$defs/DataTests" + }, + "type": "array" + } + ], + "default": null, + "title": "Data Tests" + }, + "database": { + "anyOf": [ + { + "type": "string" + } + ], + "default": null, + "title": "Database" + }, + "enabled": { + "anyOf": [ + { + "$ref": "#/$defs/BooleanOrJinjaString" + } + ], + "default": null + }, + "grants": { + "anyOf": [ + { + "$ref": "#/$defs/Grants" + } + ], + "default": null + }, + "quote_columns": { + "anyOf": [ + { + "$ref": "#/$defs/BooleanOrJinjaString" + } + ], + "default": null + }, + "schema": { + "anyOf": [ + { + "type": "string" + } + ], + "default": null, + "title": "Schema" + } + }, + "title": "SeedConfig", + "type": "object" + }, + "SemanticModel": { + "additionalProperties": false, + "properties": { + "name": { + "pattern": "(?!.*__).*^[a-z][a-z0-9_]*[a-z0-9]$", + "title": "Name", + "type": "string" + }, + "description": { + "anyOf": [ + { + "type": "string" + } + ], + "default": null, + "title": "Description" + }, + "defaults": { + "anyOf": [ + { + "$ref": "#/$defs/Defaults" + } + ], + "default": null + }, + "dimensions": { + "anyOf": [ + { + "items": { + "$ref": "#/$defs/Dimension" + }, + "type": "array" + } + ], + "default": null, + "title": "Dimensions" + }, + "entities": { + "anyOf": [ + { + "items": { + "$ref": "#/$defs/Entity" + }, + "type": "array" + } + ], + "default": null, + "title": "Entities" + }, + "measures": { + "anyOf": [ + { + "items": { + "$ref": "#/$defs/Measure" + }, + "type": "array" + } + ], + "default": null, + "title": "Measures" + }, + "model": { + "title": "Model", + "type": "string" + }, + "primary_entity": { + "anyOf": [ + { + "type": "string" + } + ], + "default": null, + "title": "Primary Entity" + } + }, + "required": [ + "name", + "model" + ], + "title": "SemanticModel", + "type": "object" + }, + "Severity": { + "enum": [ + "warn", + "error" + ], + "title": "Severity", + "type": "string" + }, + "SimpleMetric": { + "additionalProperties": false, + "properties": { + "name": { + "pattern": "(?!.*__).*^[a-z][a-z0-9_]*[a-z0-9]$", + "title": "Name", + "type": "string" + }, + "description": { + "anyOf": [ + { + "type": "string" + } + ], + "default": null, + "title": "Description" + }, + "filter": { + "anyOf": [ + { + "type": "string" + } + ], + "default": null, + "title": "Filter" + }, + "group": { + "anyOf": [ + { + "$ref": "#/$defs/GroupName" + } + ], + "default": null + }, + "label": { + "title": "Label", + "type": "string" + }, + "type": { + "$ref": "#/$defs/SimpleMetricType" + }, + "type_params": { + "$ref": "#/$defs/SimpleMetricTypeParams" + } + }, + "required": [ + "name", + "label", + "type", + "type_params" + ], + "title": "SimpleMetric", + "type": "object" + }, + "SimpleMetricType": { + "enum": [ + "SIMPLE", + "simple" + ], + "title": "SimpleMetricType", + "type": "string" + }, + "SimpleMetricTypeParams": { + "additionalProperties": false, + "properties": { + "measure": { + "anyOf": [ + { + "$ref": "#/$defs/MetricInputMeasure" + } + ], + "default": null + } + }, + "title": "SimpleMetricTypeParams", + "type": "object" + }, + "Snapshot": { + "additionalProperties": false, + "properties": { + "name": { + "title": "Name", + "type": "string" + }, + "description": { + "anyOf": [ + { + "type": "string" + } + ], + "default": null, + "title": "Description" + }, + "columns": { + "anyOf": [ + { + "items": { + "$ref": "#/$defs/ColumnProperties" + }, + "type": "array" + } + ], + "default": null, + "title": "Columns" + }, + "config": { + "anyOf": [ + { + "$ref": "#/$defs/SnapshotConfig" + } + ], + "default": null, + "title": "Snapshot Config" + }, + "data_tests": { + "anyOf": [ + { + "items": { + "$ref": "#/$defs/DataTests" + }, + "type": "array" } - }, - "entities": { - "type": "array", - "items": { - "$ref": "#/$defs/entity" + ], + "default": null, + "title": "Data Tests" + }, + "docs": { + "anyOf": [ + { + "$ref": "#/$defs/DocsConfig" } - }, - "measures": { - "type": "array", - "items": { - "$ref": "#/$defs/measure" + ], + "default": null + }, + "group": { + "anyOf": [ + { + "$ref": "#/$defs/GroupName" } - }, - "model": { - "type": "string", - "default": "ref('')" - }, - "primary_entity": { - "type": "string" - } + ], + "default": null }, - "additionalProperties": false - } - }, - "snapshots": { - "type": "array", - "items": { - "type": "object", - "required": [ - "name" - ], - "properties": { - "name": { - "type": "string" - }, - "description": { - "type": "string" - }, - "columns": { - "type": "array", - "items": { - "$ref": "#/$defs/column_properties" + "meta": { + "anyOf": [ + { + "type": "object" } - }, - "config": { - "title": "Snapshot Config", - "type": "object", - "properties": { - "alias": { - "type": "string" - }, - "check_cols": { - "$ref": "#/$defs/string_or_array_of_strings" - }, - "enabled": { - "$ref": "#/$defs/boolean_or_jinja_string" - }, - "grants": { - "$ref": "#/$defs/grants" - }, - "persist_docs": { - "$ref": "#/$defs/persist_docs_config" - }, - "post-hook": { - "$ref": "#/$defs/array_of_strings" - }, - "pre-hook": { - "$ref": "#/$defs/array_of_strings" - }, - "quote_columns": { - "$ref": "#/$defs/boolean_or_jinja_string" - }, - "strategy": { - "type": "string" - }, - "tags": { - "$ref": "#/$defs/string_or_array_of_strings" - }, - "target_database": { - "type": "string" - }, - "target_schema": { - "type": "string" - }, - "unique_key": { - "$ref": "#/$defs/string_or_array_of_strings" + ], + "default": null, + "title": "Meta" + }, + "tests": { + "anyOf": [ + { + "items": { + "$ref": "#/$defs/DataTests" }, - "updated_at": { - "type": "string" - } + "type": "array" } - }, - "data_tests": { - "type": "array", - "items": { - "$ref": "#/$defs/data_tests" + ], + "default": null, + "title": "Tests" + } + }, + "required": [ + "name" + ], + "title": "Snapshot", + "type": "object" + }, + "SnapshotConfig": { + "properties": { + "alias": { + "anyOf": [ + { + "type": "string" } - }, - "docs": { - "$ref": "#/$defs/docs_config" - }, - "group": { - "$ref": "#/$defs/group_name" - }, - "meta": { - "type": "object" - }, - "tests": { - "type": "array", - "items": { - "$ref": "#/$defs/data_tests" + ], + "default": null, + "title": "Alias" + }, + "check_cols": { + "anyOf": [ + { + "$ref": "#/$defs/StringOrArrayOfStrings" } - } + ], + "default": null }, - "additionalProperties": false - } - }, - "sources": { - "type": "array", - "items": { - "type": "object", - "required": [ - "name" - ], - "properties": { - "name": { - "description": "How you will identify the schema in {{ source() }} calls. Unless `schema` is also set, this will be the name of the schema in the database.", - "type": "string" - }, - "description": { - "type": "string" - }, - "config": { - "type": "object" - }, - "data_tests": { - "type": "array", - "items": { - "$ref": "#/$defs/data_tests" + "enabled": { + "anyOf": [ + { + "$ref": "#/$defs/BooleanOrJinjaString" } - }, - "database": { - "type": "string" - }, - "freshness": { - "$ref": "#/$defs/freshness_definition" - }, - "loaded_at_field": { - "type": "string" - }, - "loader": { - "type": "string" - }, - "meta": { - "type": "object" - }, - "overrides": { - "title": "Package to Override", - "description": "The name of another package installed in your project. If that package has a source with the same name as this one, its properties will be applied on top of the base properties of the overridden source. https://docs.getdbt.com/reference/resource-properties/overrides", - "type": "string" - }, - "quoting": { - "type": "object", - "properties": { - "database": { - "$ref": "#/$defs/boolean_or_jinja_string" - }, - "identifier": { - "$ref": "#/$defs/boolean_or_jinja_string" - }, - "schema": { - "$ref": "#/$defs/boolean_or_jinja_string" - } - }, - "additionalProperties": false - }, - "schema": { - "description": "The schema name as stored in the database. Only needed if you want to use a different `name` than what exists in the database (otherwise `name` is used by default)", - "type": "string" - }, - "tables": { - "type": "array", - "items": { - "type": "object", - "required": [ - "name" - ], - "properties": { - "name": { - "title": "Name", - "description": "How you will identify the table in {{ source() }} calls. Unless `identifier` is also set, this will be the name of the table in the database.", - "type": "string" - }, - "description": { - "type": "string" - }, - "columns": { - "type": "array", - "items": { - "$ref": "#/$defs/column_properties" - } - }, - "external": { - "type": "object" - }, - "freshness": { - "$ref": "#/$defs/freshness_definition" - }, - "identifier": { - "title": "Identifier", - "description": "The table name as stored in the database. Only needed if you want to give the source a different name than what exists in the database (otherwise `name` is used by default)", - "type": "string" - }, - "loaded_at_field": { - "description": "Which column to check during data freshness tests. Only needed if the table has a different loaded_at_field to the one defined on the source overall.", - "type": "string" - }, - "loader": { - "type": "string" - }, - "meta": { - "type": "object" - }, - "quoting": { - "type": "object", - "properties": { - "database": { - "$ref": "#/$defs/boolean_or_jinja_string" - }, - "identifier": { - "$ref": "#/$defs/boolean_or_jinja_string" - }, - "schema": { - "$ref": "#/$defs/boolean_or_jinja_string" - } - }, - "additionalProperties": false - }, - "tags": { - "$ref": "#/$defs/string_or_array_of_strings" - }, - "tests": { - "type": "array", - "items": { - "$ref": "#/$defs/data_tests" - } - } - }, - "additionalProperties": false + ], + "default": null + }, + "grants": { + "anyOf": [ + { + "$ref": "#/$defs/Grants" } - }, - "tags": { - "$ref": "#/$defs/string_or_array_of_strings" - }, - "tests": { - "type": "array", - "items": { - "$ref": "#/$defs/data_tests" + ], + "default": null + }, + "persist_docs": { + "anyOf": [ + { + "$ref": "#/$defs/PersistDocsConfig" } - } + ], + "default": null + }, + "post-hook": { + "anyOf": [ + { + "$ref": "#/$defs/ArrayOfStrings" + } + ], + "default": null + }, + "pre-hook": { + "anyOf": [ + { + "$ref": "#/$defs/ArrayOfStrings" + } + ], + "default": null + }, + "quote_columns": { + "anyOf": [ + { + "$ref": "#/$defs/BooleanOrJinjaString" + } + ], + "default": null + }, + "strategy": { + "anyOf": [ + { + "type": "string" + } + ], + "default": null, + "title": "Strategy" + }, + "tags": { + "anyOf": [ + { + "$ref": "#/$defs/StringOrArrayOfStrings" + } + ], + "default": null + }, + "target_database": { + "anyOf": [ + { + "type": "string" + } + ], + "default": null, + "title": "Target Database" + }, + "target_schema": { + "anyOf": [ + { + "type": "string" + } + ], + "default": null, + "title": "Target Schema" + }, + "unique_key": { + "anyOf": [ + { + "$ref": "#/$defs/StringOrArrayOfStrings" + } + ], + "default": null + }, + "updated_at": { + "anyOf": [ + { + "type": "string" + } + ], + "default": null, + "title": "Updated At" } - } + }, + "title": "SnapshotConfig", + "type": "object" }, - "unit_tests": { - "type": "array", - "items": { - "type": "object", - "required": [ - "name", - "model", - "expect" - ], - "properties": { - "name": { - "type": "string" - }, - "description": { - "type": "string" - }, - "config": { - "title": "Unit Test Config", - "type": "object", - "properties": { - "meta": { - "type": "object" + "Source": { + "properties": { + "name": { + "description": "How you will identify the schema in {{ source() }} calls. Unless `schema` is also set, this will be the name of the schema in the database.", + "title": "Name", + "type": "string" + }, + "description": { + "anyOf": [ + { + "type": "string" + } + ], + "default": null, + "title": "Description" + }, + "config": { + "anyOf": [ + { + "type": "object" + } + ], + "default": null, + "title": "Config" + }, + "data_tests": { + "anyOf": [ + { + "items": { + "$ref": "#/$defs/DataTests" }, - "tags": { - "$ref": "#/$defs/string_or_array_of_strings" - } - }, - "additionalProperties": false - }, - "expect": { - "type": "object", - "if": { - "properties": { - "format": { - "const": "dict" - } - } + "type": "array" + } + ], + "default": null, + "title": "Data Tests" + }, + "database": { + "anyOf": [ + { + "type": "string" + } + ], + "default": null, + "title": "Database" + }, + "freshness": { + "$comment": "truly_nullable", + "anyOf": [ + { + "$ref": "#/$defs/FreshnessDefinition" }, - "then": { - "properties": { - "rows": { - "description": "When `format` is `dict`, each item should be a dictionary containing a key-value pair for each column and its value, e.g. `{id: 1, code: 'ABC'}`", - "type": "array", - "items": { - "type": "object" - } - } - } + { + "type": "null" + } + ], + "default": { + "warn_after": { + "count": 1.0, + "period": "hour" }, - "else": { - "properties": { - "rows": { - "description": "When `format` is csv or sql, a string containing comma-separated headers and values. Alternatively provide a fixture. Use the pipe character | to create a multi-line string in YAML.", - "type": "string" - } - } + "error_after": { + "count": 1.0, + "period": "day" }, - "properties": { - "fixture": { - "description": "Only relevant when format is csv. Specify the name of a fixture instead of providing `rows`.", - "type": "string" - }, - "format": { - "description": "Defaults to `dict` when not specified", - "type": "string", - "enum": [ - "csv", - "dict", - "sql" - ] - }, - "additionalProperties": false + "filter": "" + } + }, + "loaded_at_field": { + "anyOf": [ + { + "type": "string" + } + ], + "default": null, + "title": "Loaded At Field" + }, + "loader": { + "anyOf": [ + { + "type": "string" + } + ], + "default": null, + "title": "Loader" + }, + "meta": { + "anyOf": [ + { + "type": "object" + } + ], + "default": null, + "title": "Meta" + }, + "overrides": { + "anyOf": [ + { + "type": "string" + } + ], + "default": null, + "description": "The name of another package installed in your project. If that package has a source with the same name as this one, its properties will be applied on top of the base properties of the overridden source. https://docs.getdbt.com/reference/resource-properties/overrides", + "title": "Package to Override" + }, + "quoting": { + "anyOf": [ + { + "$ref": "#/$defs/Quoting" } - }, - "given": { - "type": "array", - "items": { - "type": "object", - "if": { - "properties": { - "format": { - "const": "dict" - } - } - }, - "then": { - "properties": { - "rows": { - "description": "When `format` is `dict`, each item should be a dictionary containing a key-value pair for each column and its value, e.g. `{id: 1, code: 'ABC'}`", - "type": "array", - "items": { - "type": "object" - } - } - } - }, - "else": { - "properties": { - "rows": { - "description": "When `format` is csv or sql, a string containing comma-separated headers and values. Alternatively provide a fixture. Use the pipe character | to create a multi-line string in YAML.", - "type": "string" - } - } - }, - "properties": { - "fixture": { - "description": "Only relevant when format is csv. Specify the name of a fixture instead of providing `rows`.", - "type": "string" - }, - "format": { - "description": "Defaults to `dict` when not specified", - "type": "string", - "enum": [ - "csv", - "dict", - "sql" - ] - }, - "input": { - "description": "The relation whose inputs you need to mock. Enclose in ref or source without curly braces", - "type": "string", - "examples": [ - "ref('model_b')", - "ref('upstream_project', 'model_b')", - "source('schema', 'table')" - ] - }, - "additionalProperties": false - } + ], + "default": null + }, + "schema": { + "anyOf": [ + { + "type": "string" } - }, - "model": { - "description": "The name of the model whose behaviour you are testing. Does not need to be wrapped in a ref.", - "type": "string", - "examples": [ - "my_model" - ] - }, - "overrides": { - "type": "object", - "properties": { - "env_vars": { - "type": "object" - }, - "macros": { - "type": "object", - "examples": [ - { - "is_incremental": "true" - } - ] - }, - "vars": { - "type": "object" - } - }, - "additionalProperties": false - }, - "additionalProperties": false + ], + "default": null, + "description": "The schema name as stored in the database. Only needed if you want to use a different `name` than what exists in the database (otherwise `name` is used by default)", + "title": "Schema" }, - "additionalProperties": false - } - } - }, - "additionalProperties": false, - "$defs": { - "aggregation_type_params": { - "type": "object", - "properties": { - "percentile": { - "type": "number" + "tables": { + "anyOf": [ + { + "items": { + "$ref": "#/$defs/Table" + }, + "type": "array" + } + ], + "default": null, + "title": "Tables" }, - "use_approximate_percentile": { - "type": "boolean" + "tags": { + "anyOf": [ + { + "$ref": "#/$defs/StringOrArrayOfStrings" + } + ], + "default": null }, - "use_discrete_percentile": { - "type": "boolean" + "tests": { + "anyOf": [ + { + "items": { + "$ref": "#/$defs/DataTests" + }, + "type": "array" + } + ], + "default": null, + "title": "Tests" } }, - "additionalProperties": false - }, - "array_of_strings": { - "type": "array", - "items": { - "type": "string" - } + "required": [ + "name" + ], + "title": "Source", + "type": "object" }, - "boolean_or_jinja_string": { - "oneOf": [ + "StringOrArrayOfStrings": { + "anyOf": [ { - "$ref": "#/$defs/jinja_string" + "type": "string" }, { - "type": "boolean" + "$ref": "#/$defs/ArrayOfStrings" } ], - "additionalProperties": false + "title": "StringOrArrayOfStrings" }, - "column_properties": { - "type": "object", - "required": [ - "name" - ], - "uniqueItems": true, + "Table": { + "additionalProperties": false, "properties": { "name": { + "description": "How you will identify the table in {{ source() }} calls. Unless `identifier` is also set, this will be the name of the table in the database.", + "title": "Name", "type": "string" }, "description": { - "type": "string" + "anyOf": [ + { + "type": "string" + } + ], + "default": null, + "title": "Description" }, - "constraints": { - "$ref": "#/$defs/constraints" + "columns": { + "anyOf": [ + { + "items": { + "$ref": "#/$defs/ColumnProperties" + }, + "type": "array" + } + ], + "default": null, + "title": "Columns" }, - "data_tests": { - "type": "array", - "items": { - "$ref": "#/$defs/data_tests" + "external": { + "anyOf": [ + { + "type": "object" + } + ], + "default": null, + "title": "External" + }, + "freshness": { + "$comment": "truly_nullable", + "anyOf": [ + { + "$ref": "#/$defs/FreshnessDefinition" + }, + { + "type": "null" + } + ], + "default": { + "warn_after": { + "count": 1.0, + "period": "hour" + }, + "error_after": { + "count": 1.0, + "period": "day" + }, + "filter": "" } }, - "data_type": { - "type": "string" + "identifier": { + "anyOf": [ + { + "type": "string" + } + ], + "default": null, + "description": "The table name as stored in the database. Only needed if you want to give the source a different name than what exists in the database (otherwise `name` is used by default)", + "title": "Identifier" }, - "meta": { - "type": "object" + "loaded_at_field": { + "anyOf": [ + { + "type": "string" + } + ], + "default": null, + "description": "Which column to check during data freshness tests. Only needed if the table has a different loaded_at_field to the one defined on the source overall.", + "title": "Loaded At Field" }, - "policy_tags": { - "title": "Policy tags", - "description": "Configurations, specific to BigQuery adapter, used to set policy tags on specific columns, enabling column-level security. Only relevant when `persist_docs.columns` is true.", - "type": "array", - "items": { - "type": "string" - } + "loader": { + "anyOf": [ + { + "type": "string" + } + ], + "default": null, + "title": "Loader" }, - "quote": { - "$ref": "#/$defs/boolean_or_jinja_string" + "meta": { + "anyOf": [ + { + "type": "object" + } + ], + "default": null, + "title": "Meta" + }, + "quoting": { + "anyOf": [ + { + "$ref": "#/$defs/Quoting" + } + ], + "default": null }, "tags": { - "$ref": "#/$defs/string_or_array_of_strings" + "anyOf": [ + { + "$ref": "#/$defs/StringOrArrayOfStrings" + } + ], + "default": null }, "tests": { - "type": "array", - "items": { - "$ref": "#/$defs/data_tests" - } + "anyOf": [ + { + "items": { + "$ref": "#/$defs/DataTests" + }, + "type": "array" + } + ], + "default": null, + "title": "Tests" } }, - "additionalProperties": false - }, - "constraints": { - "type": "array", - "items": { - "type": "object", - "required": [ - "type" - ], - "properties": { - "name": { - "type": "string" - }, - "type": { - "type": "string" - }, - "columns": { - "$ref": "#/$defs/string_or_array_of_strings" - }, - "expression": { - "type": "string" - }, - "warn_unenforced": { - "$ref": "#/$defs/boolean_or_jinja_string" - }, - "warn_unsupported": { - "$ref": "#/$defs/boolean_or_jinja_string" - } - } - } + "required": [ + "name" + ], + "title": "Table", + "type": "object" }, - "conversion_metric_type_params": { - "type": "object", + "TestConfigs": { "properties": { - "conversion_type_params": { - "type": "object", - "required": [ - "entity", - "base_measure", - "conversion_measure" - ], - "properties": { - "base_measure": { - "$ref": "#/$defs/metric_input_measure" - }, - "calculation": { - "type": "string", - "default": "conversion_rate", - "enum": [ - "conversions", - "conversion_rate", - "CONVERSIONS", - "CONVERSION_RATE" - ] - }, - "constant_properties": { - "type": "array", - "items": { - "type": "object", - "required": [ - "base_property", - "conversion_property" - ], - "properties": { - "base_property": { - "description": "DIMENSION or ENTITY", - "type": "string" - }, - "conversion_property": { - "description": "DIMENSION or ENTITY", - "type": "string" - } - } - } - }, - "conversion_measure": { - "$ref": "#/$defs/metric_input_measure" - }, - "entity": { - "description": "The entity to calculate over", + "alias": { + "anyOf": [ + { "type": "string" - }, - "window": { + } + ], + "default": null, + "description": "Only relevant when `store_failures` is true", + "title": "Alias" + }, + "database": { + "anyOf": [ + { "type": "string" } - }, - "additionalProperties": false - } - }, - "additionalProperties": false - }, - "cumulative_metric_type_params": { - "type": "object", - "properties": { - "grain_to_date": { - "enum": [ - "day", - "week", - "month", - "quarter", - "year" - ] + ], + "default": null, + "description": "Only relevant when `store_failures` is true", + "title": "Database" }, - "measure": { - "$ref": "#/$defs/metric_input_measure" + "enabled": { + "anyOf": [ + { + "$ref": "#/$defs/BooleanOrJinjaString" + } + ], + "default": null }, - "window": { - "type": "string" - } - }, - "additionalProperties": false - }, - "data_tests": { - "anyOf": [ - { - "type": "string" + "error_if": { + "anyOf": [ + { + "type": "string" + } + ], + "default": null, + "title": "Error If" }, - { - "title": "Relationships Test", - "type": "object", - "properties": { - "relationships": { - "type": "object", - "required": [ - "to", - "field" - ], - "properties": { - "name": { - "type": "string" - }, - "config": { - "$ref": "#/$defs/test_configs" - }, - "field": { - "title": "Relationships: Field", - "description": "The foreign key column", - "type": "string", - "default": "" - }, - "to": { - "type": "string", - "default": "ref('')", - "examples": [ - "ref('parent_model')", - "source('parent_schema', 'parent_table')" - ] - }, - "where": { - "type": "string" - } - } + "fail_calc": { + "anyOf": [ + { + "type": "string" } - } + ], + "default": null, + "title": "Fail Calc" }, - { - "title": "Accepted Values Test", - "type": "object", - "properties": { - "accepted_values": { - "type": "object", - "required": [ - "values" - ], - "properties": { - "name": { - "type": "string" - }, - "config": { - "$ref": "#/$defs/test_configs" - }, - "quote": { - "type": "boolean" - }, - "values": { - "type": "array", - "items": { - "type": "string" - } - }, - "where": { - "type": "string" - } - } + "limit": { + "anyOf": [ + { + "type": "number" } - } + ], + "default": null, + "title": "Limit" }, - { - "title": "Not Null Test", - "type": "object", - "properties": { - "not_null": { - "type": "object", - "properties": { - "name": { - "type": "string" - }, - "config": { - "$ref": "#/$defs/test_configs" - }, - "where": { - "type": "string" - } - } + "schema": { + "anyOf": [ + { + "type": "string" } - } + ], + "default": null, + "description": "Only relevant when `store_failures` is true", + "title": "Schema" }, - { - "title": "Unique Test", - "type": "object", - "properties": { - "unique": { - "type": "object", - "properties": { - "name": { - "type": "string" - }, - "config": { - "$ref": "#/$defs/test_configs" - }, - "where": { - "type": "string" - } - } + "severity": { + "anyOf": [ + { + "$ref": "#/$defs/JinjaString" + }, + { + "$ref": "#/$defs/Severity" + } + ], + "default": null, + "title": "Severity" + }, + "store_failures": { + "anyOf": [ + { + "$ref": "#/$defs/BooleanOrJinjaString" + } + ], + "default": null + }, + "tags": { + "anyOf": [ + { + "$ref": "#/$defs/StringOrArrayOfStrings" } - } - } - ] - }, - "derived_metric_type_params": { - "type": "object", - "properties": { - "expr": { - "type": "string" + ], + "default": null }, - "metrics": { - "type": "array", - "items": { - "$ref": "#/$defs/metric_input_schema" - } + "warn_if": { + "anyOf": [ + { + "type": "string" + } + ], + "default": null, + "title": "Warn If" } }, - "additionalProperties": false + "title": "TestConfigs", + "type": "object" }, - "dimension": { - "type": "object", - "required": [ - "name", - "type" - ], - "anyOf": [ - { - "not": { - "$ref": "#/$defs/is-time-dimension" - } - }, - { - "required": [ - "type_params" - ] - } - ], + "TimeDimension": { + "additionalProperties": false, "properties": { "name": { - "type": "string", - "pattern": "(?!.*__).*^[a-z][a-z0-9_]*[a-z0-9]$" - }, - "description": { + "pattern": "(?!.*__).*^[a-z][a-z0-9_]*[a-z0-9]$", + "title": "Name", "type": "string" }, - "type": { - "title": "Dimension Type", - "enum": [ - "CATEGORICAL", - "TIME", - "categorical", - "time" - ] + "description": { + "anyOf": [ + { + "type": "string" + } + ], + "default": null, + "title": "Description" }, "expr": { - "type": [ - "string", - "boolean" - ] + "anyOf": [ + { + "type": "string" + }, + { + "type": "boolean" + } + ], + "default": null, + "title": "Expr" }, "is_partition": { - "type": "boolean" + "anyOf": [ + { + "type": "boolean" + } + ], + "default": null, + "title": "Is Partition" + }, + "type": { + "$ref": "#/$defs/TimeDimensionType" }, "type_params": { - "$ref": "#/$defs/dimension_type_params" + "$ref": "#/$defs/DimensionTypeParams" } }, - "additionalProperties": false - }, - "dimension_type_params": { - "type": "object", "required": [ - "time_granularity" + "name", + "type", + "type_params" ], - "properties": { - "time_granularity": { - "enum": [ - "DAY", - "WEEK", - "MONTH", - "QUARTER", - "YEAR", - "day", - "week", - "month", - "quarter", - "year" - ] - }, - "validity_params": { - "$ref": "#/$defs/validity_params" - } - }, - "additionalProperties": false + "title": "TimeDimension", + "type": "object" }, - "docs_config": { - "title": "Docs config", - "description": "Configurations for the appearance of nodes in the dbt documentation.", - "type": "object", - "properties": { - "node_color": { - "description": "The color of the node on the DAG in the documentation. It must be an Hex code or a valid CSS color name.", - "type": "string", - "pattern": "^(#[a-fA-F0-9]{3}|#[a-fA-F0-9]{6}|[^#][a-zA-Z]*)$" - }, - "show": { - "type": "boolean", - "default": true - } - }, - "additionalProperties": false + "TimeDimensionType": { + "enum": [ + "TIME", + "time" + ], + "title": "TimeDimensionType", + "type": "string" }, - "entity": { - "type": "object", - "required": [ - "name", - "type" + "TimeGranularity": { + "enum": [ + "DAY", + "WEEK", + "MONTH", + "QUARTER", + "YEAR", + "day", + "week", + "month", + "quarter", + "year" ], - "properties": { - "name": { - "type": "string", - "pattern": "(?!.*__).*^[a-z][a-z0-9_]*[a-z0-9]$" - }, - "type": { - "title": "Entity Type", - "enum": [ - "PRIMARY", - "UNIQUE", - "FOREIGN", - "NATURAL", - "primary", - "unique", - "foreign", - "natural" - ] - }, - "entity": { - "type": "string" - }, - "expr": { - "type": [ - "string", - "boolean" - ] - } - }, - "additionalProperties": false + "title": "TimeGranularity", + "type": "string" }, - "export": { - "type": "object", - "required": [ - "name" + "Type": { + "enum": [ + "dashboard", + "notebook", + "analysis", + "ml", + "application" ], + "title": "Type", + "type": "string" + }, + "Unique": { "properties": { "name": { - "type": "string" + "anyOf": [ + { + "type": "string" + } + ], + "default": null, + "title": "Name" }, "config": { - "title": "Export Config", - "type": "object", - "properties": { - "alias": { - "type": "string" - }, - "export_as": { - "enum": [ - "table", - "view", - "cache" - ] - }, - "schema": { - "type": "string" + "anyOf": [ + { + "$ref": "#/$defs/TestConfigs" } - }, - "additionalProperties": true - } - }, - "additionalProperties": false - }, - "freshness_definition": { - "default": { - "error_after": { - "count": 2, - "period": "day" + ], + "default": null }, - "warn_after": { - "count": 1, - "period": "day" - } - }, - "oneOf": [ - { - "type": "object", - "properties": { - "error_after": { - "$ref": "#/$defs/freshness_rules" - }, - "filter": { + "where": { + "anyOf": [ + { "type": "string" - }, - "warn_after": { - "$ref": "#/$defs/freshness_rules" } - }, - "additionalProperties": false - }, - { - "const": null - } - ] - }, - "freshness_rules": { - "type": "object", - "required": [ - "count", - "period" - ], - "properties": { - "count": { - "$ref": "#/$defs/number_or_jinja_string" - }, - "period": { - "type": "string", - "enum": [ - "minute", - "hour", - "day" - ] - } - }, - "additionalProperties": false - }, - "grants": { - "description": "grant config. each key is a database permission and the value is the grantee of that permission", - "type": "object", - "patternProperties": { - ".*": { - "$ref": "#/$defs/string_or_array_of_strings" + ], + "default": null, + "title": "Where" } }, - "additionalProperties": false - }, - "group_name": { - "type": "string" - }, - "include_exclude": { - "type": "object", - "properties": { - "exclude": { - "$ref": "#/$defs/string_or_array_of_strings" - }, - "include": { - "$ref": "#/$defs/string_or_array_of_strings" - } - } - }, - "is-time-dimension": { - "required": [ - "type" - ], - "properties": { - "type": { - "enum": [ - "TIME", - "time" - ] - } - } + "title": "Unique", + "type": "object" }, - "jinja_string": { - "type": "string", - "pattern": "\\{\\{.*\\}\\}" - }, - "measure": { - "type": "object", - "required": [ - "name", - "agg" - ], + "UniqueTest": { "properties": { - "name": { - "type": "string", - "pattern": "(?!.*__).*^[a-z][a-z0-9_]*[a-z0-9]$" - }, - "description": { - "type": "string" - }, - "agg": { - "enum": [ - "SUM", - "MIN", - "MAX", - "AVG", - "COUNT_DISTINCT", - "SUM_BOOLEAN", - "COUNT", - "PERCENTILE", - "MEDIAN", - "sum", - "min", - "max", - "avg", - "count_distinct", - "sum_boolean", - "count", - "percentile", - "median" - ] - }, - "agg_params": { - "$ref": "#/$defs/aggregation_type_params" - }, - "agg_time_dimension": { - "type": "string", - "pattern": "(?!.*__).*^[a-z][a-z0-9_]*[a-z0-9]$" - }, - "create_metric": { - "type": "boolean" - }, - "create_metric_display_name": { - "type": "string" - }, - "expr": { - "type": [ - "string", - "integer", - "boolean" - ] - }, - "label": { - "type": "string" - }, - "non_additive_dimension": { - "$ref": "#/$defs/non_additive_dimension" + "unique": { + "anyOf": [ + { + "$ref": "#/$defs/Unique" + } + ], + "default": null } }, - "additionalProperties": false + "title": "UniqueTest", + "type": "object" }, - "metric_input_measure": { - "type": "object", + "UnitTest": { + "additionalProperties": false, "properties": { "name": { + "title": "Name", "type": "string" }, - "fill_nulls_with": { + "description": { "anyOf": [ { "type": "string" + } + ], + "default": null, + "title": "Description" + }, + "config": { + "anyOf": [ + { + "$ref": "#/$defs/UnitTestConfig" + } + ], + "default": null, + "title": "Unit Test Config" + }, + "expect": { + "anyOf": [ + { + "$ref": "#/$defs/ExpectDict" }, { - "type": "integer" + "$ref": "#/$defs/ExpectCSV" + }, + { + "$ref": "#/$defs/ExpectSQL" } - ] + ], + "title": "Expect" }, - "filter": { + "given": { + "anyOf": [ + { + "items": { + "$ref": "#/$defs/GivenItem" + }, + "type": "array" + } + ], + "default": null, + "title": "Given" + }, + "model": { + "description": "The name of the model whose behaviour you are testing. Does not need to be wrapped in a ref.", + "examples": [ + "my_model" + ], + "title": "Model", "type": "string" }, - "join_to_timespine": { - "type": "boolean" + "overrides": { + "anyOf": [ + { + "$ref": "#/$defs/Overrides" + } + ], + "default": null + }, + "additionalProperties": { + "anyOf": [ + {} + ], + "default": null, + "title": "Additionalproperties" } }, - "additionalProperties": false + "required": [ + "name", + "expect", + "model" + ], + "title": "UnitTest", + "type": "object" }, - "metric_input_schema": { - "type": "object", + "UnitTestConfig": { + "additionalProperties": false, "properties": { - "name": { - "type": "string" - }, - "alias": { - "type": "string" - }, - "filter": { - "type": "string" + "meta": { + "anyOf": [ + { + "type": "object" + } + ], + "default": null, + "title": "Meta" }, - "offset_window": { - "type": "string" + "tags": { + "anyOf": [ + { + "$ref": "#/$defs/StringOrArrayOfStrings" + } + ], + "default": null } }, - "additionalProperties": false + "title": "UnitTestConfig", + "type": "object" }, - "model_configs": { - "type": "object", + "ValidityParams": { + "additionalProperties": false, "properties": { - "auto_refresh": { - "$ref": "#/$defs/boolean_or_jinja_string" - }, - "backup": { - "$ref": "#/$defs/boolean_or_jinja_string" - }, - "contract": { - "type": "object", - "properties": { - "enforced": { - "$ref": "#/$defs/boolean_or_jinja_string" + "is_end": { + "anyOf": [ + { + "type": "boolean" } - } - }, - "file_format": { - "type": "string" + ], + "default": null, + "title": "Is End" }, - "grant_access_to": { - "title": "Authorized views", - "description": "Configuration, specific to BigQuery adapter, used to setup authorized views.", - "type": "array", - "items": { - "type": "object", - "required": [ - "database", - "project" - ], - "properties": { - "database": { - "type": "string" + "is_start": { + "anyOf": [ + { + "type": "boolean" + } + ], + "default": null, + "title": "Is Start" + } + }, + "title": "ValidityParams", + "type": "object" + }, + "Version": { + "properties": { + "columns": { + "anyOf": [ + { + "items": { + "anyOf": [ + { + "$ref": "#/$defs/IncludeExclude" + }, + { + "$ref": "#/$defs/ColumnProperties" + } + ] }, - "project": { - "type": "string" - } - }, - "additionalProperties": false - } - }, - "grants": { - "$ref": "#/$defs/grants" - }, - "hours_to_expiration": { - "description": "Configuration specific to BigQuery adapter used to set an expiration delay (in hours) to a table.", - "type": "number" - }, - "kms_key_name": { - "description": "Configuration of the KMS key name, specific to BigQuery adapter.", - "type": "string", - "pattern": "projects/[a-zA-Z0-9_-]*/locations/[a-zA-Z0-9_-]*/keyRings/.*/cryptoKeys/.*" - }, - "labels": { - "title": "Label configs", - "description": "Configuration specific to BigQuery adapter used to add labels and tags to tables/views created by dbt.", - "type": "object", - "patternProperties": { - "^[a-z][a-z0-9_-]{0,62}$": { - "type": "string", - "pattern": "^[a-z0-9_-]{0,63}$" + "type": "array" } - }, - "additionalProperties": false - }, - "location": { - "type": "string" - }, - "materialized": { - "type": "string" - }, - "on_configuration_change": { - "type": "string", - "enum": [ - "apply", - "continue", - "fail" - ] - }, - "on_schema_change": { - "type": "string", - "enum": [ - "append_new_columns", - "fail", - "ignore", - "sync_all_columns" - ] - }, - "snowflake_warehouse": { - "type": "string" + ], + "default": null, + "title": "Columns" }, - "sql_header": { - "type": "string" + "config": { + "anyOf": [ + { + "$ref": "#/$defs/ModelConfigs" + } + ], + "default": null }, - "target_lag": { - "type": "string", - "pattern": "^(?:downstream|\\d+\\s*(?:seconds|minutes|hours|days))$" + "v": { + "title": "V", + "type": "number" } - } + }, + "required": [ + "v" + ], + "title": "Version", + "type": "object" + }, + "WindowChoice": { + "enum": [ + "MIN", + "MAX", + "min", + "max" + ], + "title": "WindowChoice", + "type": "string" + } + }, + "additionalProperties": false, + "properties": { + "version": { + "const": 2, + "default": 2, + "enum": [ + 2 + ], + "title": "Version", + "type": "integer" }, - "owner": { - "type": "object", + "analyses": { "anyOf": [ { - "required": [ - "email" - ] - }, - { - "required": [ - "name" - ] + "items": { + "$ref": "#/$defs/Analyse" + }, + "type": "array" } ], - "properties": { - "name": { - "type": "string" - }, - "email": { - "type": "string" - } - }, - "additionalProperties": false + "default": null, + "title": "Analyses" }, - "non_additive_dimension": { - "type": "object", - "required": [ - "name" + "exposures": { + "anyOf": [ + { + "items": { + "$ref": "#/$defs/Exposure" + }, + "type": "array" + } ], - "properties": { - "name": { - "type": "string" - }, - "window_choice": { - "enum": [ - "MIN", - "MAX", - "min", - "max" - ] - }, - "window_groupings": { - "type": "array", + "default": null, + "title": "Exposures" + }, + "groups": { + "anyOf": [ + { "items": { - "type": "string" - } + "$ref": "#/$defs/Group" + }, + "type": "array" } - }, - "additionalProperties": false + ], + "default": null, + "title": "Groups" }, - "number_or_jinja_string": { - "oneOf": [ + "macros": { + "anyOf": [ { - "$ref": "#/$defs/jinja_string" - }, + "items": { + "$ref": "#/$defs/Macro" + }, + "type": "array" + } + ], + "default": null, + "title": "Macros" + }, + "metrics": { + "anyOf": [ { - "type": "number" + "items": { + "anyOf": [ + { + "$ref": "#/$defs/SimpleMetric" + }, + { + "$ref": "#/$defs/DerivedMetric" + }, + { + "$ref": "#/$defs/CumulativeMetric" + }, + { + "$ref": "#/$defs/ConversionMetric" + }, + { + "$ref": "#/$defs/RatioMetric" + } + ] + }, + "type": "array" } ], - "additionalProperties": false + "default": null, + "title": "Metrics" }, - "persist_docs_config": { - "title": "Persist docs config", - "description": "Configurations for the persistence of the dbt documentation.", - "type": "object", - "properties": { - "columns": { - "$ref": "#/$defs/boolean_or_jinja_string", - "default": true - }, - "relation": { - "$ref": "#/$defs/boolean_or_jinja_string", - "default": true + "models": { + "anyOf": [ + { + "items": { + "$ref": "#/$defs/Model" + }, + "type": "array" } - }, - "additionalProperties": false + ], + "default": null, + "title": "Models" }, - "ratio_metric_type_params": { - "type": "object", - "properties": { - "denominator": { - "$ref": "#/$defs/metric_input_schema" - }, - "filter": { - "type": "string" - }, - "numerator": { - "$ref": "#/$defs/metric_input_schema" + "saved_queries": { + "anyOf": [ + { + "items": { + "$ref": "#/$defs/SavedQuery" + }, + "type": "array" } - }, - "additionalProperties": false + ], + "default": null, + "title": "Saved Queries" }, - "simple_metric_type_params": { - "type": "object", - "properties": { - "measure": { - "$ref": "#/$defs/metric_input_measure" + "seeds": { + "anyOf": [ + { + "items": { + "$ref": "#/$defs/Seed" + }, + "type": "array" } - }, - "additionalProperties": false + ], + "default": null, + "title": "Seeds" }, - "string_or_array_of_strings": { - "oneOf": [ + "semantic_models": { + "anyOf": [ { - "type": "string" - }, + "items": { + "$ref": "#/$defs/SemanticModel" + }, + "type": "array" + } + ], + "default": null, + "title": "Semantic Models" + }, + "snapshots": { + "anyOf": [ { - "$ref": "#/$defs/array_of_strings" + "items": { + "$ref": "#/$defs/Snapshot" + }, + "type": "array" } - ] + ], + "default": null, + "title": "Snapshots" }, - "test_configs": { - "title": "Test configs", - "description": "Configurations set here will override configs set in dbt_project.yml.", - "type": "object", - "properties": { - "alias": { - "description": "Only relevant when `store_failures` is true", - "type": "string" - }, - "database": { - "description": "Only relevant when `store_failures` is true", - "type": "string" - }, - "enabled": { - "$ref": "#/$defs/boolean_or_jinja_string" - }, - "error_if": { - "type": "string" - }, - "fail_calc": { - "type": "string" - }, - "limit": { - "type": "number" - }, - "schema": { - "description": "Only relevant when `store_failures` is true", - "type": "string" - }, - "severity": { - "oneOf": [ - { - "$ref": "#/$defs/jinja_string" - }, - { - "type": "string", - "enum": [ - "warn", - "error" - ] - } - ] - }, - "store_failures": { - "$ref": "#/$defs/boolean_or_jinja_string" - }, - "tags": { - "$ref": "#/$defs/string_or_array_of_strings" - }, - "warn_if": { - "type": "string" + "sources": { + "anyOf": [ + { + "items": { + "$ref": "#/$defs/Source" + }, + "type": "array" } - } + ], + "default": null, + "title": "Sources" }, - "validity_params": { - "type": "object", - "properties": { - "is_end": { - "type": "boolean" - }, - "is_start": { - "type": "boolean" + "unit_tests": { + "anyOf": [ + { + "items": { + "$ref": "#/$defs/UnitTest" + }, + "type": "array" } - }, - "additionalProperties": false + ], + "default": null, + "title": "Unit Tests" } - } + }, + "title": "DbtYmlFiles", + "type": "object" } \ No newline at end of file diff --git a/schemas/latest/dependencies-latest.json b/schemas/latest/dependencies-latest.json index b17802a..5ae221c 100644 --- a/schemas/latest/dependencies-latest.json +++ b/schemas/latest/dependencies-latest.json @@ -1,83 +1,154 @@ { - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "title": "dependencies", - "properties": { - "projects": { - "type": "array", - "items": { - "type": "object", - "required": ["name"], - "properties": { - "name": { - "type": "string" - } + "$defs": { + "GitPackages": { + "additionalProperties": false, + "properties": { + "git": { + "title": "Git URL", + "type": "string" }, - "additionalProperties": false - } + "revision": { + "anyOf": [ + { + "type": "string" + } + ], + "default": null, + "description": "Pin your package to a specific release by specifying a release name", + "title": "Revision" + }, + "subdirectory": { + "anyOf": [ + { + "type": "string" + } + ], + "default": null, + "description": "Only required if the package is nested in a subdirectory of the git project", + "title": "Subdirectory" + } + }, + "required": [ + "git" + ], + "title": "GitPackages", + "type": "object" }, + "HubPackages": { + "additionalProperties": false, + "properties": { + "version": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "number" + }, + { + "items": {}, + "type": "array" + } + ], + "description": "A semantic version string or range, such as [\">=1.0.0\", \"<2.0.0\"]", + "title": "Package version" + }, + "install-prerelease": { + "anyOf": [ + { + "type": "boolean" + } + ], + "default": null, + "description": "Opt in to prerelease versions of a package", + "title": "Install Prerelease" + }, + "package": { + "description": "Must be in format `org_name/package_name`. Refer to hub.getdbt.com for installation instructions", + "examples": [ + "dbt-labs/dbt_utils" + ], + "pattern": "^[\\w\\-\\.]+/[\\w\\-\\.]+$", + "title": "Package identifier", + "type": "string" + } + }, + "required": [ + "version", + "package" + ], + "title": "HubPackages", + "type": "object" + }, + "LocalPackage": { + "additionalProperties": false, + "properties": { + "local": { + "anyOf": [ + { + "type": "string" + } + ], + "default": null, + "title": "Local" + } + }, + "title": "LocalPackage", + "type": "object" + }, + "Project": { + "additionalProperties": false, + "properties": { + "name": { + "title": "Name", + "type": "string" + } + }, + "required": [ + "name" + ], + "title": "Project", + "type": "object" + } + }, + "additionalProperties": false, + "properties": { "packages": { - "type": "array", - "items": { - "anyOf": [ - { - "type": "object", - "required": ["package", "version"], - "properties": { - "version": { - "title": "Package version", - "type": ["string", "number", "array"], - "description": "A semantic version string or range, such as [\">=1.0.0\", \"<2.0.0\"]" + "anyOf": [ + { + "items": { + "anyOf": [ + { + "$ref": "#/$defs/HubPackages" }, - "install-prerelease": { - "title": "Install Prerelease", - "type": "boolean", - "description": "Opt in to prerelease versions of a package" + { + "$ref": "#/$defs/GitPackages" }, - "package": { - "title": "Package identifier", - "type": "string", - "description": "Must be in format `org_name/package_name`. Refer to hub.getdbt.com for installation instructions", - "examples": ["dbt-labs/dbt_utils"], - "pattern": "^[\\w\\-\\.]+/[\\w\\-\\.]+$" + { + "$ref": "#/$defs/LocalPackage" } - }, - "additionalProperties": false + ] }, - { - "type": "object", - "required": ["git"], - "properties": { - "git": { - "title": "Git URL", - "type": "string" - }, - "revision": { - "title": "Revision", - "type": "string", - "description": "Pin your package to a specific release by specifying a release name" - }, - "subdirectory": { - "title": "Subdirectory", - "type": "string", - "description": "Only required if the package is nested in a subdirectory of the git project" - } - }, - "additionalProperties": false + "minItems": 1, + "type": "array" + } + ], + "default": null, + "title": "Packages" + }, + "projects": { + "anyOf": [ + { + "items": { + "$ref": "#/$defs/Project" }, - { - "type": "object", - "properties": { - "local": { - "type": "string" - } - }, - "additionalProperties": false - } - ] - }, - "minItems": 1 + "type": "array" + } + ], + "default": null, + "title": "Projects" } }, - "additionalProperties": false -} + "title": "Dependencies", + "type": "object" +} \ No newline at end of file diff --git a/schemas/latest/packages-latest.json b/schemas/latest/packages-latest.json index 86cc8a9..7c693ee 100644 --- a/schemas/latest/packages-latest.json +++ b/schemas/latest/packages-latest.json @@ -1,84 +1,128 @@ { - "title": "packages", - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "required": [ - "packages" - ], - "properties": { - "packages": { - "type": "array", - "items": { - "anyOf": [ - { - "type": "object", - "required": [ - "package", - "version" - ], - "properties": { - "version": { - "title": "Package version", - "type": [ - "string", - "number", - "array" - ], - "description": "A semantic version string or range, such as [\">=1.0.0\", \"<2.0.0\"]" - }, - "install-prerelease": { - "title": "Install Prerelease", - "type": "boolean", - "description": "Opt in to prerelease versions of a package" - }, - "package": { - "title": "Package identifier", - "type": "string", - "description": "Must be in format `org_name/package_name`. Refer to hub.getdbt.com for installation instructions", - "examples": [ - "dbt-labs/dbt_utils" - ], - "pattern": "^[\\w\\-\\.]+/[\\w\\-\\.]+$" - } - }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "git" - ], - "properties": { - "git": { - "title": "Git URL", - "type": "string" - }, - "revision": { - "title": "Revision", - "type": "string", - "description": "Pin your package to a specific release by specifying a release name" - }, - "subdirectory": { - "title": "Subdirectory", - "type": "string", - "description": "Only required if the package is nested in a subdirectory of the git project" - } - }, - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "local": { - "type": "string" - } - }, - "additionalProperties": false - } - ] + "$defs": { + "GitPackages": { + "additionalProperties": false, + "properties": { + "git": { + "title": "Git URL", + "type": "string" + }, + "revision": { + "anyOf": [ + { + "type": "string" + } + ], + "default": null, + "description": "Pin your package to a specific release by specifying a release name", + "title": "Revision" + }, + "subdirectory": { + "anyOf": [ + { + "type": "string" + } + ], + "default": null, + "description": "Only required if the package is nested in a subdirectory of the git project", + "title": "Subdirectory" + } + }, + "required": [ + "git" + ], + "title": "GitPackages", + "type": "object" + }, + "HubPackages": { + "additionalProperties": false, + "properties": { + "version": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "number" }, - "minItems": 1 + { + "items": {}, + "type": "array" + } + ], + "description": "A semantic version string or range, such as [\">=1.0.0\", \"<2.0.0\"]", + "title": "Package version" + }, + "install-prerelease": { + "anyOf": [ + { + "type": "boolean" + } + ], + "default": null, + "description": "Opt in to prerelease versions of a package", + "title": "Install Prerelease" + }, + "package": { + "description": "Must be in format `org_name/package_name`. Refer to hub.getdbt.com for installation instructions", + "examples": [ + "dbt-labs/dbt_utils" + ], + "pattern": "^[\\w\\-\\.]+/[\\w\\-\\.]+$", + "title": "Package identifier", + "type": "string" } + }, + "required": [ + "version", + "package" + ], + "title": "HubPackages", + "type": "object" }, - "additionalProperties": false -} + "LocalPackage": { + "additionalProperties": false, + "properties": { + "local": { + "anyOf": [ + { + "type": "string" + } + ], + "default": null, + "title": "Local" + } + }, + "title": "LocalPackage", + "type": "object" + } + }, + "additionalProperties": false, + "properties": { + "packages": { + "anyOf": [ + { + "items": { + "anyOf": [ + { + "$ref": "#/$defs/HubPackages" + }, + { + "$ref": "#/$defs/GitPackages" + }, + { + "$ref": "#/$defs/LocalPackage" + } + ] + }, + "minItems": 1, + "type": "array" + } + ], + "default": null, + "title": "Packages" + } + }, + "title": "Packages", + "type": "object" +} \ No newline at end of file diff --git a/schemas/latest/selectors-latest.json b/schemas/latest/selectors-latest.json index 7c818d7..ae07d84 100644 --- a/schemas/latest/selectors-latest.json +++ b/schemas/latest/selectors-latest.json @@ -1,153 +1,236 @@ { - "title": "selectors", - "$schema": "http://json-schema.org/draft-07/schema#", - "type": "object", - "required": [ - "selectors" - ], - "properties": { - "selectors": { - "type": "array", - "items": { - "type": "object", - "properties": { - "name": { - "type": "string" - }, - "description": { - "type": "string" - }, - "default": { - "oneOf": [ - { - "type": "string", - "pattern": "\\{\\{.*\\}\\}" - }, - { - "type": "boolean" - } - ], - "additionalProperties": false - }, - "definition": { - "oneOf": [ - { - "$ref": "#/$defs/definition_block" - }, - { - "type": "string" - }, - { - "$ref": "#/$defs/union_block" - } - ] - } - }, - "additionalProperties": false - }, - "minItems": 1 + "$defs": { + "BooleanOrJinjaString": { + "anyOf": [ + { + "$ref": "#/$defs/JinjaString" + }, + { + "type": "boolean" } + ], + "title": "BooleanOrJinjaString" + }, + "Default": { + "pattern": "\\{\\{.*\\}\\}", + "title": "Default", + "type": "string" }, - "additionalProperties": false, - "$defs": { - "boolean_or_jinja_string": { - "oneOf": [ + "DefinitionBlock": { + "additionalProperties": true, + "properties": { + "method": { + "anyOf": [ + { + "$ref": "#/$defs/Method" + } + ], + "default": null + }, + "value": { + "anyOf": [ + { + "type": "string" + } + ], + "default": null, + "title": "Value" + }, + "children": { + "anyOf": [ + { + "$ref": "#/$defs/BooleanOrJinjaString" + } + ], + "default": null + }, + "parents": { + "anyOf": [ + { + "$ref": "#/$defs/BooleanOrJinjaString" + } + ], + "default": null + }, + "children_depth": { + "anyOf": [ + { + "type": "number" + } + ], + "default": null, + "title": "Children Depth" + }, + "parents_depth": { + "anyOf": [ + { + "type": "number" + } + ], + "default": null, + "title": "Parents Depth" + }, + "childrens_parents": { + "anyOf": [ + { + "$ref": "#/$defs/BooleanOrJinjaString" + } + ], + "default": null + }, + "indirect_selection": { + "anyOf": [ + { + "$ref": "#/$defs/IndirectSelection" + } + ], + "default": null + } + }, + "title": "DefinitionBlock", + "type": "object" + }, + "ExcludeBlock": { + "items": { + "anyOf": [ { - "$ref": "#/$defs/jinja_string" + "$ref": "#/$defs/IntersectionBlock" }, { - "type": "boolean" + "$ref": "#/$defs/DefinitionBlock" } - ], - "additionalProperties": false + ] }, - "definition_block": { - "type": "object", - "properties": { - "method": { - "type": "string", - "enum": [ - "tag", - "source", - "path", - "file", - "fqn", - "package", - "config", - "test_type", - "test_name", - "state", - "exposure", - "metric", - "result", - "source_status", - "group", - "wildcard" - ] - }, - "value": { - "type": "string" - }, - "children": { - "$ref": "#/$defs/boolean_or_jinja_string" - }, - "parents": { - "$ref": "#/$defs/boolean_or_jinja_string" - }, - "children_depth": { - "type": "number" - }, - "parents_depth": { - "type": "number" - }, - "childrens_parents": { - "$ref": "#/$defs/boolean_or_jinja_string" - }, - "indirect_selection": { - "type": "string", - "enum": ["buildable", "cautious", "eager"] - } - }, - "additionalProperties": true - }, - "exclude_block": { - "type": "array", - "items": { - "anyOf": [ - { - "$ref": "#/$defs/intersection_block" - }, - { - "$ref": "#/$defs/definition_block" - } - ] - } - }, - "intersection_block": { - "type": "array", - "items": { - "$ref": "#/$defs/definition_block" - } - }, - "jinja_string": { - "type": "string", - "pattern": "\\{\\{.*\\}\\}" + "title": "ExcludeBlock", + "type": "array" + }, + "IndirectSelection": { + "enum": [ + "buildable", + "cautious", + "eager" + ], + "title": "IndirectSelection", + "type": "string" + }, + "IntersectionBlock": { + "items": { + "$ref": "#/$defs/DefinitionBlock" }, - "union_block": { - "type": "array", - "items": { + "title": "IntersectionBlock", + "type": "array" + }, + "JinjaString": { + "pattern": "\\{\\{.*\\}\\}", + "title": "JinjaString", + "type": "string" + }, + "Method": { + "enum": [ + "tag", + "source", + "path", + "file", + "fqn", + "package", + "config", + "test_type", + "test_name", + "state", + "exposure", + "metric", + "result", + "source_status", + "group", + "wildcard" + ], + "title": "Method", + "type": "string" + }, + "Selector": { + "additionalProperties": false, + "properties": { + "name": { + "anyOf": [ + { + "type": "string" + } + ], + "default": null, + "title": "Name" + }, + "description": { + "anyOf": [ + { + "type": "string" + } + ], + "default": null, + "title": "Description" + }, + "default": { + "anyOf": [ + { + "$ref": "#/$defs/Default" + }, + { + "type": "boolean" + } + ], + "default": null, + "title": "Default" + }, + "definition": { "anyOf": [ { - "$ref": "#/$defs/intersection_block" + "$ref": "#/$defs/DefinitionBlock" }, { - "$ref": "#/$defs/definition_block" + "type": "string" }, { - "$ref": "#/$defs/exclude_block" + "$ref": "#/$defs/UnionBlock" } - ] + ], + "default": null, + "title": "Definition" } - } + }, + "title": "Selector", + "type": "object" + }, + "UnionBlock": { + "items": { + "anyOf": [ + { + "$ref": "#/$defs/IntersectionBlock" + }, + { + "$ref": "#/$defs/DefinitionBlock" + }, + { + "$ref": "#/$defs/ExcludeBlock" + } + ] + }, + "title": "UnionBlock", + "type": "array" + } + }, + "additionalProperties": false, + "properties": { + "selectors": { + "items": { + "$ref": "#/$defs/Selector" + }, + "minItems": 1, + "title": "Selectors", + "type": "array" } -} + }, + "required": [ + "selectors" + ], + "title": "Selectors", + "type": "object" +} \ No newline at end of file diff --git a/src/latest/dbt_yml_files.py b/src/latest/dbt_yml_files.py index 5ff5dc1..2bdf8e0 100644 --- a/src/latest/dbt_yml_files.py +++ b/src/latest/dbt_yml_files.py @@ -822,18 +822,13 @@ class Dimension(RootModel[Union[CategoricalDimension, TimeDimension]]): root: Union[CategoricalDimension, TimeDimension] -class FreshnessDefinition1(BaseModel): +class FreshnessDefinition(BaseModel): model_config = ConfigDict( extra="forbid", ) - error_after: Optional[FreshnessRules] = None - filter: Optional[str] = None - warn_after: Optional[FreshnessRules] = None - - -class FreshnessDefinition(RootModel[Union[FreshnessDefinition1, None]]): - root: Union[FreshnessDefinition1, None] - + warn_after: Optional[FreshnessRules] = FreshnessRules(count=1, period=Period.hour) + error_after: Optional[FreshnessRules] = FreshnessRules(count=1, period=Period.day) + filter: Optional[str] = "" class SeedConfig(BaseModel): column_types: Optional[Dict[str, Any]] = None @@ -947,7 +942,7 @@ class Table(BaseModel): description: Optional[str] = None columns: Optional[List[ColumnProperties]] = None external: Optional[Dict[str, Any]] = None - freshness: Optional[FreshnessDefinition] = None + freshness: Optional[FreshnessDefinition] = Field(FreshnessDefinition(), json_schema_extra={"$comment": "truly_nullable"}) identifier: Optional[str] = Field( None, description="The table name as stored in the database. Only needed if you want to give the source a different name than what exists in the database (otherwise `name` is used by default)", @@ -973,7 +968,7 @@ class Source(BaseModel): config: Optional[Dict[str, Any]] = None data_tests: Optional[List[DataTests]] = None database: Optional[str] = None - freshness: Optional[FreshnessDefinition] = None + freshness: Optional[FreshnessDefinition] = Field(FreshnessDefinition(), json_schema_extra={"$comment": "truly_nullable"}) loaded_at_field: Optional[str] = None loader: Optional[str] = None meta: Optional[Dict[str, Any]] = None From bce162823023771ad3bd5cf75afdbf6fe01ae340 Mon Sep 17 00:00:00 2001 From: Joel Labes Date: Fri, 30 Aug 2024 17:05:47 +1200 Subject: [PATCH 08/17] Remove generation for dbt_project.yml which can't be generated --- generate.py | 7 +- src/latest/dbt_project.py | 562 -------------------------------------- 2 files changed, 4 insertions(+), 565 deletions(-) delete mode 100644 src/latest/dbt_project.py diff --git a/generate.py b/generate.py index 76010ee..9ed9365 100644 --- a/generate.py +++ b/generate.py @@ -3,7 +3,6 @@ from typing import Any, Dict from src.latest.dbt_cloud import DbtCloud -from src.latest.dbt_project import DbtProject from src.latest.dbt_yml_files import DbtYmlFiles from src.latest.dependencies import Dependencies, Packages from src.latest.selectors import Selectors @@ -14,7 +13,10 @@ class RemoveNullsGenerateJsonSchema(GenerateJsonSchema): """A GenerateJsonSchema which removes nullability from types. We do not want to include optional values in the json schema because - that would inhibit code completion. + that would inhibit code completion and validation. + + Certain properties (such as freshness overrides) need to be nullable, + which can be achieved by setting the $comment value below. """ def _remove_null(self, json_schema: Dict[str, Any]): @@ -40,7 +42,6 @@ def generate(self, schema, mode="validation"): "dependencies": Dependencies, "packages": Packages, "selectors": Selectors, - "dbt_project": DbtProject, "dbt_cloud": DbtCloud, } output_directory = Path("schemas/latest") diff --git a/src/latest/dbt_project.py b/src/latest/dbt_project.py deleted file mode 100644 index 68be497..0000000 --- a/src/latest/dbt_project.py +++ /dev/null @@ -1,562 +0,0 @@ -# generated by datamodel-codegen: -# filename: dbt_project-latest.json -# timestamp: 2024-08-05T21:39:08+00:00 - -from __future__ import annotations - -from enum import Enum -from typing import Any, Dict, List, Optional, Union - -from pydantic import BaseModel, ConfigDict, Field, RootModel - - -class DbtCloud(BaseModel): - model_config = ConfigDict( - extra='allow', - ) - project_id: Optional[float] = Field(None, alias='project-id') - - -class Flags(BaseModel): - cache_selected_only: Optional[bool] = None - debug: Optional[bool] = None - fail_fast: Optional[bool] = None - indirect_selection: Optional[str] = None - log_format: Optional[str] = None - log_format_file: Optional[str] = None - log_level: Optional[str] = None - log_level_file: Optional[str] = None - partial_parse: Optional[bool] = None - populate_cache: Optional[bool] = None - printer_width: Optional[int] = None - require_explicit_package_overrides_for_builtin_materializations: Optional[bool] = ( - None - ) - require_resource_names_without_spaces: Optional[bool] = None - send_anonymous_usage_stats: Optional[bool] = None - source_freshness_run_project_hooks: Optional[bool] = None - static_parser: Optional[bool] = None - use_colors: Optional[bool] = None - use_colors_file: Optional[bool] = None - use_experimental_parser: Optional[bool] = None - version_check: Optional[bool] = None - warn_error: Optional[bool] = None - warn_error_options: Optional[Dict[str, Any]] = None - write_json: Optional[bool] = None - - -class Access(Enum): - private = 'private' - protected = 'protected' - public = 'public' - - -class Alias(RootModel[str]): - root: str - - -class ArrayOfStrings(RootModel[List[str]]): - root: List[str] - - -class ColumnTypes(RootModel[Dict[str, str]]): - root: Dict[str, str] - - -class Database(RootModel[str]): - root: str - - -class DocsConfig(BaseModel): - model_config = ConfigDict( - extra='forbid', - ) - node_color: Optional[str] = Field( - None, - description='The color of the node on the DAG in the documentation. It must be an Hex code or a valid CSS color name.', - pattern='^(#[a-fA-F0-9]{3}|#[a-fA-F0-9]{6}|[^#][a-zA-Z]*)$', - ) - show: Optional[bool] = True - - -class EmptyDirectory(RootModel[None]): - root: None - - -class ErrorIf(RootModel[str]): - root: str - - -class FailCalc(RootModel[str]): - root: str - - -class FileFormat(RootModel[str]): - root: str - - -class AuthorizedView(BaseModel): - model_config = ConfigDict( - extra='forbid', - ) - database: Optional[str] = None - project: Optional[str] = None - - -class AuthorizedViews(RootModel[List[AuthorizedView]]): - root: List[AuthorizedView] = Field( - ..., - description='Configuration, specific to BigQuery adapter, used to setup authorized views.', - title='Authorized views', - ) - - -class Group(RootModel[str]): - root: str - - -class HoursToExpiration(RootModel[float]): - root: float = Field( - ..., - description='Configuration specific to BigQuery adapter used to set an expiration delay (in hours) to a table.', - ) - - -class IncrementalStrategy(RootModel[str]): - root: str - - -class JinjaString(RootModel[str]): - root: str = Field(..., pattern='\\{\\{.*\\}\\}') - - -class KmsKeyName(RootModel[str]): - root: str = Field( - ..., - description='Configuration, specific to BigQuery adapter, of the KMS key name used for data encryption.', - ) - - -class LabelConfigs(RootModel[str]): - root: str = Field(..., pattern='^[a-z0-9_-]{0,64}$') - - -class LabelConfigs1(RootModel[Dict[str, Union[LabelConfigs, JinjaString]]]): - root: Dict[str, Union[LabelConfigs, JinjaString]] = Field( - ..., - description='Configurations specific to BigQuery adapter used to add labels and tags to tables & views created by dbt.', - title='Label configs', - ) - - -class Limit(RootModel[float]): - root: float - - -class Location(RootModel[str]): - root: str - - -class Materialized(RootModel[str]): - root: str - - -class Meta(BaseModel): - pass - - -class OnConfigurationChange(Enum): - apply = 'apply' - continue_ = 'continue' - fail = 'fail' - - -class OnSchemaChange(Enum): - append_new_columns = 'append_new_columns' - fail = 'fail' - ignore = 'ignore' - sync_all_columns = 'sync_all_columns' - - -class Schema(RootModel[Optional[str]]): - root: Optional[str] - - -class Severity1(Enum): - warn = 'warn' - error = 'error' - - -class Severity(RootModel[Union[JinjaString, Severity1]]): - root: Union[JinjaString, Severity1] - - -class SnowflakeWarehouse(RootModel[str]): - root: str - - -class SqlHeader(RootModel[str]): - root: str - - -class Strategy(RootModel[str]): - root: str - - -class StringOrArrayOfStrings(RootModel[Union[str, ArrayOfStrings]]): - root: Union[str, ArrayOfStrings] - - -class Tags(RootModel[StringOrArrayOfStrings]): - root: StringOrArrayOfStrings - - -class TargetDatabase(RootModel[str]): - root: str - - -class TargetLag(RootModel[str]): - root: str = Field( - ..., pattern='^(?:downstream|\\d+\\s*(?:seconds|minutes|hours|days))$' - ) - - -class TargetSchema(RootModel[str]): - root: str - - -class UnitTestConfigs(BaseModel): - field_meta: Optional[Meta] = Field(None, alias='+meta') - field_tags: Optional[Tags] = Field(None, alias='+tags') - meta: Optional[Meta] = None - tags: Optional[Tags] = None - - -class UpdatedAt(RootModel[str]): - root: str - - -class WarnIf(RootModel[str]): - root: str - - -class DispatchItem(BaseModel): - model_config = ConfigDict( - extra='forbid', - ) - macro_namespace: str - search_order: ArrayOfStrings - - -class BooleanOrJinjaString(RootModel[Union[JinjaString, bool]]): - root: Union[JinjaString, bool] - - -class Contract(BaseModel): - enforced: BooleanOrJinjaString - - -class DataTestConfigs(BaseModel): - field_alias: Optional[Alias] = Field(None, alias='+alias') - field_database: Optional[Database] = Field(None, alias='+database') - field_enabled: Optional[BooleanOrJinjaString] = Field(None, alias='+enabled') - field_error_if: Optional[ErrorIf] = Field(None, alias='+error_if') - field_fail_calc: Optional[FailCalc] = Field(None, alias='+fail_calc') - field_group: Optional[Group] = Field(None, alias='+group') - field_limit: Optional[Limit] = Field(None, alias='+limit') - field_meta: Optional[Meta] = Field(None, alias='+meta') - field_schema: Optional[Schema] = Field(None, alias='+schema') - field_severity: Optional[Severity] = Field(None, alias='+severity') - field_store_failures: Optional[BooleanOrJinjaString] = Field( - None, alias='+store_failures' - ) - field_tags: Optional[Tags] = Field(None, alias='+tags') - field_warn_if: Optional[WarnIf] = Field(None, alias='+warn_if') - alias: Optional[Alias] = None - database: Optional[Database] = None - enabled: Optional[BooleanOrJinjaString] = None - error_if: Optional[ErrorIf] = None - fail_calc: Optional[FailCalc] = None - group: Optional[Group] = None - limit: Optional[Limit] = None - meta: Optional[Meta] = None - schema_: Optional[Schema] = Field(None, alias='schema') - severity: Optional[Severity] = None - store_failures: Optional[BooleanOrJinjaString] = None - tags: Optional[Tags] = None - warn_if: Optional[WarnIf] = None - - -class Grants(RootModel[Dict[str, StringOrArrayOfStrings]]): - root: Dict[str, StringOrArrayOfStrings] = Field( - ..., - description='grant config. each key is a database permission and the value is the grantee of that permission', - ) - - -class InvalidateHardDeletes(RootModel[BooleanOrJinjaString]): - root: BooleanOrJinjaString - - -class PersistDocsConfig(BaseModel): - model_config = ConfigDict( - extra='forbid', - ) - columns: Optional[BooleanOrJinjaString] = Field( - default_factory=lambda: BooleanOrJinjaString.model_validate(True) - ) - relation: Optional[BooleanOrJinjaString] = Field( - default_factory=lambda: BooleanOrJinjaString.model_validate(True) - ) - - -class SeedConfigs(BaseModel): - field_column_types: Optional[ColumnTypes] = Field(None, alias='+column_types') - field_copy_grants: Optional[BooleanOrJinjaString] = Field( - None, alias='+copy_grants' - ) - field_database: Optional[Database] = Field(None, alias='+database') - field_docs: Optional[DocsConfig] = Field(None, alias='+docs') - field_enabled: Optional[BooleanOrJinjaString] = Field(None, alias='+enabled') - field_full_refresh: Optional[BooleanOrJinjaString] = Field( - None, alias='+full_refresh' - ) - field_grants: Optional[Grants] = Field(None, alias='+grants') - field_group: Optional[Group] = Field(None, alias='+group') - field_meta: Optional[Meta] = Field(None, alias='+meta') - field_persist_docs: Optional[PersistDocsConfig] = Field(None, alias='+persist_docs') - field_quote_columns: Optional[BooleanOrJinjaString] = Field( - None, alias='+quote_columns' - ) - field_schema: Optional[Schema] = Field(None, alias='+schema') - field_tags: Optional[Tags] = Field(None, alias='+tags') - field_transient: Optional[BooleanOrJinjaString] = Field(None, alias='+transient') - column_types: Optional[ColumnTypes] = None - copy_grants: Optional[BooleanOrJinjaString] = None - database: Optional[Database] = None - docs: Optional[DocsConfig] = None - enabled: Optional[BooleanOrJinjaString] = None - full_refresh: Optional[BooleanOrJinjaString] = None - grants: Optional[Grants] = None - group: Optional[Group] = None - meta: Optional[Meta] = None - persist_docs: Optional[PersistDocsConfig] = None - quote_columns: Optional[BooleanOrJinjaString] = None - schema_: Optional[Schema] = Field(None, alias='schema') - tags: Optional[Tags] = None - transient: Optional[BooleanOrJinjaString] = None - - -class SnapshotConfigs(BaseModel): - field_alias: Optional[Alias] = Field(None, alias='+alias') - field_check_cols: Optional[StringOrArrayOfStrings] = Field( - None, alias='+check_cols' - ) - field_docs: Optional[DocsConfig] = Field(None, alias='+docs') - field_enabled: Optional[BooleanOrJinjaString] = Field(None, alias='+enabled') - field_grants: Optional[Grants] = Field(None, alias='+grants') - field_group: Optional[Group] = Field(None, alias='+group') - field_invalidate_hard_deletes: Optional[InvalidateHardDeletes] = Field( - None, alias='+invalidate_hard_deletes' - ) - field_meta: Optional[Meta] = Field(None, alias='+meta') - field_persist_docs: Optional[PersistDocsConfig] = Field(None, alias='+persist_docs') - field_post_hook: Optional[ArrayOfStrings] = Field(None, alias='+post-hook') - field_pre_hook: Optional[ArrayOfStrings] = Field(None, alias='+pre-hook') - field_quote_columns: Optional[BooleanOrJinjaString] = Field( - None, alias='+quote_columns' - ) - field_strategy: Optional[Strategy] = Field(None, alias='+strategy') - field_tags: Optional[Tags] = Field(None, alias='+tags') - field_target_database: Optional[TargetDatabase] = Field( - None, alias='+target_database' - ) - field_target_schema: Optional[TargetSchema] = Field(None, alias='+target_schema') - field_transient: Optional[BooleanOrJinjaString] = Field(None, alias='+transient') - field_unique_key: Optional[StringOrArrayOfStrings] = Field( - None, alias='+unique_key' - ) - field_updated_at: Optional[UpdatedAt] = Field(None, alias='+updated_at') - alias: Optional[Alias] = None - check_cols: Optional[StringOrArrayOfStrings] = None - docs: Optional[DocsConfig] = None - enabled: Optional[BooleanOrJinjaString] = None - grants: Optional[Grants] = None - group: Optional[Group] = None - invalidate_hard_deletes: Optional[InvalidateHardDeletes] = None - meta: Optional[Meta] = None - persist_docs: Optional[PersistDocsConfig] = None - post_hook: Optional[ArrayOfStrings] = Field(None, alias='post-hook') - pre_hook: Optional[ArrayOfStrings] = Field(None, alias='pre-hook') - quote_columns: Optional[BooleanOrJinjaString] = None - strategy: Optional[Strategy] = None - tags: Optional[Tags] = None - target_database: Optional[TargetDatabase] = None - target_schema: Optional[TargetSchema] = None - transient: Optional[BooleanOrJinjaString] = None - unique_key: Optional[StringOrArrayOfStrings] = None - updated_at: Optional[UpdatedAt] = None - - -class SourceConfigs(BaseModel): - field_enabled: Optional[BooleanOrJinjaString] = Field(None, alias='+enabled') - field_meta: Optional[Meta] = Field(None, alias='+meta') - field_tags: Optional[Tags] = Field(None, alias='+tags') - enabled: Optional[BooleanOrJinjaString] = None - meta: Optional[Meta] = None - tags: Optional[Tags] = None - - -class QueryComment(BaseModel): - model_config = ConfigDict( - extra='forbid', - ) - append: Optional[BooleanOrJinjaString] = None - comment: Optional[str] = None - job_label: Optional[BooleanOrJinjaString] = Field(None, alias='job-label') - - -class Quoting(BaseModel): - database: Optional[BooleanOrJinjaString] = None - identifier: Optional[BooleanOrJinjaString] = None - schema_: Optional[BooleanOrJinjaString] = Field(None, alias='schema') - - -class AutoRefresh(RootModel[BooleanOrJinjaString]): - root: BooleanOrJinjaString - - -class Backup(RootModel[BooleanOrJinjaString]): - root: BooleanOrJinjaString - - -class ModelConfigs(BaseModel): - field_access: Optional[Access] = Field(None, alias='+access') - field_alias: Optional[Alias] = Field(None, alias='+alias') - field_auto_refresh: Optional[AutoRefresh] = Field(None, alias='+auto_refresh') - field_backup: Optional[Backup] = Field(None, alias='+backup') - field_bind: Optional[BooleanOrJinjaString] = Field(False, alias='+bind') - field_contract: Optional[Contract] = Field(None, alias='+contract') - field_copy_grants: Optional[BooleanOrJinjaString] = Field( - None, alias='+copy_grants' - ) - field_database: Optional[Database] = Field(None, alias='+database') - field_docs: Optional[DocsConfig] = Field(None, alias='+docs') - field_enabled: Optional[BooleanOrJinjaString] = Field(None, alias='+enabled') - field_file_format: Optional[FileFormat] = Field(None, alias='+file_format') - field_full_refresh: Optional[BooleanOrJinjaString] = Field( - None, alias='+full_refresh' - ) - field_grant_access_to: Optional[AuthorizedViews] = Field( - None, alias='+grant_access_to' - ) - field_grants: Optional[Grants] = Field(None, alias='+grants') - field_group: Optional[Group] = Field(None, alias='+group') - field_hours_to_expiration: Optional[HoursToExpiration] = Field( - None, alias='+hours_to_expiration' - ) - field_incremental_strategy: Optional[IncrementalStrategy] = Field( - None, alias='+incremental_strategy' - ) - field_kms_key_name: Optional[KmsKeyName] = Field(None, alias='+kms_key_name') - field_labels: Optional[LabelConfigs1] = Field(None, alias='+labels') - field_location: Optional[Location] = Field(None, alias='+location') - field_materialized: Optional[Materialized] = Field(None, alias='+materialized') - field_meta: Optional[Meta] = Field(None, alias='+meta') - field_on_configuration_change: Optional[OnConfigurationChange] = Field( - None, alias='+on_configuration_change' - ) - field_on_schema_change: Optional[OnSchemaChange] = Field( - None, alias='+on_schema_change' - ) - field_persist_docs: Optional[PersistDocsConfig] = Field(None, alias='+persist_docs') - field_post_hook: Optional[ArrayOfStrings] = Field(None, alias='+post-hook') - field_pre_hook: Optional[ArrayOfStrings] = Field(None, alias='+pre-hook') - field_schema: Optional[Schema] = Field(None, alias='+schema') - field_secure: Optional[BooleanOrJinjaString] = Field(False, alias='+secure') - field_snowflake_warehouse: Optional[SnowflakeWarehouse] = Field( - None, alias='+snowflake_warehouse' - ) - field_sql_header: Optional[SqlHeader] = Field(None, alias='+sql_header') - field_tags: Optional[Tags] = Field(None, alias='+tags') - field_target_lag: Optional[TargetLag] = Field(None, alias='+target_lag') - field_transient: Optional[BooleanOrJinjaString] = Field(None, alias='+transient') - access: Optional[Access] = None - alias: Optional[Alias] = None - auto_refresh: Optional[AutoRefresh] = None - backup: Optional[Backup] = None - bind: Optional[BooleanOrJinjaString] = False - contract: Optional[Contract] = None - copy_grants: Optional[BooleanOrJinjaString] = None - database: Optional[Database] = None - docs: Optional[DocsConfig] = None - enabled: Optional[BooleanOrJinjaString] = None - file_format: Optional[FileFormat] = None - full_refresh: Optional[BooleanOrJinjaString] = None - grant_access_to: Optional[AuthorizedViews] = None - grants: Optional[Grants] = None - group: Optional[Group] = None - hours_to_expiration: Optional[HoursToExpiration] = None - incremental_strategy: Optional[IncrementalStrategy] = None - kms_key_name: Optional[KmsKeyName] = None - labels: Optional[LabelConfigs1] = None - location: Optional[Location] = None - materialized: Optional[Materialized] = None - meta: Optional[Meta] = None - on_configuration_change: Optional[OnConfigurationChange] = None - on_schema_change: Optional[OnSchemaChange] = None - persist_docs: Optional[PersistDocsConfig] = None - post_hook: Optional[ArrayOfStrings] = Field(None, alias='post-hook') - pre_hook: Optional[ArrayOfStrings] = Field(None, alias='pre-hook') - schema_: Optional[Schema] = Field(None, alias='schema') - secure: Optional[BooleanOrJinjaString] = False - snowflake_warehouse: Optional[SnowflakeWarehouse] = None - sql_header: Optional[SqlHeader] = None - tags: Optional[Tags] = None - target_lag: Optional[TargetLag] = None - transient: Optional[BooleanOrJinjaString] = None - - -class DbtProject(BaseModel): - model_config = ConfigDict( - extra='forbid', - protected_namespaces=[] - ) - version: Optional[str] = None - name: str - analysis_paths: Optional[ArrayOfStrings] = Field(None, alias='analysis-paths') - asset_paths: Optional[ArrayOfStrings] = Field(None, alias='asset-paths') - clean_targets: Optional[ArrayOfStrings] = Field(None, alias='clean-targets') - config_version: Optional[float] = Field(2, alias='config-version') - data_tests: Optional[DataTestConfigs] = None - dbt_cloud: Optional[DbtCloud] = Field(None, alias='dbt-cloud') - dispatch: Optional[List[DispatchItem]] = None - docs_paths: Optional[ArrayOfStrings] = Field(None, alias='docs-paths') - flags: Optional[Flags] = None - log_path: Optional[str] = Field(None, alias='log-path') - macro_paths: Optional[ArrayOfStrings] = Field(None, alias='macro-paths') - model_paths: Optional[ArrayOfStrings] = Field(None, alias='model-paths') - models: Optional[ModelConfigs] = None - on_run_end: Optional[Union[ArrayOfStrings, str]] = Field(None, alias='on-run-end') - on_run_start: Optional[Union[ArrayOfStrings, str]] = Field( - None, alias='on-run-start' - ) - packages_install_path: Optional[str] = Field(None, alias='packages-install-path') - profile: Optional[str] = None - query_comment: Optional[Union[str, QueryComment]] = Field( - None, alias='query-comment' - ) - quoting: Optional[Quoting] = None - require_dbt_version: Optional[StringOrArrayOfStrings] = Field( - None, alias='require-dbt-version' - ) - seed_paths: Optional[ArrayOfStrings] = Field(None, alias='seed-paths') - seeds: Optional[SeedConfigs] = None - snapshot_paths: Optional[ArrayOfStrings] = Field(None, alias='snapshot-paths') - snapshots: Optional[SnapshotConfigs] = None - sources: Optional[SourceConfigs] = None - target_path: Optional[str] = Field(None, alias='target-path') - test_paths: Optional[ArrayOfStrings] = Field(None, alias='test-paths') - tests: Optional[DataTestConfigs] = None - unit_tests: Optional[UnitTestConfigs] = None - vars: Optional[Dict[str, Any]] = None From cb47ad2ef22c75d3fabda78db5a96eab0129c6df Mon Sep 17 00:00:00 2001 From: Joel Labes Date: Fri, 30 Aug 2024 17:06:14 +1200 Subject: [PATCH 09/17] Require a character in jinja strings --- schemas/latest/dbt_yml_files-latest.json | 2 +- src/latest/dbt_yml_files.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/schemas/latest/dbt_yml_files-latest.json b/schemas/latest/dbt_yml_files-latest.json index 21fa4ba..7a08090 100644 --- a/schemas/latest/dbt_yml_files-latest.json +++ b/schemas/latest/dbt_yml_files-latest.json @@ -1471,7 +1471,7 @@ "type": "object" }, "JinjaString": { - "pattern": "\\{\\{.*\\}\\}", + "pattern": "\\{\\{.+\\}\\}", "title": "JinjaString", "type": "string" }, diff --git a/src/latest/dbt_yml_files.py b/src/latest/dbt_yml_files.py index 2bdf8e0..22bb6d2 100644 --- a/src/latest/dbt_yml_files.py +++ b/src/latest/dbt_yml_files.py @@ -241,7 +241,7 @@ class GroupName(RootModel[str]): class JinjaString(RootModel[str]): - root: str = Field(..., pattern="\\{\\{.*\\}\\}") + root: str = Field(..., pattern="\\{\\{.+\\}\\}") class Agg(Enum): From df5ded759fb15290089fcf40f4fcae9f192eaec4 Mon Sep 17 00:00:00 2001 From: Joel Labes Date: Fri, 30 Aug 2024 17:10:15 +1200 Subject: [PATCH 10/17] Replace optional strings with "" --- src/latest/dbt_yml_files.py | 139 ++++++++++++++++++------------------ 1 file changed, 70 insertions(+), 69 deletions(-) diff --git a/src/latest/dbt_yml_files.py b/src/latest/dbt_yml_files.py index 22bb6d2..3cd4004 100644 --- a/src/latest/dbt_yml_files.py +++ b/src/latest/dbt_yml_files.py @@ -15,8 +15,8 @@ class Column(BaseModel): extra="forbid", ) name: str - description: Optional[str] = None - data_type: Optional[str] = None + description: Optional[str] = "" + data_type: Optional[str] = "" class Type(Enum): @@ -38,8 +38,8 @@ class Argument(BaseModel): extra="forbid", ) name: str - description: Optional[str] = None - type: Optional[str] = None + description: Optional[str] = "" + type: Optional[str] = "" class Access(Enum): @@ -52,7 +52,7 @@ class Defaults(BaseModel): model_config = ConfigDict( extra="forbid", ) - agg_time_dimension: Optional[str] = None + agg_time_dimension: Optional[str] = "" class Format(Enum): @@ -97,6 +97,9 @@ class ExpectSQL(BaseModel): class GivenItem(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) fixture: Optional[str] = Field( None, description="Only relevant when format is csv. Specify the name of a fixture instead of providing `rows`.", @@ -113,8 +116,6 @@ class GivenItem(BaseModel): "source('schema', 'table')", ], ) - additionalProperties: Optional[Any] = None - class Overrides(BaseModel): model_config = ConfigDict( @@ -203,7 +204,7 @@ class Entity(BaseModel): ) name: str = Field(..., pattern="(?!.*__).*^[a-z][a-z0-9_]*[a-z0-9]$") type: EntityType = Field(..., title="Entity Type") - entity: Optional[str] = None + entity: Optional[str] = "" expr: Optional[Union[str, bool]] = None @@ -217,7 +218,7 @@ class ExportConfig(BaseModel): model_config = ConfigDict( extra="allow", ) - alias: Optional[str] = None + alias: Optional[str] = "" export_as: Optional[ExportAs] = None schema_: Optional[str] = Field(None, alias="schema") @@ -269,9 +270,9 @@ class MetricInputMeasure(BaseModel): model_config = ConfigDict( extra="forbid", ) - name: Optional[str] = None + name: Optional[str] = "" fill_nulls_with: Optional[Union[str, int]] = None - filter: Optional[str] = None + filter: Optional[str] = "" join_to_timespine: Optional[bool] = None @@ -279,10 +280,10 @@ class MetricInputSchema(BaseModel): model_config = ConfigDict( extra="forbid", ) - name: Optional[str] = None - alias: Optional[str] = None - filter: Optional[str] = None - offset_window: Optional[str] = None + name: Optional[str] = "" + alias: Optional[str] = "" + filter: Optional[str] = "" + offset_window: Optional[str] = "" class AuthorizedView(BaseModel): @@ -348,7 +349,7 @@ class RatioMetricTypeParams(BaseModel): extra="forbid", ) denominator: Optional[MetricInputSchema] = None - filter: Optional[str] = None + filter: Optional[str] = "" numerator: Optional[MetricInputSchema] = None @@ -385,7 +386,7 @@ class Config(BaseModel): class Analyse(BaseModel): name: str - description: Optional[str] = None + description: Optional[str] = "" columns: Optional[List[Column]] = None config: Optional[Config] = None docs: Optional[DocsConfig] = None @@ -394,15 +395,15 @@ class Analyse(BaseModel): class Exposure(BaseModel): name: str - description: Optional[str] = None + description: Optional[str] = "" type: Type depends_on: List[str] - label: Optional[str] = None + label: Optional[str] = "" maturity: Optional[Maturity] = None meta: Optional[Dict[str, Any]] = None owner: Owner tags: Optional[StringOrArrayOfStrings] = None - url: Optional[str] = None + url: Optional[str] = "" class Group(BaseModel): @@ -418,7 +419,7 @@ class Macro(BaseModel): extra="forbid", ) name: str - description: Optional[str] = None + description: Optional[str] = "" arguments: Optional[List[Argument]] = None docs: Optional[DocsConfig] = None @@ -454,8 +455,8 @@ class MetricBase(BaseModel): regex_engine="python-re", ) name: str = Field(..., pattern="(?!.*__).*^[a-z][a-z0-9_]*[a-z0-9]$") - description: Optional[str] = None - filter: Optional[str] = None + description: Optional[str] = "" + filter: Optional[str] = "" group: Optional[GroupName] = None label: str @@ -521,7 +522,7 @@ class UnitTest(BaseModel): extra="forbid", ) name: str - description: Optional[str] = None + description: Optional[str] = "" config: Optional[UnitTestConfig] = Field(None, title="Unit Test Config") expect: Expect given: Optional[List[GivenItem]] = None @@ -539,10 +540,10 @@ class BooleanOrJinjaString(RootModel[Union[JinjaString, bool]]): class Constraint(BaseModel): - name: Optional[str] = None + name: Optional[str] = "" type: str columns: Optional[StringOrArrayOfStrings] = None - expression: Optional[str] = None + expression: Optional[str] = "" warn_unenforced: Optional[BooleanOrJinjaString] = None warn_unsupported: Optional[BooleanOrJinjaString] = None @@ -560,7 +561,7 @@ class ConversionTypeParams(BaseModel): constant_properties: Optional[List[ConstantProperty]] = None conversion_measure: MetricInputMeasure entity: str = Field(..., description="The entity to calculate over") - window: Optional[str] = None + window: Optional[str] = "" class ConversionMetricTypeParams(BaseModel): @@ -576,14 +577,14 @@ class CumulativeMetricTypeParams(BaseModel): ) grain_to_date: Optional[GrainToDate] = None measure: Optional[MetricInputMeasure] = None - window: Optional[str] = None + window: Optional[str] = "" class DerivedMetricTypeParams(BaseModel): model_config = ConfigDict( extra="forbid", ) - expr: Optional[str] = None + expr: Optional[str] = "" metrics: Optional[List[MetricInputSchema]] = None @@ -621,16 +622,16 @@ class Measure(BaseModel): regex_engine="python-re", ) name: str = Field(..., pattern="(?!.*__).*^[a-z][a-z0-9_]*[a-z0-9]$") - description: Optional[str] = None + description: Optional[str] = "" agg: Agg agg_params: Optional[AggregationTypeParams] = None agg_time_dimension: Optional[str] = Field( None, pattern="(?!.*__).*^[a-z][a-z0-9_]*[a-z0-9]$" ) create_metric: Optional[bool] = None - create_metric_display_name: Optional[str] = None + create_metric_display_name: Optional[str] = "" expr: Optional[Union[str, int, bool]] = None - label: Optional[str] = None + label: Optional[str] = "" non_additive_dimension: Optional[NonAdditiveDimension] = None @@ -642,7 +643,7 @@ class ModelConfigs(BaseModel): auto_refresh: Optional[BooleanOrJinjaString] = None backup: Optional[BooleanOrJinjaString] = None contract: Optional[Contract] = None - file_format: Optional[str] = None + file_format: Optional[str] = "" grant_access_to: Optional[List[AuthorizedView]] = Field( None, description="Configuration, specific to BigQuery adapter, used to setup authorized views.", @@ -663,12 +664,12 @@ class ModelConfigs(BaseModel): description="Configuration specific to BigQuery adapter used to add labels and tags to tables/views created by dbt.", title="Label configs", ) - location: Optional[str] = None - materialized: Optional[str] = None + location: Optional[str] = "" + materialized: Optional[str] = "" on_configuration_change: Optional[OnConfigurationChange] = None on_schema_change: Optional[OnSchemaChange] = None - snowflake_warehouse: Optional[str] = None - sql_header: Optional[str] = None + snowflake_warehouse: Optional[str] = "" + sql_header: Optional[str] = "" target_lag: Optional[str] = Field( None, pattern="^(?:downstream|\\d+\\s*(?:seconds|minutes|hours|days))$" ) @@ -694,8 +695,8 @@ class TestConfigs(BaseModel): None, description="Only relevant when `store_failures` is true" ) enabled: Optional[BooleanOrJinjaString] = None - error_if: Optional[str] = None - fail_calc: Optional[str] = None + error_if: Optional[str] = "" + fail_calc: Optional[str] = "" limit: Optional[float] = None schema_: Optional[str] = Field( None, alias="schema", description="Only relevant when `store_failures` is true" @@ -703,11 +704,11 @@ class TestConfigs(BaseModel): severity: Optional[Union[JinjaString, Severity]] = None store_failures: Optional[BooleanOrJinjaString] = None tags: Optional[StringOrArrayOfStrings] = None - warn_if: Optional[str] = None + warn_if: Optional[str] = "" class SnapshotConfig(BaseModel): - alias: Optional[str] = None + alias: Optional[str] = "" check_cols: Optional[StringOrArrayOfStrings] = None enabled: Optional[BooleanOrJinjaString] = None grants: Optional[Grants] = None @@ -715,12 +716,12 @@ class SnapshotConfig(BaseModel): post_hook: Optional[ArrayOfStrings] = Field(None, alias="post-hook") pre_hook: Optional[ArrayOfStrings] = Field(None, alias="pre-hook") quote_columns: Optional[BooleanOrJinjaString] = None - strategy: Optional[str] = None + strategy: Optional[str] = "" tags: Optional[StringOrArrayOfStrings] = None - target_database: Optional[str] = None - target_schema: Optional[str] = None + target_database: Optional[str] = "" + target_schema: Optional[str] = "" unique_key: Optional[StringOrArrayOfStrings] = None - updated_at: Optional[str] = None + updated_at: Optional[str] = "" class Quoting(BaseModel): @@ -733,7 +734,7 @@ class Quoting(BaseModel): class Relationships(BaseModel): - name: Optional[str] = None + name: Optional[str] = "" config: Optional[TestConfigs] = None field: str = Field( ..., description="The foreign key column", title="Relationships: Field" @@ -741,7 +742,7 @@ class Relationships(BaseModel): to: str = Field( ..., examples=["ref('parent_model')", "source('parent_schema', 'parent_table')"] ) - where: Optional[str] = None + where: Optional[str] = "" class RelationshipsTest(BaseModel): @@ -749,11 +750,11 @@ class RelationshipsTest(BaseModel): class AcceptedValues(BaseModel): - name: Optional[str] = None + name: Optional[str] = "" config: Optional[TestConfigs] = None quote: Optional[bool] = None values: List[str] - where: Optional[str] = None + where: Optional[str] = "" class AcceptedValuesTest(BaseModel): @@ -761,9 +762,9 @@ class AcceptedValuesTest(BaseModel): class NotNull(BaseModel): - name: Optional[str] = None + name: Optional[str] = "" config: Optional[TestConfigs] = None - where: Optional[str] = None + where: Optional[str] = "" class NotNullTest(BaseModel): @@ -771,9 +772,9 @@ class NotNullTest(BaseModel): class Unique(BaseModel): - name: Optional[str] = None + name: Optional[str] = "" config: Optional[TestConfigs] = None - where: Optional[str] = None + where: Optional[str] = "" class UniqueTest(BaseModel): @@ -794,7 +795,7 @@ class DimensionBase(BaseModel): regex_engine="python-re", ) name: str = Field(..., pattern="(?!.*__).*^[a-z][a-z0-9_]*[a-z0-9]$") - description: Optional[str] = None + description: Optional[str] = "" expr: Optional[Union[str, bool]] = None is_partition: Optional[bool] = None @@ -834,7 +835,7 @@ class SeedConfig(BaseModel): column_types: Optional[Dict[str, Any]] = None copy_grants: Optional[BooleanOrJinjaString] = None data_tests: Optional[List[DataTests]] = None - database: Optional[str] = None + database: Optional[str] = "" enabled: Optional[BooleanOrJinjaString] = None grants: Optional[Grants] = None quote_columns: Optional[BooleanOrJinjaString] = None @@ -847,13 +848,13 @@ class SemanticModel(BaseModel): regex_engine="python-re", ) name: str = Field(..., pattern="(?!.*__).*^[a-z][a-z0-9_]*[a-z0-9]$") - description: Optional[str] = None + description: Optional[str] = "" defaults: Optional[Defaults] = None dimensions: Optional[List[Dimension]] = None entities: Optional[List[Entity]] = None measures: Optional[List[Measure]] = None model: str - primary_entity: Optional[str] = None + primary_entity: Optional[str] = "" class ColumnProperties(BaseModel): @@ -861,10 +862,10 @@ class ColumnProperties(BaseModel): extra="forbid", ) name: str - description: Optional[str] = None + description: Optional[str] = "" constraints: Optional[Constraints] = None data_tests: Optional[List[DataTests]] = None - data_type: Optional[str] = None + data_type: Optional[str] = "" meta: Optional[Dict[str, Any]] = None policy_tags: Optional[List[str]] = Field( None, @@ -887,13 +888,13 @@ class Model(BaseModel): extra="forbid", ) name: str - description: Optional[str] = None + description: Optional[str] = "" access: Optional[Access] = None columns: Optional[List[ColumnProperties]] = None config: Optional[ModelConfigs] = None constraints: Optional[Constraints] = None data_tests: Optional[List[DataTests]] = None - deprecation_date: Optional[str] = None + deprecation_date: Optional[str] = "" docs: Optional[DocsConfig] = None group: Optional[GroupName] = None latest_version: Optional[float] = None @@ -907,7 +908,7 @@ class Seed(BaseModel): extra="forbid", ) name: str - description: Optional[str] = None + description: Optional[str] = "" columns: Optional[List[ColumnProperties]] = None config: Optional[SeedConfig] = Field(None, title="Seed Config") docs: Optional[DocsConfig] = None @@ -920,7 +921,7 @@ class Snapshot(BaseModel): extra="forbid", ) name: str - description: Optional[str] = None + description: Optional[str] = "" columns: Optional[List[ColumnProperties]] = None config: Optional[SnapshotConfig] = Field(None, title="Snapshot Config") data_tests: Optional[List[DataTests]] = None @@ -939,7 +940,7 @@ class Table(BaseModel): description="How you will identify the table in {{ source() }} calls. Unless `identifier` is also set, this will be the name of the table in the database.", title="Name", ) - description: Optional[str] = None + description: Optional[str] = "" columns: Optional[List[ColumnProperties]] = None external: Optional[Dict[str, Any]] = None freshness: Optional[FreshnessDefinition] = Field(FreshnessDefinition(), json_schema_extra={"$comment": "truly_nullable"}) @@ -952,7 +953,7 @@ class Table(BaseModel): None, description="Which column to check during data freshness tests. Only needed if the table has a different loaded_at_field to the one defined on the source overall.", ) - loader: Optional[str] = None + loader: Optional[str] = "" meta: Optional[Dict[str, Any]] = None quoting: Optional[Quoting] = None tags: Optional[StringOrArrayOfStrings] = None @@ -964,13 +965,13 @@ class Source(BaseModel): ..., description="How you will identify the schema in {{ source() }} calls. Unless `schema` is also set, this will be the name of the schema in the database.", ) - description: Optional[str] = None + description: Optional[str] = "" config: Optional[Dict[str, Any]] = None data_tests: Optional[List[DataTests]] = None - database: Optional[str] = None + database: Optional[str] = "" freshness: Optional[FreshnessDefinition] = Field(FreshnessDefinition(), json_schema_extra={"$comment": "truly_nullable"}) - loaded_at_field: Optional[str] = None - loader: Optional[str] = None + loaded_at_field: Optional[str] = "" + loader: Optional[str] = "" meta: Optional[Dict[str, Any]] = None overrides: Optional[str] = Field( None, From fe143ae7a9fe2685531a96e82af1eb639d4b3dcd Mon Sep 17 00:00:00 2001 From: Joel Labes Date: Mon, 2 Sep 2024 16:36:50 +1200 Subject: [PATCH 11/17] Handle remaining incorrect defaults --- generate.py | 1 + schemas/latest/dbt_cloud-latest.json | 3 +- schemas/latest/dbt_yml_files-latest.json | 948 +++++++++++++---------- schemas/latest/dependencies-latest.json | 3 +- schemas/latest/packages-latest.json | 3 +- schemas/latest/selectors-latest.json | 3 +- src/latest/dbt_yml_files.py | 384 +++++---- 7 files changed, 725 insertions(+), 620 deletions(-) diff --git a/generate.py b/generate.py index 9ed9365..9b40440 100644 --- a/generate.py +++ b/generate.py @@ -32,6 +32,7 @@ def _remove_null(self, json_schema: Dict[str, Any]): def generate(self, schema, mode="validation"): json_schema = super().generate(schema, mode=mode) + json_schema["schema"] = "http://json-schema.org/draft-07/schema#" self._remove_null(json_schema) return json_schema diff --git a/schemas/latest/dbt_cloud-latest.json b/schemas/latest/dbt_cloud-latest.json index e024b8f..df15c35 100644 --- a/schemas/latest/dbt_cloud-latest.json +++ b/schemas/latest/dbt_cloud-latest.json @@ -19,5 +19,6 @@ "project-id" ], "title": "DbtCloud", - "type": "object" + "type": "object", + "schema": "http://json-schema.org/draft-07/schema#" } \ No newline at end of file diff --git a/schemas/latest/dbt_yml_files-latest.json b/schemas/latest/dbt_yml_files-latest.json index 7a08090..88b124c 100644 --- a/schemas/latest/dbt_yml_files-latest.json +++ b/schemas/latest/dbt_yml_files-latest.json @@ -8,7 +8,7 @@ "type": "string" } ], - "default": null, + "default": "", "title": "Name" }, "config": { @@ -17,7 +17,7 @@ "$ref": "#/$defs/TestConfigs" } ], - "default": null + "default": "" }, "quote": { "anyOf": [ @@ -25,7 +25,7 @@ "type": "boolean" } ], - "default": null, + "default": "", "title": "Quote" }, "values": { @@ -41,7 +41,7 @@ "type": "string" } ], - "default": null, + "default": "", "title": "Where" } }, @@ -59,7 +59,13 @@ "$ref": "#/$defs/AcceptedValues" } ], - "default": null + "default": { + "name": "", + "config": "", + "quote": "", + "values": [], + "where": "" + } } }, "title": "AcceptedValuesTest", @@ -107,7 +113,7 @@ "type": "number" } ], - "default": null, + "default": "", "title": "Percentile" }, "use_approximate_percentile": { @@ -116,7 +122,7 @@ "type": "boolean" } ], - "default": null, + "default": "", "title": "Use Approximate Percentile" }, "use_discrete_percentile": { @@ -125,14 +131,14 @@ "type": "boolean" } ], - "default": null, + "default": "", "title": "Use Discrete Percentile" } }, "title": "AggregationTypeParams", "type": "object" }, - "Analyse": { + "Analysis": { "properties": { "name": { "title": "Name", @@ -144,7 +150,7 @@ "type": "string" } ], - "default": null, + "default": "", "title": "Description" }, "columns": { @@ -156,7 +162,7 @@ "type": "array" } ], - "default": null, + "default": "", "title": "Columns" }, "config": { @@ -165,7 +171,7 @@ "$ref": "#/$defs/Config" } ], - "default": null + "default": "" }, "docs": { "anyOf": [ @@ -173,7 +179,7 @@ "$ref": "#/$defs/DocsConfig" } ], - "default": null + "default": "" }, "group": { "anyOf": [ @@ -181,13 +187,13 @@ "$ref": "#/$defs/GroupName" } ], - "default": null + "default": "" } }, "required": [ "name" ], - "title": "Analyse", + "title": "Analysis", "type": "object" }, "Argument": { @@ -203,7 +209,7 @@ "type": "string" } ], - "default": null, + "default": "", "title": "Description" }, "type": { @@ -212,7 +218,7 @@ "type": "string" } ], - "default": null, + "default": "", "title": "Type" } }, @@ -283,7 +289,7 @@ "type": "string" } ], - "default": null, + "default": "", "title": "Description" }, "expr": { @@ -295,7 +301,7 @@ "type": "boolean" } ], - "default": null, + "default": "", "title": "Expr" }, "is_partition": { @@ -304,7 +310,7 @@ "type": "boolean" } ], - "default": null, + "default": true, "title": "Is Partition" }, "type": { @@ -339,7 +345,7 @@ "type": "string" } ], - "default": null, + "default": "", "title": "Description" }, "data_type": { @@ -348,7 +354,7 @@ "type": "string" } ], - "default": null, + "default": "", "title": "Data Type" } }, @@ -371,7 +377,7 @@ "type": "string" } ], - "default": null, + "default": "", "title": "Description" }, "constraints": { @@ -380,7 +386,7 @@ "$ref": "#/$defs/Constraints" } ], - "default": null + "default": "" }, "data_tests": { "anyOf": [ @@ -391,7 +397,7 @@ "type": "array" } ], - "default": null, + "default": "", "title": "Data Tests" }, "data_type": { @@ -400,7 +406,7 @@ "type": "string" } ], - "default": null, + "default": "", "title": "Data Type" }, "meta": { @@ -409,7 +415,7 @@ "type": "object" } ], - "default": null, + "default": "", "title": "Meta" }, "policy_tags": { @@ -431,7 +437,7 @@ "$ref": "#/$defs/BooleanOrJinjaString" } ], - "default": null + "default": "" }, "tags": { "anyOf": [ @@ -439,7 +445,7 @@ "$ref": "#/$defs/StringOrArrayOfStrings" } ], - "default": null + "default": "" }, "tests": { "anyOf": [ @@ -450,7 +456,7 @@ "type": "array" } ], - "default": null, + "default": "", "title": "Tests" } }, @@ -469,7 +475,7 @@ "$ref": "#/$defs/StringOrArrayOfStrings" } ], - "default": null + "default": "" } }, "title": "Config", @@ -503,7 +509,7 @@ "type": "string" } ], - "default": null, + "default": "", "title": "Name" }, "type": { @@ -516,7 +522,7 @@ "$ref": "#/$defs/StringOrArrayOfStrings" } ], - "default": null + "default": "" }, "expression": { "anyOf": [ @@ -524,7 +530,7 @@ "type": "string" } ], - "default": null, + "default": "", "title": "Expression" }, "warn_unenforced": { @@ -533,7 +539,7 @@ "$ref": "#/$defs/BooleanOrJinjaString" } ], - "default": null + "default": "" }, "warn_unsupported": { "anyOf": [ @@ -541,7 +547,7 @@ "$ref": "#/$defs/BooleanOrJinjaString" } ], - "default": null + "default": "" } }, "required": [ @@ -565,7 +571,7 @@ "$ref": "#/$defs/BooleanOrJinjaString" } ], - "default": null + "default": true } }, "title": "Contract", @@ -585,7 +591,7 @@ "type": "string" } ], - "default": null, + "default": "", "title": "Description" }, "filter": { @@ -594,7 +600,7 @@ "type": "string" } ], - "default": null, + "default": "", "title": "Filter" }, "group": { @@ -603,7 +609,7 @@ "$ref": "#/$defs/GroupName" } ], - "default": null + "default": "" }, "label": { "title": "Label", @@ -642,7 +648,7 @@ "$ref": "#/$defs/ConversionTypeParams" } ], - "default": null + "default": "" } }, "title": "ConversionMetricTypeParams", @@ -671,7 +677,7 @@ "type": "array" } ], - "default": null, + "default": "", "title": "Constant Properties" }, "conversion_measure": { @@ -688,7 +694,7 @@ "type": "string" } ], - "default": null, + "default": "", "title": "Window" } }, @@ -714,7 +720,7 @@ "type": "string" } ], - "default": null, + "default": "", "title": "Description" }, "filter": { @@ -723,7 +729,7 @@ "type": "string" } ], - "default": null, + "default": "", "title": "Filter" }, "group": { @@ -732,7 +738,7 @@ "$ref": "#/$defs/GroupName" } ], - "default": null + "default": "" }, "label": { "title": "Label", @@ -771,7 +777,7 @@ "$ref": "#/$defs/GrainToDate" } ], - "default": null + "default": "month" }, "measure": { "anyOf": [ @@ -779,7 +785,7 @@ "$ref": "#/$defs/MetricInputMeasure" } ], - "default": null + "default": "" }, "window": { "anyOf": [ @@ -787,7 +793,7 @@ "type": "string" } ], - "default": null, + "default": "", "title": "Window" } }, @@ -823,7 +829,7 @@ "type": "string" } ], - "default": null, + "default": "", "title": "Agg Time Dimension" } }, @@ -844,7 +850,7 @@ "type": "string" } ], - "default": null, + "default": "", "title": "Description" }, "filter": { @@ -853,7 +859,7 @@ "type": "string" } ], - "default": null, + "default": "", "title": "Filter" }, "group": { @@ -862,7 +868,7 @@ "$ref": "#/$defs/GroupName" } ], - "default": null + "default": "" }, "label": { "title": "Label", @@ -901,7 +907,7 @@ "type": "string" } ], - "default": null, + "default": "", "title": "Expr" }, "metrics": { @@ -913,7 +919,7 @@ "type": "array" } ], - "default": null, + "default": "", "title": "Metrics" } }, @@ -943,7 +949,7 @@ "$ref": "#/$defs/ValidityParams" } ], - "default": null + "default": "" } }, "required": [ @@ -1001,19 +1007,17 @@ "type": "string" } ], - "default": null, + "default": "", "title": "Entity" }, "expr": { "anyOf": [ { "type": "string" - }, - { - "type": "boolean" } ], - "default": null, + "default": "", + "description": "The field that denotes the entity. Defaults to name if unspecified", "title": "Expr" } }, @@ -1038,102 +1042,6 @@ "title": "EntityType", "type": "string" }, - "ExpectCSV": { - "properties": { - "format": { - "const": "csv", - "default": "csv", - "enum": [ - "csv" - ], - "title": "Format", - "type": "string" - }, - "rows": { - "anyOf": [ - { - "type": "string" - } - ], - "default": null, - "description": "When `format` is csv or sql, a string containing comma-separated headers and values. Alternatively provide a fixture. Use the pipe character | to create a multi-line string in YAML.", - "title": "Rows" - }, - "fixture": { - "anyOf": [ - { - "type": "string" - } - ], - "default": null, - "description": "Specify the name of a fixture instead of providing `rows`.", - "title": "Fixture" - } - }, - "title": "ExpectCSV", - "type": "object" - }, - "ExpectDict": { - "properties": { - "format": { - "const": "dict", - "default": "dict", - "enum": [ - "dict" - ], - "title": "Format", - "type": "string" - }, - "rows": { - "description": "When `format` is `dict`, each item should be a dictionary containing a key-value pair for each column and its value, e.g. `{id: 1, code: 'ABC'}`", - "items": { - "type": "object" - }, - "title": "Rows", - "type": "array" - } - }, - "required": [ - "rows" - ], - "title": "ExpectDict", - "type": "object" - }, - "ExpectSQL": { - "properties": { - "format": { - "const": "sql", - "default": "sql", - "enum": [ - "sql" - ], - "title": "Format", - "type": "string" - }, - "rows": { - "anyOf": [ - { - "type": "string" - } - ], - "default": null, - "description": "When `format` is csv or sql, a string containing comma-separated headers and values. Alternatively provide a fixture. Use the pipe character | to create a multi-line string in YAML.", - "title": "Rows" - }, - "fixture": { - "anyOf": [ - { - "type": "string" - } - ], - "default": null, - "description": "Specify the name of a fixture instead of providing `rows`.", - "title": "Fixture" - } - }, - "title": "ExpectSQL", - "type": "object" - }, "Export": { "additionalProperties": false, "properties": { @@ -1147,12 +1055,12 @@ "$ref": "#/$defs/ExportConfig" } ], - "default": null, "title": "Export Config" } }, "required": [ - "name" + "name", + "config" ], "title": "Export", "type": "object" @@ -1175,7 +1083,7 @@ "type": "string" } ], - "default": null, + "default": "", "title": "Alias" }, "export_as": { @@ -1184,7 +1092,7 @@ "$ref": "#/$defs/ExportAs" } ], - "default": null + "default": "" }, "schema": { "anyOf": [ @@ -1192,7 +1100,7 @@ "type": "string" } ], - "default": null, + "default": "", "title": "Schema" } }, @@ -1211,7 +1119,7 @@ "type": "string" } ], - "default": null, + "default": "", "title": "Description" }, "type": { @@ -1230,7 +1138,7 @@ "type": "string" } ], - "default": null, + "default": "", "title": "Label" }, "maturity": { @@ -1239,7 +1147,7 @@ "$ref": "#/$defs/Maturity" } ], - "default": null + "default": "medium" }, "meta": { "anyOf": [ @@ -1247,7 +1155,7 @@ "type": "object" } ], - "default": null, + "default": "", "title": "Meta" }, "owner": { @@ -1267,7 +1175,7 @@ "$ref": "#/$defs/StringOrArrayOfStrings" } ], - "default": null + "default": "" }, "url": { "anyOf": [ @@ -1275,7 +1183,7 @@ "type": "string" } ], - "default": null, + "default": "", "title": "Url" } }, @@ -1288,15 +1196,6 @@ "title": "Exposure", "type": "object" }, - "Format": { - "enum": [ - "csv", - "dict", - "sql" - ], - "title": "Format", - "type": "string" - }, "FreshnessDefinition": { "additionalProperties": false, "properties": { @@ -1352,53 +1251,6 @@ "title": "FreshnessRules", "type": "object" }, - "GivenItem": { - "properties": { - "fixture": { - "anyOf": [ - { - "type": "string" - } - ], - "default": null, - "description": "Only relevant when format is csv. Specify the name of a fixture instead of providing `rows`.", - "title": "Fixture" - }, - "format": { - "anyOf": [ - { - "$ref": "#/$defs/Format" - } - ], - "default": null, - "description": "Defaults to `dict` when not specified" - }, - "input": { - "anyOf": [ - { - "type": "string" - } - ], - "default": null, - "description": "The relation whose inputs you need to mock. Enclose in ref or source without curly braces", - "examples": [ - "ref('model_b')", - "ref('upstream_project', 'model_b')", - "source('schema', 'table')" - ], - "title": "Input" - }, - "additionalProperties": { - "anyOf": [ - {} - ], - "default": null, - "title": "Additionalproperties" - } - }, - "title": "GivenItem", - "type": "object" - }, "GrainToDate": { "enum": [ "day", @@ -1456,7 +1308,7 @@ "$ref": "#/$defs/StringOrArrayOfStrings" } ], - "default": null + "default": "" }, "include": { "anyOf": [ @@ -1464,7 +1316,7 @@ "$ref": "#/$defs/StringOrArrayOfStrings" } ], - "default": null + "default": "" } }, "title": "IncludeExclude", @@ -1488,7 +1340,7 @@ "type": "string" } ], - "default": null, + "default": "", "title": "Description" }, "arguments": { @@ -1500,7 +1352,7 @@ "type": "array" } ], - "default": null, + "default": "", "title": "Arguments" }, "docs": { @@ -1509,7 +1361,7 @@ "$ref": "#/$defs/DocsConfig" } ], - "default": null + "default": "" } }, "required": [ @@ -1541,7 +1393,7 @@ "type": "string" } ], - "default": null, + "default": "", "title": "Description" }, "agg": { @@ -1553,7 +1405,7 @@ "$ref": "#/$defs/AggregationTypeParams" } ], - "default": null + "default": "" }, "agg_time_dimension": { "anyOf": [ @@ -1571,7 +1423,7 @@ "type": "boolean" } ], - "default": null, + "default": true, "title": "Create Metric" }, "create_metric_display_name": { @@ -1580,7 +1432,7 @@ "type": "string" } ], - "default": null, + "default": "", "title": "Create Metric Display Name" }, "expr": { @@ -1595,7 +1447,7 @@ "type": "boolean" } ], - "default": null, + "default": "", "title": "Expr" }, "label": { @@ -1604,7 +1456,7 @@ "type": "string" } ], - "default": null, + "default": "", "title": "Label" }, "non_additive_dimension": { @@ -1613,7 +1465,12 @@ "$ref": "#/$defs/NonAdditiveDimension" } ], - "default": null + "default": { + "name": "", + "window_choice": "min", + "window_groupings": [] + }, + "description": "Specify dimensions that the measure should not be aggregated over." } }, "required": [ @@ -1632,7 +1489,7 @@ "type": "string" } ], - "default": null, + "default": "", "title": "Name" }, "fill_nulls_with": { @@ -1644,7 +1501,7 @@ "type": "integer" } ], - "default": null, + "default": 0, "title": "Fill Nulls With" }, "filter": { @@ -1653,7 +1510,7 @@ "type": "string" } ], - "default": null, + "default": "", "title": "Filter" }, "join_to_timespine": { @@ -1662,7 +1519,8 @@ "type": "boolean" } ], - "default": null, + "default": true, + "description": "Indicates if the aggregated measure should be joined to the time spine table to fill in missing dates", "title": "Join To Timespine" } }, @@ -1678,7 +1536,7 @@ "type": "string" } ], - "default": null, + "default": "", "title": "Name" }, "alias": { @@ -1687,7 +1545,7 @@ "type": "string" } ], - "default": null, + "default": "", "title": "Alias" }, "filter": { @@ -1696,7 +1554,7 @@ "type": "string" } ], - "default": null, + "default": "", "title": "Filter" }, "offset_window": { @@ -1705,7 +1563,7 @@ "type": "string" } ], - "default": null, + "default": "", "title": "Offset Window" } }, @@ -1725,7 +1583,7 @@ "type": "string" } ], - "default": null, + "default": "", "title": "Description" }, "access": { @@ -1734,7 +1592,7 @@ "$ref": "#/$defs/Access" } ], - "default": null + "default": "private" }, "columns": { "anyOf": [ @@ -1745,7 +1603,7 @@ "type": "array" } ], - "default": null, + "default": "", "title": "Columns" }, "config": { @@ -1754,7 +1612,7 @@ "$ref": "#/$defs/ModelConfigs" } ], - "default": null + "default": "" }, "constraints": { "anyOf": [ @@ -1762,7 +1620,7 @@ "$ref": "#/$defs/Constraints" } ], - "default": null + "default": "" }, "data_tests": { "anyOf": [ @@ -1773,7 +1631,7 @@ "type": "array" } ], - "default": null, + "default": "", "title": "Data Tests" }, "deprecation_date": { @@ -1782,7 +1640,7 @@ "type": "string" } ], - "default": null, + "default": "", "title": "Deprecation Date" }, "docs": { @@ -1791,7 +1649,7 @@ "$ref": "#/$defs/DocsConfig" } ], - "default": null + "default": "" }, "group": { "anyOf": [ @@ -1799,7 +1657,7 @@ "$ref": "#/$defs/GroupName" } ], - "default": null + "default": "" }, "latest_version": { "anyOf": [ @@ -1807,7 +1665,7 @@ "type": "number" } ], - "default": null, + "default": "", "title": "Latest Version" }, "meta": { @@ -1816,7 +1674,7 @@ "type": "object" } ], - "default": null, + "default": "", "title": "Meta" }, "tests": { @@ -1828,7 +1686,7 @@ "type": "array" } ], - "default": null, + "default": "", "title": "Tests" }, "versions": { @@ -1840,7 +1698,7 @@ "type": "array" } ], - "default": null, + "default": "", "title": "Versions" } }, @@ -1858,7 +1716,7 @@ "$ref": "#/$defs/BooleanOrJinjaString" } ], - "default": null + "default": true }, "backup": { "anyOf": [ @@ -1866,7 +1724,7 @@ "$ref": "#/$defs/BooleanOrJinjaString" } ], - "default": null + "default": true }, "contract": { "anyOf": [ @@ -1874,7 +1732,9 @@ "$ref": "#/$defs/Contract" } ], - "default": null + "default": { + "enforced": true + } }, "file_format": { "anyOf": [ @@ -1882,7 +1742,7 @@ "type": "string" } ], - "default": null, + "default": "", "title": "File Format" }, "grant_access_to": { @@ -1904,7 +1764,12 @@ "$ref": "#/$defs/Grants" } ], - "default": null + "default": { + "select": [ + "reporter_role", + "bi_user" + ] + } }, "hours_to_expiration": { "anyOf": [ @@ -1912,7 +1777,7 @@ "type": "number" } ], - "default": null, + "default": 1, "description": "Configuration specific to BigQuery adapter used to set an expiration delay (in hours) to a table.", "title": "Hours To Expiration" }, @@ -1923,7 +1788,7 @@ "type": "string" } ], - "default": null, + "default": "", "description": "Configuration of the KMS key name, specific to BigQuery adapter.", "title": "Kms Key Name" }, @@ -1936,7 +1801,9 @@ "type": "object" } ], - "default": null, + "default": { + "key": "value" + }, "description": "Configuration specific to BigQuery adapter used to add labels and tags to tables/views created by dbt.", "title": "Label configs" }, @@ -1946,7 +1813,7 @@ "type": "string" } ], - "default": null, + "default": "", "title": "Location" }, "materialized": { @@ -1955,7 +1822,7 @@ "type": "string" } ], - "default": null, + "default": "", "title": "Materialized" }, "on_configuration_change": { @@ -1964,7 +1831,7 @@ "$ref": "#/$defs/OnConfigurationChange" } ], - "default": null + "default": "" }, "on_schema_change": { "anyOf": [ @@ -1972,7 +1839,7 @@ "$ref": "#/$defs/OnSchemaChange" } ], - "default": null + "default": "" }, "snowflake_warehouse": { "anyOf": [ @@ -1980,7 +1847,7 @@ "type": "string" } ], - "default": null, + "default": "", "title": "Snowflake Warehouse" }, "sql_header": { @@ -1989,7 +1856,7 @@ "type": "string" } ], - "default": null, + "default": "", "title": "Sql Header" }, "target_lag": { @@ -2010,16 +1877,19 @@ "additionalProperties": false, "properties": { "name": { + "default": "", + "description": "The name of the time dimension (that has already been defined in the data source) that the measure should not be aggregated over.", "title": "Name", "type": "string" }, "window_choice": { - "anyOf": [ + "allOf": [ { "$ref": "#/$defs/WindowChoice" } ], - "default": null + "default": "min", + "description": "`min` and `max` reflect the beginning and end of the time period respectively." }, "window_groupings": { "anyOf": [ @@ -2030,13 +1900,11 @@ "type": "array" } ], - "default": null, + "default": [], + "description": "Provide the entities that you would like to group by.", "title": "Window Groupings" } }, - "required": [ - "name" - ], "title": "NonAdditiveDimension", "type": "object" }, @@ -2048,7 +1916,7 @@ "type": "string" } ], - "default": null, + "default": "", "title": "Name" }, "config": { @@ -2057,7 +1925,7 @@ "$ref": "#/$defs/TestConfigs" } ], - "default": null + "default": "" }, "where": { "anyOf": [ @@ -2065,7 +1933,7 @@ "type": "string" } ], - "default": null, + "default": "", "title": "Where" } }, @@ -2080,7 +1948,7 @@ "$ref": "#/$defs/NotNull" } ], - "default": null + "default": "" } }, "title": "NotNullTest", @@ -2125,7 +1993,9 @@ "type": "object" } ], - "default": null, + "default": { + "ENV_VAR_NAME": "value" + }, "title": "Env Vars" }, "macros": { @@ -2148,7 +2018,9 @@ "type": "object" } ], - "default": null, + "default": { + "var_name": "value" + }, "title": "Vars" } }, @@ -2221,7 +2093,7 @@ "$ref": "#/$defs/ArrayOfStrings" } ], - "default": null + "default": "" }, "metrics": { "anyOf": [ @@ -2229,7 +2101,7 @@ "$ref": "#/$defs/ArrayOfStrings" } ], - "default": null + "default": "" }, "where": { "anyOf": [ @@ -2237,14 +2109,7 @@ "$ref": "#/$defs/ArrayOfStrings" } ], - "default": null - }, - "additionalProperties": { - "anyOf": [ - {} - ], - "default": null, - "title": "Additionalproperties" + "default": "" } }, "title": "QueryParams", @@ -2259,7 +2124,7 @@ "$ref": "#/$defs/BooleanOrJinjaString" } ], - "default": null + "default": "" }, "identifier": { "anyOf": [ @@ -2267,7 +2132,7 @@ "$ref": "#/$defs/BooleanOrJinjaString" } ], - "default": null + "default": "" }, "schema": { "anyOf": [ @@ -2275,7 +2140,7 @@ "$ref": "#/$defs/BooleanOrJinjaString" } ], - "default": null + "default": "" } }, "title": "Quoting", @@ -2295,7 +2160,7 @@ "type": "string" } ], - "default": null, + "default": "", "title": "Description" }, "filter": { @@ -2304,7 +2169,7 @@ "type": "string" } ], - "default": null, + "default": "", "title": "Filter" }, "group": { @@ -2313,7 +2178,7 @@ "$ref": "#/$defs/GroupName" } ], - "default": null + "default": "" }, "label": { "title": "Label", @@ -2352,7 +2217,7 @@ "$ref": "#/$defs/MetricInputSchema" } ], - "default": null + "default": "" }, "filter": { "anyOf": [ @@ -2360,7 +2225,7 @@ "type": "string" } ], - "default": null, + "default": "", "title": "Filter" }, "numerator": { @@ -2369,13 +2234,14 @@ "$ref": "#/$defs/MetricInputSchema" } ], - "default": null + "default": "" } }, "title": "RatioMetricTypeParams", "type": "object" }, "Relationships": { + "additionalProperties": false, "properties": { "name": { "anyOf": [ @@ -2383,7 +2249,7 @@ "type": "string" } ], - "default": null, + "default": "", "title": "Name" }, "config": { @@ -2392,7 +2258,7 @@ "$ref": "#/$defs/TestConfigs" } ], - "default": null + "default": "" }, "field": { "description": "The foreign key column", @@ -2413,7 +2279,7 @@ "type": "string" } ], - "default": null, + "default": "", "title": "Where" } }, @@ -2432,7 +2298,7 @@ "$ref": "#/$defs/Relationships" } ], - "default": null + "default": "" } }, "title": "RelationshipsTest", @@ -2458,7 +2324,7 @@ "type": "array" } ], - "default": null, + "default": "", "title": "Exports" }, "label": { @@ -2491,7 +2357,7 @@ "type": "string" } ], - "default": null, + "default": "", "title": "Description" }, "columns": { @@ -2503,7 +2369,7 @@ "type": "array" } ], - "default": null, + "default": "", "title": "Columns" }, "config": { @@ -2512,7 +2378,7 @@ "$ref": "#/$defs/SeedConfig" } ], - "default": null, + "default": "", "title": "Seed Config" }, "docs": { @@ -2521,7 +2387,7 @@ "$ref": "#/$defs/DocsConfig" } ], - "default": null + "default": "" }, "group": { "anyOf": [ @@ -2529,7 +2395,7 @@ "$ref": "#/$defs/GroupName" } ], - "default": null + "default": "" }, "tests": { "anyOf": [ @@ -2540,7 +2406,7 @@ "type": "array" } ], - "default": null, + "default": "", "title": "Tests" } }, @@ -2558,7 +2424,7 @@ "type": "object" } ], - "default": null, + "default": "", "title": "Column Types" }, "copy_grants": { @@ -2567,7 +2433,7 @@ "$ref": "#/$defs/BooleanOrJinjaString" } ], - "default": null + "default": true }, "data_tests": { "anyOf": [ @@ -2578,7 +2444,7 @@ "type": "array" } ], - "default": null, + "default": "", "title": "Data Tests" }, "database": { @@ -2587,7 +2453,7 @@ "type": "string" } ], - "default": null, + "default": "", "title": "Database" }, "enabled": { @@ -2596,7 +2462,7 @@ "$ref": "#/$defs/BooleanOrJinjaString" } ], - "default": null + "default": false }, "grants": { "anyOf": [ @@ -2604,7 +2470,12 @@ "$ref": "#/$defs/Grants" } ], - "default": null + "default": { + "select": [ + "reporter_role", + "bi_user" + ] + } }, "quote_columns": { "anyOf": [ @@ -2612,7 +2483,7 @@ "$ref": "#/$defs/BooleanOrJinjaString" } ], - "default": null + "default": "" }, "schema": { "anyOf": [ @@ -2641,7 +2512,7 @@ "type": "string" } ], - "default": null, + "default": "", "title": "Description" }, "defaults": { @@ -2650,7 +2521,7 @@ "$ref": "#/$defs/Defaults" } ], - "default": null + "default": "" }, "dimensions": { "anyOf": [ @@ -2661,7 +2532,7 @@ "type": "array" } ], - "default": null, + "default": "", "title": "Dimensions" }, "entities": { @@ -2673,7 +2544,7 @@ "type": "array" } ], - "default": null, + "default": "", "title": "Entities" }, "measures": { @@ -2685,7 +2556,7 @@ "type": "array" } ], - "default": null, + "default": "", "title": "Measures" }, "model": { @@ -2698,7 +2569,7 @@ "type": "string" } ], - "default": null, + "default": "", "title": "Primary Entity" } }, @@ -2731,7 +2602,7 @@ "type": "string" } ], - "default": null, + "default": "", "title": "Description" }, "filter": { @@ -2740,7 +2611,7 @@ "type": "string" } ], - "default": null, + "default": "", "title": "Filter" }, "group": { @@ -2749,7 +2620,7 @@ "$ref": "#/$defs/GroupName" } ], - "default": null + "default": "" }, "label": { "title": "Label", @@ -2788,7 +2659,7 @@ "$ref": "#/$defs/MetricInputMeasure" } ], - "default": null + "default": "" } }, "title": "SimpleMetricTypeParams", @@ -2807,7 +2678,7 @@ "type": "string" } ], - "default": null, + "default": "", "title": "Description" }, "columns": { @@ -2819,7 +2690,7 @@ "type": "array" } ], - "default": null, + "default": "", "title": "Columns" }, "config": { @@ -2828,7 +2699,7 @@ "$ref": "#/$defs/SnapshotConfig" } ], - "default": null, + "default": "", "title": "Snapshot Config" }, "data_tests": { @@ -2840,7 +2711,7 @@ "type": "array" } ], - "default": null, + "default": "", "title": "Data Tests" }, "docs": { @@ -2849,7 +2720,7 @@ "$ref": "#/$defs/DocsConfig" } ], - "default": null + "default": "" }, "group": { "anyOf": [ @@ -2857,7 +2728,7 @@ "$ref": "#/$defs/GroupName" } ], - "default": null + "default": "" }, "meta": { "anyOf": [ @@ -2865,7 +2736,7 @@ "type": "object" } ], - "default": null, + "default": "", "title": "Meta" }, "tests": { @@ -2877,7 +2748,7 @@ "type": "array" } ], - "default": null, + "default": "", "title": "Tests" } }, @@ -2895,7 +2766,7 @@ "type": "string" } ], - "default": null, + "default": "", "title": "Alias" }, "check_cols": { @@ -2904,7 +2775,7 @@ "$ref": "#/$defs/StringOrArrayOfStrings" } ], - "default": null + "default": "" }, "enabled": { "anyOf": [ @@ -2912,7 +2783,7 @@ "$ref": "#/$defs/BooleanOrJinjaString" } ], - "default": null + "default": false }, "grants": { "anyOf": [ @@ -2920,7 +2791,12 @@ "$ref": "#/$defs/Grants" } ], - "default": null + "default": { + "select": [ + "reporter_role", + "bi_user" + ] + } }, "persist_docs": { "anyOf": [ @@ -2928,7 +2804,7 @@ "$ref": "#/$defs/PersistDocsConfig" } ], - "default": null + "default": "" }, "post-hook": { "anyOf": [ @@ -2936,7 +2812,7 @@ "$ref": "#/$defs/ArrayOfStrings" } ], - "default": null + "default": "" }, "pre-hook": { "anyOf": [ @@ -2944,7 +2820,7 @@ "$ref": "#/$defs/ArrayOfStrings" } ], - "default": null + "default": "" }, "quote_columns": { "anyOf": [ @@ -2952,7 +2828,7 @@ "$ref": "#/$defs/BooleanOrJinjaString" } ], - "default": null + "default": "" }, "strategy": { "anyOf": [ @@ -2960,7 +2836,7 @@ "type": "string" } ], - "default": null, + "default": "", "title": "Strategy" }, "tags": { @@ -2969,7 +2845,7 @@ "$ref": "#/$defs/StringOrArrayOfStrings" } ], - "default": null + "default": "" }, "target_database": { "anyOf": [ @@ -2977,7 +2853,7 @@ "type": "string" } ], - "default": null, + "default": "", "title": "Target Database" }, "target_schema": { @@ -2986,7 +2862,7 @@ "type": "string" } ], - "default": null, + "default": "", "title": "Target Schema" }, "unique_key": { @@ -2995,7 +2871,7 @@ "$ref": "#/$defs/StringOrArrayOfStrings" } ], - "default": null + "default": "" }, "updated_at": { "anyOf": [ @@ -3003,7 +2879,7 @@ "type": "string" } ], - "default": null, + "default": "", "title": "Updated At" } }, @@ -3023,7 +2899,7 @@ "type": "string" } ], - "default": null, + "default": "", "title": "Description" }, "config": { @@ -3032,7 +2908,7 @@ "type": "object" } ], - "default": null, + "default": "", "title": "Config" }, "data_tests": { @@ -3044,7 +2920,7 @@ "type": "array" } ], - "default": null, + "default": "", "title": "Data Tests" }, "database": { @@ -3053,7 +2929,7 @@ "type": "string" } ], - "default": null, + "default": "", "title": "Database" }, "freshness": { @@ -3084,7 +2960,7 @@ "type": "string" } ], - "default": null, + "default": "", "title": "Loaded At Field" }, "loader": { @@ -3093,7 +2969,7 @@ "type": "string" } ], - "default": null, + "default": "", "title": "Loader" }, "meta": { @@ -3102,7 +2978,7 @@ "type": "object" } ], - "default": null, + "default": "", "title": "Meta" }, "overrides": { @@ -3121,7 +2997,7 @@ "$ref": "#/$defs/Quoting" } ], - "default": null + "default": "" }, "schema": { "anyOf": [ @@ -3142,7 +3018,7 @@ "type": "array" } ], - "default": null, + "default": "", "title": "Tables" }, "tags": { @@ -3151,7 +3027,7 @@ "$ref": "#/$defs/StringOrArrayOfStrings" } ], - "default": null + "default": "" }, "tests": { "anyOf": [ @@ -3162,7 +3038,7 @@ "type": "array" } ], - "default": null, + "default": "", "title": "Tests" } }, @@ -3197,7 +3073,7 @@ "type": "string" } ], - "default": null, + "default": "", "title": "Description" }, "columns": { @@ -3209,7 +3085,7 @@ "type": "array" } ], - "default": null, + "default": "", "title": "Columns" }, "external": { @@ -3218,7 +3094,7 @@ "type": "object" } ], - "default": null, + "default": "", "title": "External" }, "freshness": { @@ -3269,7 +3145,7 @@ "type": "string" } ], - "default": null, + "default": "", "title": "Loader" }, "meta": { @@ -3278,7 +3154,7 @@ "type": "object" } ], - "default": null, + "default": "", "title": "Meta" }, "quoting": { @@ -3287,7 +3163,7 @@ "$ref": "#/$defs/Quoting" } ], - "default": null + "default": "" }, "tags": { "anyOf": [ @@ -3295,7 +3171,7 @@ "$ref": "#/$defs/StringOrArrayOfStrings" } ], - "default": null + "default": "" }, "tests": { "anyOf": [ @@ -3306,7 +3182,7 @@ "type": "array" } ], - "default": null, + "default": "", "title": "Tests" } }, @@ -3344,7 +3220,7 @@ "$ref": "#/$defs/BooleanOrJinjaString" } ], - "default": null + "default": false }, "error_if": { "anyOf": [ @@ -3352,7 +3228,7 @@ "type": "string" } ], - "default": null, + "default": "", "title": "Error If" }, "fail_calc": { @@ -3361,7 +3237,7 @@ "type": "string" } ], - "default": null, + "default": "", "title": "Fail Calc" }, "limit": { @@ -3370,7 +3246,7 @@ "type": "number" } ], - "default": null, + "default": 20, "title": "Limit" }, "schema": { @@ -3392,7 +3268,7 @@ "$ref": "#/$defs/Severity" } ], - "default": null, + "default": "warn", "title": "Severity" }, "store_failures": { @@ -3401,7 +3277,7 @@ "$ref": "#/$defs/BooleanOrJinjaString" } ], - "default": null + "default": true }, "tags": { "anyOf": [ @@ -3409,7 +3285,7 @@ "$ref": "#/$defs/StringOrArrayOfStrings" } ], - "default": null + "default": "" }, "warn_if": { "anyOf": [ @@ -3417,7 +3293,7 @@ "type": "string" } ], - "default": null, + "default": "", "title": "Warn If" } }, @@ -3438,7 +3314,7 @@ "type": "string" } ], - "default": null, + "default": "", "title": "Description" }, "expr": { @@ -3450,7 +3326,7 @@ "type": "boolean" } ], - "default": null, + "default": "", "title": "Expr" }, "is_partition": { @@ -3459,7 +3335,7 @@ "type": "boolean" } ], - "default": null, + "default": true, "title": "Is Partition" }, "type": { @@ -3520,7 +3396,7 @@ "type": "string" } ], - "default": null, + "default": "", "title": "Name" }, "config": { @@ -3529,7 +3405,7 @@ "$ref": "#/$defs/TestConfigs" } ], - "default": null + "default": "" }, "where": { "anyOf": [ @@ -3537,7 +3413,7 @@ "type": "string" } ], - "default": null, + "default": "", "title": "Where" } }, @@ -3552,7 +3428,7 @@ "$ref": "#/$defs/Unique" } ], - "default": null + "default": "" } }, "title": "UniqueTest", @@ -3571,7 +3447,7 @@ "type": "string" } ], - "default": null, + "default": "", "title": "Description" }, "config": { @@ -3586,13 +3462,13 @@ "expect": { "anyOf": [ { - "$ref": "#/$defs/ExpectDict" + "$ref": "#/$defs/UnitTestExpectDict" }, { - "$ref": "#/$defs/ExpectCSV" + "$ref": "#/$defs/UnitTestExpectCSV" }, { - "$ref": "#/$defs/ExpectSQL" + "$ref": "#/$defs/UnitTestExpectSQL" } ], "title": "Expect" @@ -3601,12 +3477,33 @@ "anyOf": [ { "items": { - "$ref": "#/$defs/GivenItem" + "anyOf": [ + { + "$ref": "#/$defs/UnitTestGivenDict" + }, + { + "$ref": "#/$defs/UnitTestGivenCSV" + }, + { + "$ref": "#/$defs/UnitTestGivenSQL" + } + ] }, "type": "array" } ], - "default": null, + "default": [ + { + "format": "dict", + "rows": [ + { + "col1": "value1", + "col2": "value2" + } + ], + "input": "" + } + ], "title": "Given" }, "model": { @@ -3623,14 +3520,7 @@ "$ref": "#/$defs/Overrides" } ], - "default": null - }, - "additionalProperties": { - "anyOf": [ - {} - ], - "default": null, - "title": "Additionalproperties" + "default": "" } }, "required": [ @@ -3650,7 +3540,7 @@ "type": "object" } ], - "default": null, + "default": "", "title": "Meta" }, "tags": { @@ -3659,12 +3549,225 @@ "$ref": "#/$defs/StringOrArrayOfStrings" } ], - "default": null + "default": "" } }, "title": "UnitTestConfig", "type": "object" }, + "UnitTestExpectCSV": { + "properties": { + "format": { + "const": "csv", + "default": "csv", + "enum": [ + "csv" + ], + "title": "Format", + "type": "string" + }, + "rows": { + "anyOf": [ + { + "type": "string" + } + ], + "default": "", + "description": "When `format` is csv or sql, a string containing comma-separated headers and values. Alternatively specify the `fixture` property. Use the pipe character | to create a multi-line string in YAML.", + "title": "Rows" + }, + "fixture": { + "anyOf": [ + { + "type": "string" + } + ], + "default": "", + "description": "Specify the name of a fixture instead of providing `rows`. Does not need to be wrapped in ref.", + "title": "Fixture" + } + }, + "title": "UnitTestExpectCSV", + "type": "object" + }, + "UnitTestExpectDict": { + "properties": { + "format": { + "const": "dict", + "default": "dict", + "enum": [ + "dict" + ], + "title": "Format", + "type": "string" + }, + "rows": { + "description": "When `format` is `dict`, each item should be a dictionary containing a key-value pair for each column and its value, e.g. `{id: 1, code: 'ABC'}`", + "items": { + "type": "object" + }, + "title": "Rows", + "type": "array" + } + }, + "required": [ + "rows" + ], + "title": "UnitTestExpectDict", + "type": "object" + }, + "UnitTestExpectSQL": { + "properties": { + "format": { + "const": "sql", + "default": "sql", + "enum": [ + "sql" + ], + "title": "Format", + "type": "string" + }, + "rows": { + "anyOf": [ + { + "type": "string" + } + ], + "default": "", + "description": "When `format` is csv or sql, a string containing comma-separated headers and values. Alternatively specify the `fixture` property. Use the pipe character | to create a multi-line string in YAML.", + "title": "Rows" + }, + "fixture": { + "anyOf": [ + { + "type": "string" + } + ], + "default": "", + "description": "Specify the name of a fixture instead of providing `rows`. Does not need to be wrapped in ref.", + "title": "Fixture" + } + }, + "title": "UnitTestExpectSQL", + "type": "object" + }, + "UnitTestGivenCSV": { + "additionalProperties": false, + "properties": { + "format": { + "const": "csv", + "default": "csv", + "enum": [ + "csv" + ], + "title": "Format", + "type": "string" + }, + "rows": { + "anyOf": [ + { + "type": "string" + } + ], + "default": "", + "description": "When `format` is csv or sql, a string containing comma-separated headers and values. Alternatively specify the `fixture` property. Use the pipe character | to create a multi-line string in YAML.", + "title": "Rows" + }, + "fixture": { + "anyOf": [ + { + "type": "string" + } + ], + "default": "", + "description": "Specify the name of a fixture instead of providing `rows`. Does not need to be wrapped in ref.", + "title": "Fixture" + }, + "input": { + "default": "ref('')", + "description": "The Relation whose input you want to mock", + "title": "Input", + "type": "string" + } + }, + "title": "UnitTestGivenCSV", + "type": "object" + }, + "UnitTestGivenDict": { + "additionalProperties": false, + "properties": { + "format": { + "const": "dict", + "default": "dict", + "enum": [ + "dict" + ], + "title": "Format", + "type": "string" + }, + "rows": { + "description": "When `format` is `dict`, each item should be a dictionary containing a key-value pair for each column and its value, e.g. `{id: 1, code: 'ABC'}`", + "items": { + "type": "object" + }, + "title": "Rows", + "type": "array" + }, + "input": { + "default": "ref('')", + "description": "The Relation whose input you want to mock", + "title": "Input", + "type": "string" + } + }, + "required": [ + "rows" + ], + "title": "UnitTestGivenDict", + "type": "object" + }, + "UnitTestGivenSQL": { + "additionalProperties": false, + "properties": { + "format": { + "const": "sql", + "default": "sql", + "enum": [ + "sql" + ], + "title": "Format", + "type": "string" + }, + "rows": { + "anyOf": [ + { + "type": "string" + } + ], + "default": "", + "description": "When `format` is csv or sql, a string containing comma-separated headers and values. Alternatively specify the `fixture` property. Use the pipe character | to create a multi-line string in YAML.", + "title": "Rows" + }, + "fixture": { + "anyOf": [ + { + "type": "string" + } + ], + "default": "", + "description": "Specify the name of a fixture instead of providing `rows`. Does not need to be wrapped in ref.", + "title": "Fixture" + }, + "input": { + "default": "ref('')", + "description": "The Relation whose input you want to mock", + "title": "Input", + "type": "string" + } + }, + "title": "UnitTestGivenSQL", + "type": "object" + }, "ValidityParams": { "additionalProperties": false, "properties": { @@ -3674,7 +3777,7 @@ "type": "boolean" } ], - "default": null, + "default": "", "title": "Is End" }, "is_start": { @@ -3683,7 +3786,7 @@ "type": "boolean" } ], - "default": null, + "default": "", "title": "Is Start" } }, @@ -3708,7 +3811,7 @@ "type": "array" } ], - "default": null, + "default": {}, "title": "Columns" }, "config": { @@ -3717,16 +3820,14 @@ "$ref": "#/$defs/ModelConfigs" } ], - "default": null + "default": {} }, "v": { + "default": 1, "title": "V", "type": "number" } }, - "required": [ - "v" - ], "title": "Version", "type": "object" }, @@ -3756,12 +3857,12 @@ "anyOf": [ { "items": { - "$ref": "#/$defs/Analyse" + "$ref": "#/$defs/Analysis" }, "type": "array" } ], - "default": null, + "default": "", "title": "Analyses" }, "exposures": { @@ -3773,7 +3874,7 @@ "type": "array" } ], - "default": null, + "default": "", "title": "Exposures" }, "groups": { @@ -3785,7 +3886,7 @@ "type": "array" } ], - "default": null, + "default": "", "title": "Groups" }, "macros": { @@ -3797,7 +3898,7 @@ "type": "array" } ], - "default": null, + "default": "", "title": "Macros" }, "metrics": { @@ -3825,7 +3926,7 @@ "type": "array" } ], - "default": null, + "default": "", "title": "Metrics" }, "models": { @@ -3837,7 +3938,7 @@ "type": "array" } ], - "default": null, + "default": "", "title": "Models" }, "saved_queries": { @@ -3849,7 +3950,7 @@ "type": "array" } ], - "default": null, + "default": "", "title": "Saved Queries" }, "seeds": { @@ -3861,7 +3962,7 @@ "type": "array" } ], - "default": null, + "default": "", "title": "Seeds" }, "semantic_models": { @@ -3873,7 +3974,7 @@ "type": "array" } ], - "default": null, + "default": "", "title": "Semantic Models" }, "snapshots": { @@ -3885,7 +3986,7 @@ "type": "array" } ], - "default": null, + "default": "", "title": "Snapshots" }, "sources": { @@ -3897,7 +3998,7 @@ "type": "array" } ], - "default": null, + "default": "", "title": "Sources" }, "unit_tests": { @@ -3909,10 +4010,11 @@ "type": "array" } ], - "default": null, + "default": "", "title": "Unit Tests" } }, "title": "DbtYmlFiles", - "type": "object" + "type": "object", + "schema": "http://json-schema.org/draft-07/schema#" } \ No newline at end of file diff --git a/schemas/latest/dependencies-latest.json b/schemas/latest/dependencies-latest.json index 5ae221c..aa477f3 100644 --- a/schemas/latest/dependencies-latest.json +++ b/schemas/latest/dependencies-latest.json @@ -150,5 +150,6 @@ } }, "title": "Dependencies", - "type": "object" + "type": "object", + "schema": "http://json-schema.org/draft-07/schema#" } \ No newline at end of file diff --git a/schemas/latest/packages-latest.json b/schemas/latest/packages-latest.json index 7c693ee..83cbb8f 100644 --- a/schemas/latest/packages-latest.json +++ b/schemas/latest/packages-latest.json @@ -124,5 +124,6 @@ } }, "title": "Packages", - "type": "object" + "type": "object", + "schema": "http://json-schema.org/draft-07/schema#" } \ No newline at end of file diff --git a/schemas/latest/selectors-latest.json b/schemas/latest/selectors-latest.json index ae07d84..2fe9f05 100644 --- a/schemas/latest/selectors-latest.json +++ b/schemas/latest/selectors-latest.json @@ -232,5 +232,6 @@ "selectors" ], "title": "Selectors", - "type": "object" + "type": "object", + "schema": "http://json-schema.org/draft-07/schema#" } \ No newline at end of file diff --git a/src/latest/dbt_yml_files.py b/src/latest/dbt_yml_files.py index 3cd4004..ca7367e 100644 --- a/src/latest/dbt_yml_files.py +++ b/src/latest/dbt_yml_files.py @@ -61,80 +61,77 @@ class Format(Enum): sql = "sql" -class ExpectDict(BaseModel): +class UnitTestExpectDict(BaseModel): format: Literal["dict"] = Field("dict") rows: List[Dict[str, Any]] = Field( ..., description="When `format` is `dict`, each item should be a dictionary containing a key-value pair for each column and its value, e.g. `{id: 1, code: 'ABC'}`", ) +class UnitTestGivenDict(UnitTestExpectDict): + model_config = ConfigDict( + extra="forbid", + ) + input: str = Field("ref('')", description="The Relation whose input you want to mock") -class ExpectCSV(BaseModel): +class UnitTestExpectCSV(BaseModel): format: Literal["csv"] = Field("csv") rows: Optional[str] = Field( - None, - description="When `format` is csv or sql, a string containing comma-separated headers and values. Alternatively provide a fixture. Use the pipe character | to create a multi-line string in YAML.", + "", + description="When `format` is csv or sql, a string containing comma-separated headers and values. Alternatively specify the `fixture` property. Use the pipe character | to create a multi-line string in YAML.", ) fixture: Optional[str] = Field( - None, - description="Specify the name of a fixture instead of providing `rows`.", + "", + description="Specify the name of a fixture instead of providing `rows`. Does not need to be wrapped in ref.", + ) + +class UnitTestGivenCSV(UnitTestExpectCSV): + model_config = ConfigDict( + extra="forbid", ) + input: str = Field("ref('')", description="The Relation whose input you want to mock") -class ExpectSQL(BaseModel): +class UnitTestExpectSQL(BaseModel): format: Literal["sql"] = Field("sql") rows: Optional[str] = Field( - None, - description="When `format` is csv or sql, a string containing comma-separated headers and values. Alternatively provide a fixture. Use the pipe character | to create a multi-line string in YAML.", + "", + description="When `format` is csv or sql, a string containing comma-separated headers and values. Alternatively specify the `fixture` property. Use the pipe character | to create a multi-line string in YAML.", ) fixture: Optional[str] = Field( - None, - description="Specify the name of a fixture instead of providing `rows`.", + "", + description="Specify the name of a fixture instead of providing `rows`. Does not need to be wrapped in ref.", ) - -Expect = Union[ExpectDict, ExpectCSV, ExpectSQL] - - -class GivenItem(BaseModel): +class UnitTestGivenSQL(UnitTestExpectSQL): model_config = ConfigDict( extra="forbid", ) - fixture: Optional[str] = Field( - None, - description="Only relevant when format is csv. Specify the name of a fixture instead of providing `rows`.", - ) - format: Optional[Format] = Field( - None, description="Defaults to `dict` when not specified" - ) - input: Optional[str] = Field( - None, - description="The relation whose inputs you need to mock. Enclose in ref or source without curly braces", - examples=[ - "ref('model_b')", - "ref('upstream_project', 'model_b')", - "source('schema', 'table')", - ], - ) + input: str = Field("ref('')", description="The Relation whose input you want to mock") + + +Expect = Union[UnitTestExpectDict, UnitTestExpectCSV, UnitTestExpectSQL] +Given = Union[UnitTestGivenDict, UnitTestGivenCSV, UnitTestGivenSQL] + class Overrides(BaseModel): model_config = ConfigDict( extra="forbid", ) - env_vars: Optional[Dict[str, Any]] = None + env_vars: Optional[Dict[str, Any]] = {"ENV_VAR_NAME": "value"} macros: Optional[Dict[str, Any]] = Field( None, examples=[{"is_incremental": "true"}] ) - vars: Optional[Dict[str, Any]] = None + vars: Optional[Dict[str, Any]] = {"var_name": "value"} class AggregationTypeParams(BaseModel): model_config = ConfigDict( extra="forbid", ) - percentile: Optional[float] = None - use_approximate_percentile: Optional[bool] = None - use_discrete_percentile: Optional[bool] = None + percentile: Optional[float] = "" + use_approximate_percentile: Optional[bool] = "" + use_discrete_percentile: Optional[bool] = "" class ArrayOfStrings(RootModel[List[str]]): @@ -205,7 +202,7 @@ class Entity(BaseModel): name: str = Field(..., pattern="(?!.*__).*^[a-z][a-z0-9_]*[a-z0-9]$") type: EntityType = Field(..., title="Entity Type") entity: Optional[str] = "" - expr: Optional[Union[str, bool]] = None + expr: Optional[str] = Field("", description="The field that denotes the entity. Defaults to name if unspecified") class ExportAs(Enum): @@ -219,8 +216,8 @@ class ExportConfig(BaseModel): extra="allow", ) alias: Optional[str] = "" - export_as: Optional[ExportAs] = None - schema_: Optional[str] = Field(None, alias="schema") + export_as: Optional[ExportAs] = "" + schema_: Optional[str] = Field("", alias="schema") class Export(BaseModel): @@ -228,7 +225,7 @@ class Export(BaseModel): extra="forbid", ) name: str - config: Optional[ExportConfig] = Field(None, title="Export Config") + config: Optional[ExportConfig] = Field(title="Export Config") class Period(Enum): @@ -271,9 +268,9 @@ class MetricInputMeasure(BaseModel): extra="forbid", ) name: Optional[str] = "" - fill_nulls_with: Optional[Union[str, int]] = None + fill_nulls_with: Optional[Union[str, int]] = 0 filter: Optional[str] = "" - join_to_timespine: Optional[bool] = None + join_to_timespine: Optional[bool] = Field(True, description="Indicates if the aggregated measure should be joined to the time spine table to fill in missing dates") class MetricInputSchema(BaseModel): @@ -335,9 +332,9 @@ class NonAdditiveDimension(BaseModel): model_config = ConfigDict( extra="forbid", ) - name: str - window_choice: Optional[WindowChoice] = None - window_groupings: Optional[List[str]] = None + name: str = Field("", description="The name of the time dimension (that has already been defined in the data source) that the measure should not be aggregated over.") + window_choice: WindowChoice = Field(WindowChoice.min, description="`min` and `max` reflect the beginning and end of the time period respectively.") + window_groupings: Optional[List[str]] = Field([], description="Provide the entities that you would like to group by.") class NumberOrJinjaString(RootModel[Union[JinjaString, float]]): @@ -348,16 +345,16 @@ class RatioMetricTypeParams(BaseModel): model_config = ConfigDict( extra="forbid", ) - denominator: Optional[MetricInputSchema] = None + denominator: Optional[MetricInputSchema] = "" filter: Optional[str] = "" - numerator: Optional[MetricInputSchema] = None + numerator: Optional[MetricInputSchema] = "" class SimpleMetricTypeParams(BaseModel): model_config = ConfigDict( extra="forbid", ) - measure: Optional[MetricInputMeasure] = None + measure: Optional[MetricInputMeasure] = "" class StringOrArrayOfStrings(RootModel[Union[str, ArrayOfStrings]]): @@ -373,24 +370,24 @@ class ValidityParams(BaseModel): model_config = ConfigDict( extra="forbid", ) - is_end: Optional[bool] = None - is_start: Optional[bool] = None + is_end: Optional[bool] = "" + is_start: Optional[bool] = "" class Config(BaseModel): model_config = ConfigDict( extra="forbid", ) - tags: Optional[StringOrArrayOfStrings] = None + tags: Optional[StringOrArrayOfStrings] = "" -class Analyse(BaseModel): +class Analysis(BaseModel): name: str description: Optional[str] = "" - columns: Optional[List[Column]] = None - config: Optional[Config] = None - docs: Optional[DocsConfig] = None - group: Optional[GroupName] = None + columns: Optional[List[Column]] = "" + config: Optional[Config] = "" + docs: Optional[DocsConfig] = "" + group: Optional[GroupName] = "" class Exposure(BaseModel): @@ -399,10 +396,10 @@ class Exposure(BaseModel): type: Type depends_on: List[str] label: Optional[str] = "" - maturity: Optional[Maturity] = None - meta: Optional[Dict[str, Any]] = None + maturity: Optional[Maturity] = Maturity.medium + meta: Optional[Dict[str, Any]] = "" owner: Owner - tags: Optional[StringOrArrayOfStrings] = None + tags: Optional[StringOrArrayOfStrings] = "" url: Optional[str] = "" @@ -420,8 +417,8 @@ class Macro(BaseModel): ) name: str description: Optional[str] = "" - arguments: Optional[List[Argument]] = None - docs: Optional[DocsConfig] = None + arguments: Optional[List[Argument]] = "" + docs: Optional[DocsConfig] = "" class SimpleMetricType(Enum): @@ -457,7 +454,7 @@ class MetricBase(BaseModel): name: str = Field(..., pattern="(?!.*__).*^[a-z][a-z0-9_]*[a-z0-9]$") description: Optional[str] = "" filter: Optional[str] = "" - group: Optional[GroupName] = None + group: Optional[GroupName] = "" label: str @@ -492,10 +489,9 @@ class RatioMetric(MetricBase): class QueryParams(BaseModel): - dimensions: Optional[ArrayOfStrings] = None - metrics: Optional[ArrayOfStrings] = None - where: Optional[ArrayOfStrings] = None - additionalProperties: Optional[Any] = None + dimensions: Optional[ArrayOfStrings] = "" + metrics: Optional[ArrayOfStrings] = "" + where: Optional[ArrayOfStrings] = "" class SavedQuery(BaseModel): @@ -504,7 +500,7 @@ class SavedQuery(BaseModel): ) name: str description: str - exports: Optional[List[Export]] = None + exports: Optional[List[Export]] = "" label: str query_params: QueryParams @@ -513,8 +509,8 @@ class UnitTestConfig(BaseModel): model_config = ConfigDict( extra="forbid", ) - meta: Optional[Dict[str, Any]] = None - tags: Optional[StringOrArrayOfStrings] = None + meta: Optional[Dict[str, Any]] = "" + tags: Optional[StringOrArrayOfStrings] = "" class UnitTest(BaseModel): @@ -525,14 +521,13 @@ class UnitTest(BaseModel): description: Optional[str] = "" config: Optional[UnitTestConfig] = Field(None, title="Unit Test Config") expect: Expect - given: Optional[List[GivenItem]] = None + given: Optional[List[Given]] = [UnitTestGivenDict(input="", rows=[{"col1": "value1", "col2": "value2"}])] model: str = Field( ..., description="The name of the model whose behaviour you are testing. Does not need to be wrapped in a ref.", examples=["my_model"], ) - overrides: Optional[Overrides] = None - additionalProperties: Optional[Any] = None + overrides: Optional[Overrides] = "" class BooleanOrJinjaString(RootModel[Union[JinjaString, bool]]): @@ -542,10 +537,10 @@ class BooleanOrJinjaString(RootModel[Union[JinjaString, bool]]): class Constraint(BaseModel): name: Optional[str] = "" type: str - columns: Optional[StringOrArrayOfStrings] = None + columns: Optional[StringOrArrayOfStrings] = "" expression: Optional[str] = "" - warn_unenforced: Optional[BooleanOrJinjaString] = None - warn_unsupported: Optional[BooleanOrJinjaString] = None + warn_unenforced: Optional[BooleanOrJinjaString] = "" + warn_unsupported: Optional[BooleanOrJinjaString] = "" class Constraints(RootModel[List[Constraint]]): @@ -558,7 +553,7 @@ class ConversionTypeParams(BaseModel): ) base_measure: MetricInputMeasure calculation: Optional[Calculation] = Calculation.conversion_rate - constant_properties: Optional[List[ConstantProperty]] = None + constant_properties: Optional[List[ConstantProperty]] = "" conversion_measure: MetricInputMeasure entity: str = Field(..., description="The entity to calculate over") window: Optional[str] = "" @@ -568,15 +563,15 @@ class ConversionMetricTypeParams(BaseModel): model_config = ConfigDict( extra="forbid", ) - conversion_type_params: Optional[ConversionTypeParams] = None + conversion_type_params: Optional[ConversionTypeParams] = "" class CumulativeMetricTypeParams(BaseModel): model_config = ConfigDict( extra="forbid", ) - grain_to_date: Optional[GrainToDate] = None - measure: Optional[MetricInputMeasure] = None + grain_to_date: Optional[GrainToDate] = GrainToDate.month + measure: Optional[MetricInputMeasure] = "" window: Optional[str] = "" @@ -585,7 +580,7 @@ class DerivedMetricTypeParams(BaseModel): extra="forbid", ) expr: Optional[str] = "" - metrics: Optional[List[MetricInputSchema]] = None + metrics: Optional[List[MetricInputSchema]] = "" class DimensionTypeParams(BaseModel): @@ -593,7 +588,7 @@ class DimensionTypeParams(BaseModel): extra="forbid", ) time_granularity: TimeGranularity - validity_params: Optional[ValidityParams] = None + validity_params: Optional[ValidityParams] = "" class FreshnessRules(BaseModel): @@ -612,8 +607,8 @@ class Grants(RootModel[Dict[str, StringOrArrayOfStrings]]): class IncludeExclude(BaseModel): - exclude: Optional[StringOrArrayOfStrings] = None - include: Optional[StringOrArrayOfStrings] = None + exclude: Optional[StringOrArrayOfStrings] = "" + include: Optional[StringOrArrayOfStrings] = "" class Measure(BaseModel): @@ -624,50 +619,50 @@ class Measure(BaseModel): name: str = Field(..., pattern="(?!.*__).*^[a-z][a-z0-9_]*[a-z0-9]$") description: Optional[str] = "" agg: Agg - agg_params: Optional[AggregationTypeParams] = None + agg_params: Optional[AggregationTypeParams] = "" agg_time_dimension: Optional[str] = Field( None, pattern="(?!.*__).*^[a-z][a-z0-9_]*[a-z0-9]$" ) - create_metric: Optional[bool] = None + create_metric: Optional[bool] = True create_metric_display_name: Optional[str] = "" - expr: Optional[Union[str, int, bool]] = None + expr: Optional[Union[str, int, bool]] = "" label: Optional[str] = "" - non_additive_dimension: Optional[NonAdditiveDimension] = None + non_additive_dimension: Optional[NonAdditiveDimension] = Field(NonAdditiveDimension(), description="Specify dimensions that the measure should not be aggregated over.") class Contract(BaseModel): - enforced: Optional[BooleanOrJinjaString] = None + enforced: Optional[BooleanOrJinjaString] = True class ModelConfigs(BaseModel): - auto_refresh: Optional[BooleanOrJinjaString] = None - backup: Optional[BooleanOrJinjaString] = None - contract: Optional[Contract] = None + auto_refresh: Optional[BooleanOrJinjaString] = True + backup: Optional[BooleanOrJinjaString] = True + contract: Optional[Contract] = Field(Contract(enforced=True)) file_format: Optional[str] = "" grant_access_to: Optional[List[AuthorizedView]] = Field( None, description="Configuration, specific to BigQuery adapter, used to setup authorized views.", title="Authorized views", ) - grants: Optional[Grants] = None + grants: Optional[Grants] = {"select": ["reporter_role", "bi_user"]} hours_to_expiration: Optional[float] = Field( - None, + 1, description="Configuration specific to BigQuery adapter used to set an expiration delay (in hours) to a table.", ) kms_key_name: Optional[str] = Field( - None, + "", description="Configuration of the KMS key name, specific to BigQuery adapter.", pattern="projects/[a-zA-Z0-9_-]*/locations/[a-zA-Z0-9_-]*/keyRings/.*/cryptoKeys/.*", ) labels: Optional[Dict[str, str]] = Field( - None, + {"key": "value"}, description="Configuration specific to BigQuery adapter used to add labels and tags to tables/views created by dbt.", title="Label configs", ) location: Optional[str] = "" materialized: Optional[str] = "" - on_configuration_change: Optional[OnConfigurationChange] = None - on_schema_change: Optional[OnSchemaChange] = None + on_configuration_change: Optional[OnConfigurationChange] = "" + on_schema_change: Optional[OnSchemaChange] = "" snowflake_warehouse: Optional[str] = "" sql_header: Optional[str] = "" target_lag: Optional[str] = Field( @@ -694,33 +689,33 @@ class TestConfigs(BaseModel): database: Optional[str] = Field( None, description="Only relevant when `store_failures` is true" ) - enabled: Optional[BooleanOrJinjaString] = None + enabled: Optional[BooleanOrJinjaString] = False error_if: Optional[str] = "" fail_calc: Optional[str] = "" - limit: Optional[float] = None + limit: Optional[float] = 20 schema_: Optional[str] = Field( None, alias="schema", description="Only relevant when `store_failures` is true" ) - severity: Optional[Union[JinjaString, Severity]] = None - store_failures: Optional[BooleanOrJinjaString] = None - tags: Optional[StringOrArrayOfStrings] = None + severity: Optional[Union[JinjaString, Severity]] = Severity.warn + store_failures: Optional[BooleanOrJinjaString] = True + tags: Optional[StringOrArrayOfStrings] = "" warn_if: Optional[str] = "" class SnapshotConfig(BaseModel): alias: Optional[str] = "" - check_cols: Optional[StringOrArrayOfStrings] = None - enabled: Optional[BooleanOrJinjaString] = None - grants: Optional[Grants] = None - persist_docs: Optional[PersistDocsConfig] = None - post_hook: Optional[ArrayOfStrings] = Field(None, alias="post-hook") - pre_hook: Optional[ArrayOfStrings] = Field(None, alias="pre-hook") - quote_columns: Optional[BooleanOrJinjaString] = None + check_cols: Optional[StringOrArrayOfStrings] = "" + enabled: Optional[BooleanOrJinjaString] = False + grants: Optional[Grants] = {"select": ["reporter_role", "bi_user"]} + persist_docs: Optional[PersistDocsConfig] = "" + post_hook: Optional[ArrayOfStrings] = Field("", alias="post-hook") + pre_hook: Optional[ArrayOfStrings] = Field("", alias="pre-hook") + quote_columns: Optional[BooleanOrJinjaString] = "" strategy: Optional[str] = "" - tags: Optional[StringOrArrayOfStrings] = None + tags: Optional[StringOrArrayOfStrings] = "" target_database: Optional[str] = "" target_schema: Optional[str] = "" - unique_key: Optional[StringOrArrayOfStrings] = None + unique_key: Optional[StringOrArrayOfStrings] = "" updated_at: Optional[str] = "" @@ -728,14 +723,17 @@ class Quoting(BaseModel): model_config = ConfigDict( extra="forbid", ) - database: Optional[BooleanOrJinjaString] = None - identifier: Optional[BooleanOrJinjaString] = None - schema_: Optional[BooleanOrJinjaString] = Field(None, alias="schema") + database: Optional[BooleanOrJinjaString] = "" + identifier: Optional[BooleanOrJinjaString] = "" + schema_: Optional[BooleanOrJinjaString] = Field("", alias="schema") class Relationships(BaseModel): + model_config = ConfigDict( + extra="forbid", + ) name: Optional[str] = "" - config: Optional[TestConfigs] = None + config: Optional[TestConfigs] = "" field: str = Field( ..., description="The foreign key column", title="Relationships: Field" ) @@ -746,39 +744,39 @@ class Relationships(BaseModel): class RelationshipsTest(BaseModel): - relationships: Optional[Relationships] = None + relationships: Optional[Relationships] = "" class AcceptedValues(BaseModel): name: Optional[str] = "" - config: Optional[TestConfigs] = None - quote: Optional[bool] = None + config: Optional[TestConfigs] = "" + quote: Optional[bool] = "" values: List[str] where: Optional[str] = "" class AcceptedValuesTest(BaseModel): - accepted_values: Optional[AcceptedValues] = None + accepted_values: Optional[AcceptedValues] = AcceptedValues(values=[]) class NotNull(BaseModel): name: Optional[str] = "" - config: Optional[TestConfigs] = None + config: Optional[TestConfigs] = "" where: Optional[str] = "" class NotNullTest(BaseModel): - not_null: Optional[NotNull] = None + not_null: Optional[NotNull] = "" class Unique(BaseModel): name: Optional[str] = "" - config: Optional[TestConfigs] = None + config: Optional[TestConfigs] = "" where: Optional[str] = "" class UniqueTest(BaseModel): - unique: Optional[Unique] = None + unique: Optional[Unique] = "" class DataTests( @@ -796,8 +794,8 @@ class DimensionBase(BaseModel): ) name: str = Field(..., pattern="(?!.*__).*^[a-z][a-z0-9_]*[a-z0-9]$") description: Optional[str] = "" - expr: Optional[Union[str, bool]] = None - is_partition: Optional[bool] = None + expr: Optional[Union[str, bool]] = "" + is_partition: Optional[bool] = True class TimeDimensionType(Enum): @@ -832,13 +830,13 @@ class FreshnessDefinition(BaseModel): filter: Optional[str] = "" class SeedConfig(BaseModel): - column_types: Optional[Dict[str, Any]] = None - copy_grants: Optional[BooleanOrJinjaString] = None - data_tests: Optional[List[DataTests]] = None + column_types: Optional[Dict[str, Any]] = "" + copy_grants: Optional[BooleanOrJinjaString] = True + data_tests: Optional[List[DataTests]] = "" database: Optional[str] = "" - enabled: Optional[BooleanOrJinjaString] = None - grants: Optional[Grants] = None - quote_columns: Optional[BooleanOrJinjaString] = None + enabled: Optional[BooleanOrJinjaString] = False + grants: Optional[Grants] = {"select": ["reporter_role", "bi_user"]} + quote_columns: Optional[BooleanOrJinjaString] = "" schema_: Optional[str] = Field(None, alias="schema") @@ -849,10 +847,10 @@ class SemanticModel(BaseModel): ) name: str = Field(..., pattern="(?!.*__).*^[a-z][a-z0-9_]*[a-z0-9]$") description: Optional[str] = "" - defaults: Optional[Defaults] = None - dimensions: Optional[List[Dimension]] = None - entities: Optional[List[Entity]] = None - measures: Optional[List[Measure]] = None + defaults: Optional[Defaults] = "" + dimensions: Optional[List[Dimension]] = "" + entities: Optional[List[Entity]] = "" + measures: Optional[List[Measure]] = "" model: str primary_entity: Optional[str] = "" @@ -863,24 +861,24 @@ class ColumnProperties(BaseModel): ) name: str description: Optional[str] = "" - constraints: Optional[Constraints] = None - data_tests: Optional[List[DataTests]] = None + constraints: Optional[Constraints] = "" + data_tests: Optional[List[DataTests]] = "" data_type: Optional[str] = "" - meta: Optional[Dict[str, Any]] = None + meta: Optional[Dict[str, Any]] = "" policy_tags: Optional[List[str]] = Field( None, description="Configurations, specific to BigQuery adapter, used to set policy tags on specific columns, enabling column-level security. Only relevant when `persist_docs.columns` is true.", title="Policy tags", ) - quote: Optional[BooleanOrJinjaString] = None - tags: Optional[StringOrArrayOfStrings] = None - tests: Optional[List[DataTests]] = None + quote: Optional[BooleanOrJinjaString] = "" + tags: Optional[StringOrArrayOfStrings] = "" + tests: Optional[List[DataTests]] = "" class Version(BaseModel): - columns: Optional[List[Union[IncludeExclude, ColumnProperties]]] = None - config: Optional[ModelConfigs] = None - v: float + columns: Optional[List[Union[IncludeExclude, ColumnProperties]]] = {} + config: Optional[ModelConfigs] = {} + v: float = 1 class Model(BaseModel): @@ -889,18 +887,18 @@ class Model(BaseModel): ) name: str description: Optional[str] = "" - access: Optional[Access] = None - columns: Optional[List[ColumnProperties]] = None - config: Optional[ModelConfigs] = None - constraints: Optional[Constraints] = None - data_tests: Optional[List[DataTests]] = None + access: Optional[Access] = Access.private + columns: Optional[List[ColumnProperties]] = "" + config: Optional[ModelConfigs] = "" + constraints: Optional[Constraints] = "" + data_tests: Optional[List[DataTests]] = "" deprecation_date: Optional[str] = "" - docs: Optional[DocsConfig] = None - group: Optional[GroupName] = None - latest_version: Optional[float] = None - meta: Optional[Dict[str, Any]] = None - tests: Optional[List[DataTests]] = None - versions: Optional[List[Version]] = None + docs: Optional[DocsConfig] = "" + group: Optional[GroupName] = "" + latest_version: Optional[float] = "" + meta: Optional[Dict[str, Any]] = "" + tests: Optional[List[DataTests]] = "" + versions: Optional[List[Version]] = "" class Seed(BaseModel): @@ -909,11 +907,11 @@ class Seed(BaseModel): ) name: str description: Optional[str] = "" - columns: Optional[List[ColumnProperties]] = None - config: Optional[SeedConfig] = Field(None, title="Seed Config") - docs: Optional[DocsConfig] = None - group: Optional[GroupName] = None - tests: Optional[List[DataTests]] = None + columns: Optional[List[ColumnProperties]] = "" + config: Optional[SeedConfig] = Field("", title="Seed Config") + docs: Optional[DocsConfig] = "" + group: Optional[GroupName] = "" + tests: Optional[List[DataTests]] = "" class Snapshot(BaseModel): @@ -922,13 +920,13 @@ class Snapshot(BaseModel): ) name: str description: Optional[str] = "" - columns: Optional[List[ColumnProperties]] = None - config: Optional[SnapshotConfig] = Field(None, title="Snapshot Config") - data_tests: Optional[List[DataTests]] = None - docs: Optional[DocsConfig] = None - group: Optional[GroupName] = None - meta: Optional[Dict[str, Any]] = None - tests: Optional[List[DataTests]] = None + columns: Optional[List[ColumnProperties]] = "" + config: Optional[SnapshotConfig] = Field("", title="Snapshot Config") + data_tests: Optional[List[DataTests]] = "" + docs: Optional[DocsConfig] = "" + group: Optional[GroupName] = "" + meta: Optional[Dict[str, Any]] = "" + tests: Optional[List[DataTests]] = "" class Table(BaseModel): @@ -941,8 +939,8 @@ class Table(BaseModel): title="Name", ) description: Optional[str] = "" - columns: Optional[List[ColumnProperties]] = None - external: Optional[Dict[str, Any]] = None + columns: Optional[List[ColumnProperties]] = "" + external: Optional[Dict[str, Any]] = "" freshness: Optional[FreshnessDefinition] = Field(FreshnessDefinition(), json_schema_extra={"$comment": "truly_nullable"}) identifier: Optional[str] = Field( None, @@ -954,10 +952,10 @@ class Table(BaseModel): description="Which column to check during data freshness tests. Only needed if the table has a different loaded_at_field to the one defined on the source overall.", ) loader: Optional[str] = "" - meta: Optional[Dict[str, Any]] = None - quoting: Optional[Quoting] = None - tags: Optional[StringOrArrayOfStrings] = None - tests: Optional[List[DataTests]] = None + meta: Optional[Dict[str, Any]] = "" + quoting: Optional[Quoting] = "" + tags: Optional[StringOrArrayOfStrings] = "" + tests: Optional[List[DataTests]] = "" class Source(BaseModel): @@ -966,27 +964,27 @@ class Source(BaseModel): description="How you will identify the schema in {{ source() }} calls. Unless `schema` is also set, this will be the name of the schema in the database.", ) description: Optional[str] = "" - config: Optional[Dict[str, Any]] = None - data_tests: Optional[List[DataTests]] = None + config: Optional[Dict[str, Any]] = "" + data_tests: Optional[List[DataTests]] = "" database: Optional[str] = "" freshness: Optional[FreshnessDefinition] = Field(FreshnessDefinition(), json_schema_extra={"$comment": "truly_nullable"}) loaded_at_field: Optional[str] = "" loader: Optional[str] = "" - meta: Optional[Dict[str, Any]] = None + meta: Optional[Dict[str, Any]] = "" overrides: Optional[str] = Field( None, description="The name of another package installed in your project. If that package has a source with the same name as this one, its properties will be applied on top of the base properties of the overridden source. https://docs.getdbt.com/reference/resource-properties/overrides", title="Package to Override", ) - quoting: Optional[Quoting] = None + quoting: Optional[Quoting] = "" schema_: Optional[str] = Field( None, alias="schema", description="The schema name as stored in the database. Only needed if you want to use a different `name` than what exists in the database (otherwise `name` is used by default)", ) - tables: Optional[List[Table]] = None - tags: Optional[StringOrArrayOfStrings] = None - tests: Optional[List[DataTests]] = None + tables: Optional[List[Table]] = "" + tags: Optional[StringOrArrayOfStrings] = "" + tests: Optional[List[DataTests]] = "" class DbtYmlFiles(BaseModel): @@ -994,15 +992,15 @@ class DbtYmlFiles(BaseModel): extra="forbid", ) version: Literal[2] = 2 - analyses: Optional[List[Analyse]] = None - exposures: Optional[List[Exposure]] = None - groups: Optional[List[Group]] = None - macros: Optional[List[Macro]] = None - metrics: Optional[List[Metric]] = None - models: Optional[List[Model]] = None - saved_queries: Optional[List[SavedQuery]] = None - seeds: Optional[List[Seed]] = None - semantic_models: Optional[List[SemanticModel]] = None - snapshots: Optional[List[Snapshot]] = None - sources: Optional[List[Source]] = None - unit_tests: Optional[List[UnitTest]] = None + analyses: Optional[List[Analysis]] = "" + exposures: Optional[List[Exposure]] = "" + groups: Optional[List[Group]] = "" + macros: Optional[List[Macro]] = "" + metrics: Optional[List[Metric]] = "" + models: Optional[List[Model]] = "" + saved_queries: Optional[List[SavedQuery]] = "" + seeds: Optional[List[Seed]] = "" + semantic_models: Optional[List[SemanticModel]] = "" + snapshots: Optional[List[Snapshot]] = "" + sources: Optional[List[Source]] = "" + unit_tests: Optional[List[UnitTest]] = "" From eef936cc619234b8f241665c1a5d2ad5ed6b37aa Mon Sep 17 00:00:00 2001 From: Joel Labes Date: Mon, 2 Sep 2024 17:00:15 +1200 Subject: [PATCH 12/17] Adopt courtney's changes from 155 --- src/latest/dbt_yml_files.py | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/src/latest/dbt_yml_files.py b/src/latest/dbt_yml_files.py index ca7367e..d8aa593 100644 --- a/src/latest/dbt_yml_files.py +++ b/src/latest/dbt_yml_files.py @@ -149,28 +149,30 @@ class ConstantProperty(BaseModel): base_property: str = Field(..., description="DIMENSION or ENTITY") conversion_property: str = Field(..., description="DIMENSION or ENTITY") - -class GrainToDate(Enum): - day = "day" - week = "week" - month = "month" - quarter = "quarter" - year = "year" - - class TimeGranularity(Enum): + NANOSECOND = "NANOSECOND" + MICROSECOND = "MICROSECOND" + MILLISECOND = "MILLISECOND" + SECOND = "SECOND" + MINUTE = "MINUTE" + HOUR = "HOUR" DAY = "DAY" WEEK = "WEEK" MONTH = "MONTH" QUARTER = "QUARTER" YEAR = "YEAR" + nanosecond = "nanosecond" + microsecond = "microsecond" + millisecond = "millisecond" + second = "second" + minute = "minute" + hour = "hour" day = "day" week = "week" month = "month" quarter = "quarter" year = "year" - class DocsConfig(BaseModel): model_config = ConfigDict( extra="forbid", @@ -456,6 +458,7 @@ class MetricBase(BaseModel): filter: Optional[str] = "" group: Optional[GroupName] = "" label: str + time_granularity: TimeGranularity class SimpleMetric(MetricBase): @@ -570,7 +573,7 @@ class CumulativeMetricTypeParams(BaseModel): model_config = ConfigDict( extra="forbid", ) - grain_to_date: Optional[GrainToDate] = GrainToDate.month + grain_to_date: Optional[TimeGranularity] = TimeGranularity.month measure: Optional[MetricInputMeasure] = "" window: Optional[str] = "" From d9dd764ab7d3e7fd3e07831ced1d5c45cb8ee389 Mon Sep 17 00:00:00 2001 From: Joel Labes Date: Mon, 2 Sep 2024 17:00:52 +1200 Subject: [PATCH 13/17] actually run codegen --- schemas/latest/dbt_yml_files-latest.json | 45 +++++++++++++++++------- 1 file changed, 33 insertions(+), 12 deletions(-) diff --git a/schemas/latest/dbt_yml_files-latest.json b/schemas/latest/dbt_yml_files-latest.json index 88b124c..3573188 100644 --- a/schemas/latest/dbt_yml_files-latest.json +++ b/schemas/latest/dbt_yml_files-latest.json @@ -615,6 +615,9 @@ "title": "Label", "type": "string" }, + "time_granularity": { + "$ref": "#/$defs/TimeGranularity" + }, "type": { "$ref": "#/$defs/ConversionMetricType" }, @@ -625,6 +628,7 @@ "required": [ "name", "label", + "time_granularity", "type", "type_params" ], @@ -744,6 +748,9 @@ "title": "Label", "type": "string" }, + "time_granularity": { + "$ref": "#/$defs/TimeGranularity" + }, "type": { "$ref": "#/$defs/CumulativeMetricType" }, @@ -754,6 +761,7 @@ "required": [ "name", "label", + "time_granularity", "type", "type_params" ], @@ -774,7 +782,7 @@ "grain_to_date": { "anyOf": [ { - "$ref": "#/$defs/GrainToDate" + "$ref": "#/$defs/TimeGranularity" } ], "default": "month" @@ -874,6 +882,9 @@ "title": "Label", "type": "string" }, + "time_granularity": { + "$ref": "#/$defs/TimeGranularity" + }, "type": { "$ref": "#/$defs/DerivedMetricType" }, @@ -884,6 +895,7 @@ "required": [ "name", "label", + "time_granularity", "type", "type_params" ], @@ -1251,17 +1263,6 @@ "title": "FreshnessRules", "type": "object" }, - "GrainToDate": { - "enum": [ - "day", - "week", - "month", - "quarter", - "year" - ], - "title": "GrainToDate", - "type": "string" - }, "Grants": { "additionalProperties": { "$ref": "#/$defs/StringOrArrayOfStrings" @@ -2184,6 +2185,9 @@ "title": "Label", "type": "string" }, + "time_granularity": { + "$ref": "#/$defs/TimeGranularity" + }, "type": { "$ref": "#/$defs/RatioMetricType" }, @@ -2194,6 +2198,7 @@ "required": [ "name", "label", + "time_granularity", "type", "type_params" ], @@ -2626,6 +2631,9 @@ "title": "Label", "type": "string" }, + "time_granularity": { + "$ref": "#/$defs/TimeGranularity" + }, "type": { "$ref": "#/$defs/SimpleMetricType" }, @@ -2636,6 +2644,7 @@ "required": [ "name", "label", + "time_granularity", "type", "type_params" ], @@ -3363,11 +3372,23 @@ }, "TimeGranularity": { "enum": [ + "NANOSECOND", + "MICROSECOND", + "MILLISECOND", + "SECOND", + "MINUTE", + "HOUR", "DAY", "WEEK", "MONTH", "QUARTER", "YEAR", + "nanosecond", + "microsecond", + "millisecond", + "second", + "minute", + "hour", "day", "week", "month", From 603b8f7f5444f6afd23be046c7989a3e0675ea17 Mon Sep 17 00:00:00 2001 From: Joel Labes Date: Mon, 2 Sep 2024 17:02:49 +1200 Subject: [PATCH 14/17] less confusing freshness period name --- schemas/latest/dbt_yml_files-latest.json | 20 ++++++++++---------- src/latest/dbt_yml_files.py | 8 ++++---- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/schemas/latest/dbt_yml_files-latest.json b/schemas/latest/dbt_yml_files-latest.json index 3573188..08f49b4 100644 --- a/schemas/latest/dbt_yml_files-latest.json +++ b/schemas/latest/dbt_yml_files-latest.json @@ -1246,6 +1246,15 @@ "title": "FreshnessDefinition", "type": "object" }, + "FreshnessPeriod": { + "enum": [ + "minute", + "hour", + "day" + ], + "title": "FreshnessPeriod", + "type": "string" + }, "FreshnessRules": { "additionalProperties": false, "properties": { @@ -1253,7 +1262,7 @@ "$ref": "#/$defs/NumberOrJinjaString" }, "period": { - "$ref": "#/$defs/Period" + "$ref": "#/$defs/FreshnessPeriod" } }, "required": [ @@ -2056,15 +2065,6 @@ "title": "OwnerWithName", "type": "object" }, - "Period": { - "enum": [ - "minute", - "hour", - "day" - ], - "title": "Period", - "type": "string" - }, "PersistDocsConfig": { "additionalProperties": false, "properties": { diff --git a/src/latest/dbt_yml_files.py b/src/latest/dbt_yml_files.py index d8aa593..aed57a5 100644 --- a/src/latest/dbt_yml_files.py +++ b/src/latest/dbt_yml_files.py @@ -230,7 +230,7 @@ class Export(BaseModel): config: Optional[ExportConfig] = Field(title="Export Config") -class Period(Enum): +class FreshnessPeriod(Enum): minute = "minute" hour = "hour" day = "day" @@ -599,7 +599,7 @@ class FreshnessRules(BaseModel): extra="forbid", ) count: NumberOrJinjaString - period: Period + period: FreshnessPeriod class Grants(RootModel[Dict[str, StringOrArrayOfStrings]]): @@ -828,8 +828,8 @@ class FreshnessDefinition(BaseModel): model_config = ConfigDict( extra="forbid", ) - warn_after: Optional[FreshnessRules] = FreshnessRules(count=1, period=Period.hour) - error_after: Optional[FreshnessRules] = FreshnessRules(count=1, period=Period.day) + warn_after: Optional[FreshnessRules] = FreshnessRules(count=1, period=FreshnessPeriod.hour) + error_after: Optional[FreshnessRules] = FreshnessRules(count=1, period=FreshnessPeriod.day) filter: Optional[str] = "" class SeedConfig(BaseModel): From a6b4e46bc08f5eee766bcb5f3add3bcd06791f71 Mon Sep 17 00:00:00 2001 From: Joel Labes Date: Mon, 2 Sep 2024 17:05:21 +1200 Subject: [PATCH 15/17] $schema not schema --- generate.py | 2 +- schemas/latest/dbt_cloud-latest.json | 2 +- schemas/latest/dbt_yml_files-latest.json | 2 +- schemas/latest/dependencies-latest.json | 2 +- schemas/latest/packages-latest.json | 2 +- schemas/latest/selectors-latest.json | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/generate.py b/generate.py index 9b40440..5afd73b 100644 --- a/generate.py +++ b/generate.py @@ -32,7 +32,7 @@ def _remove_null(self, json_schema: Dict[str, Any]): def generate(self, schema, mode="validation"): json_schema = super().generate(schema, mode=mode) - json_schema["schema"] = "http://json-schema.org/draft-07/schema#" + json_schema["$schema"] = "http://json-schema.org/draft-07/schema#" self._remove_null(json_schema) return json_schema diff --git a/schemas/latest/dbt_cloud-latest.json b/schemas/latest/dbt_cloud-latest.json index df15c35..7e4de33 100644 --- a/schemas/latest/dbt_cloud-latest.json +++ b/schemas/latest/dbt_cloud-latest.json @@ -20,5 +20,5 @@ ], "title": "DbtCloud", "type": "object", - "schema": "http://json-schema.org/draft-07/schema#" + "$schema": "http://json-schema.org/draft-07/schema#" } \ No newline at end of file diff --git a/schemas/latest/dbt_yml_files-latest.json b/schemas/latest/dbt_yml_files-latest.json index 08f49b4..d8b4040 100644 --- a/schemas/latest/dbt_yml_files-latest.json +++ b/schemas/latest/dbt_yml_files-latest.json @@ -4037,5 +4037,5 @@ }, "title": "DbtYmlFiles", "type": "object", - "schema": "http://json-schema.org/draft-07/schema#" + "$schema": "http://json-schema.org/draft-07/schema#" } \ No newline at end of file diff --git a/schemas/latest/dependencies-latest.json b/schemas/latest/dependencies-latest.json index aa477f3..8cf299c 100644 --- a/schemas/latest/dependencies-latest.json +++ b/schemas/latest/dependencies-latest.json @@ -151,5 +151,5 @@ }, "title": "Dependencies", "type": "object", - "schema": "http://json-schema.org/draft-07/schema#" + "$schema": "http://json-schema.org/draft-07/schema#" } \ No newline at end of file diff --git a/schemas/latest/packages-latest.json b/schemas/latest/packages-latest.json index 83cbb8f..1a7d610 100644 --- a/schemas/latest/packages-latest.json +++ b/schemas/latest/packages-latest.json @@ -125,5 +125,5 @@ }, "title": "Packages", "type": "object", - "schema": "http://json-schema.org/draft-07/schema#" + "$schema": "http://json-schema.org/draft-07/schema#" } \ No newline at end of file diff --git a/schemas/latest/selectors-latest.json b/schemas/latest/selectors-latest.json index 2fe9f05..e739e41 100644 --- a/schemas/latest/selectors-latest.json +++ b/schemas/latest/selectors-latest.json @@ -233,5 +233,5 @@ ], "title": "Selectors", "type": "object", - "schema": "http://json-schema.org/draft-07/schema#" + "$schema": "http://json-schema.org/draft-07/schema#" } \ No newline at end of file From 97e850a9ad92d0dde97a16f574d9d882e5f96a47 Mon Sep 17 00:00:00 2001 From: Joel Labes Date: Mon, 2 Sep 2024 17:08:25 +1200 Subject: [PATCH 16/17] timegranualirty optional --- schemas/latest/dbt_yml_files-latest.json | 30 ++++++++++++++++++++---- src/latest/dbt_yml_files.py | 2 +- 2 files changed, 26 insertions(+), 6 deletions(-) diff --git a/schemas/latest/dbt_yml_files-latest.json b/schemas/latest/dbt_yml_files-latest.json index d8b4040..de501b4 100644 --- a/schemas/latest/dbt_yml_files-latest.json +++ b/schemas/latest/dbt_yml_files-latest.json @@ -616,7 +616,11 @@ "type": "string" }, "time_granularity": { - "$ref": "#/$defs/TimeGranularity" + "anyOf": [ + { + "$ref": "#/$defs/TimeGranularity" + } + ] }, "type": { "$ref": "#/$defs/ConversionMetricType" @@ -749,7 +753,11 @@ "type": "string" }, "time_granularity": { - "$ref": "#/$defs/TimeGranularity" + "anyOf": [ + { + "$ref": "#/$defs/TimeGranularity" + } + ] }, "type": { "$ref": "#/$defs/CumulativeMetricType" @@ -883,7 +891,11 @@ "type": "string" }, "time_granularity": { - "$ref": "#/$defs/TimeGranularity" + "anyOf": [ + { + "$ref": "#/$defs/TimeGranularity" + } + ] }, "type": { "$ref": "#/$defs/DerivedMetricType" @@ -2186,7 +2198,11 @@ "type": "string" }, "time_granularity": { - "$ref": "#/$defs/TimeGranularity" + "anyOf": [ + { + "$ref": "#/$defs/TimeGranularity" + } + ] }, "type": { "$ref": "#/$defs/RatioMetricType" @@ -2632,7 +2648,11 @@ "type": "string" }, "time_granularity": { - "$ref": "#/$defs/TimeGranularity" + "anyOf": [ + { + "$ref": "#/$defs/TimeGranularity" + } + ] }, "type": { "$ref": "#/$defs/SimpleMetricType" diff --git a/src/latest/dbt_yml_files.py b/src/latest/dbt_yml_files.py index aed57a5..292eee9 100644 --- a/src/latest/dbt_yml_files.py +++ b/src/latest/dbt_yml_files.py @@ -458,7 +458,7 @@ class MetricBase(BaseModel): filter: Optional[str] = "" group: Optional[GroupName] = "" label: str - time_granularity: TimeGranularity + time_granularity: Optional[TimeGranularity] class SimpleMetric(MetricBase): From 2f1b25ed2920652a1909fd96582441f181d67654 Mon Sep 17 00:00:00 2001 From: Joel Labes Date: Mon, 2 Sep 2024 17:15:36 +1200 Subject: [PATCH 17/17] set default too --- schemas/latest/dbt_yml_files-latest.json | 20 ++++++++++---------- src/latest/dbt_yml_files.py | 2 +- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/schemas/latest/dbt_yml_files-latest.json b/schemas/latest/dbt_yml_files-latest.json index de501b4..d4003c0 100644 --- a/schemas/latest/dbt_yml_files-latest.json +++ b/schemas/latest/dbt_yml_files-latest.json @@ -620,7 +620,8 @@ { "$ref": "#/$defs/TimeGranularity" } - ] + ], + "default": "" }, "type": { "$ref": "#/$defs/ConversionMetricType" @@ -632,7 +633,6 @@ "required": [ "name", "label", - "time_granularity", "type", "type_params" ], @@ -757,7 +757,8 @@ { "$ref": "#/$defs/TimeGranularity" } - ] + ], + "default": "" }, "type": { "$ref": "#/$defs/CumulativeMetricType" @@ -769,7 +770,6 @@ "required": [ "name", "label", - "time_granularity", "type", "type_params" ], @@ -895,7 +895,8 @@ { "$ref": "#/$defs/TimeGranularity" } - ] + ], + "default": "" }, "type": { "$ref": "#/$defs/DerivedMetricType" @@ -907,7 +908,6 @@ "required": [ "name", "label", - "time_granularity", "type", "type_params" ], @@ -2202,7 +2202,8 @@ { "$ref": "#/$defs/TimeGranularity" } - ] + ], + "default": "" }, "type": { "$ref": "#/$defs/RatioMetricType" @@ -2214,7 +2215,6 @@ "required": [ "name", "label", - "time_granularity", "type", "type_params" ], @@ -2652,7 +2652,8 @@ { "$ref": "#/$defs/TimeGranularity" } - ] + ], + "default": "" }, "type": { "$ref": "#/$defs/SimpleMetricType" @@ -2664,7 +2665,6 @@ "required": [ "name", "label", - "time_granularity", "type", "type_params" ], diff --git a/src/latest/dbt_yml_files.py b/src/latest/dbt_yml_files.py index 292eee9..432e8d0 100644 --- a/src/latest/dbt_yml_files.py +++ b/src/latest/dbt_yml_files.py @@ -458,7 +458,7 @@ class MetricBase(BaseModel): filter: Optional[str] = "" group: Optional[GroupName] = "" label: str - time_granularity: Optional[TimeGranularity] + time_granularity: Optional[TimeGranularity] = "" class SimpleMetric(MetricBase):