From a1e1f1993221fcb692f4a48e9ad3ab88aa5f7e89 Mon Sep 17 00:00:00 2001 From: Evgeniy <7255359+evgeniybobok@users.noreply.github.com> Date: Wed, 1 Nov 2023 01:41:41 +0100 Subject: [PATCH 1/3] enabled additionalProperties for groups (#102) --- schemas/1.5/dbt_yml_files-1.5.json | 2 +- schemas/1.6/dbt_yml_files-1.6.json | 2 +- schemas/dbt_yml_files.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/schemas/1.5/dbt_yml_files-1.5.json b/schemas/1.5/dbt_yml_files-1.5.json index d8a49d8..c7cb578 100644 --- a/schemas/1.5/dbt_yml_files-1.5.json +++ b/schemas/1.5/dbt_yml_files-1.5.json @@ -138,7 +138,7 @@ "type": "string" } }, - "additionalProperties": false + "additionalProperties": true } }, "additionalProperties": false diff --git a/schemas/1.6/dbt_yml_files-1.6.json b/schemas/1.6/dbt_yml_files-1.6.json index c67e7d5..91a5e1e 100644 --- a/schemas/1.6/dbt_yml_files-1.6.json +++ b/schemas/1.6/dbt_yml_files-1.6.json @@ -138,7 +138,7 @@ "type": "string" } }, - "additionalProperties": false + "additionalProperties": true } }, "additionalProperties": false diff --git a/schemas/dbt_yml_files.json b/schemas/dbt_yml_files.json index cb92aa2..34be77c 100644 --- a/schemas/dbt_yml_files.json +++ b/schemas/dbt_yml_files.json @@ -135,7 +135,7 @@ "type": "string" } }, - "additionalProperties": false + "additionalProperties": true } }, "additionalProperties": false From d5beba079e09639fd8c7dcb6a8cb86c2a6783a2e Mon Sep 17 00:00:00 2001 From: dave-connors-3 <73915542+dave-connors-3@users.noreply.github.com> Date: Tue, 31 Oct 2023 20:24:12 -0500 Subject: [PATCH 2/3] Node color (#99) * update schemas with ref for node color * add validity tests * update default schema too --- schemas/1.5/dbt_yml_files-1.5.json | 55 +++++++++++++----------------- schemas/1.6/dbt_yml_files-1.6.json | 53 ++++++++++++---------------- schemas/dbt_yml_files.json | 53 ++++++++++++---------------- tests/1.5/valid/dbt_yml_files.yml | 3 ++ tests/1.6/valid/dbt_yml_files.yml | 3 ++ 5 files changed, 73 insertions(+), 94 deletions(-) diff --git a/schemas/1.5/dbt_yml_files-1.5.json b/schemas/1.5/dbt_yml_files-1.5.json index c7cb578..6e18d77 100644 --- a/schemas/1.5/dbt_yml_files-1.5.json +++ b/schemas/1.5/dbt_yml_files-1.5.json @@ -48,13 +48,7 @@ "type": "string" }, "docs": { - "type": "object", - "required": ["show"], - "properties": { - "show": { - "type": "boolean" - } - } + "$ref": "#/$defs/docs_config" }, "group": { "$ref": "#/$defs/group" @@ -176,13 +170,8 @@ "type": "string" }, "docs": { - "type": "object", - "properties": { - "show": { - "type": "boolean" - } - } - } + "$ref": "#/$defs/docs_config" + } }, "additionalProperties": false } @@ -324,12 +313,7 @@ "type": "string" }, "docs": { - "type": "object", - "properties": { - "show": { - "type": "boolean" - } - } + "$ref": "#/$defs/docs_config" }, "group": { "$ref": "#/$defs/group" @@ -420,12 +404,7 @@ "type": "string" }, "docs": { - "type": "object", - "properties": { - "show": { - "type": "boolean" - } - } + "$ref": "#/$defs/docs_config" }, "group": { "$ref": "#/$defs/group" @@ -506,12 +485,7 @@ "type": "string" }, "docs": { - "type": "object", - "properties": { - "show": { - "type": "boolean" - } - } + "$ref": "#/$defs/docs_config" }, "group": { "$ref": "#/$defs/group" @@ -755,6 +729,23 @@ } } }, + "docs_config": { + "title": "Docs config", + "type": "object", + "description": "Configurations for the appearance of nodes in the dbt documentation.", + "properties": { + "node_color": { + "type": "string", + "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": { + "type": "boolean", + "default": true + } + }, + "additionalProperties": false + }, "freshness_definition": { "default": { "warn_after": { diff --git a/schemas/1.6/dbt_yml_files-1.6.json b/schemas/1.6/dbt_yml_files-1.6.json index 91a5e1e..f728f63 100644 --- a/schemas/1.6/dbt_yml_files-1.6.json +++ b/schemas/1.6/dbt_yml_files-1.6.json @@ -48,13 +48,7 @@ "type": "string" }, "docs": { - "type": "object", - "required": ["show"], - "properties": { - "show": { - "type": "boolean" - } - } + "$ref": "#/$defs/docs_config" }, "group": { "$ref": "#/$defs/group" @@ -176,12 +170,7 @@ "type": "string" }, "docs": { - "type": "object", - "properties": { - "show": { - "type": "boolean" - } - } + "$ref": "#/$defs/docs_config" } }, "additionalProperties": false @@ -257,12 +246,7 @@ "type": "string" }, "docs": { - "type": "object", - "properties": { - "show": { - "type": "boolean" - } - } + "$ref": "#/$defs/docs_config" }, "group": { "$ref": "#/$defs/group" @@ -353,12 +337,7 @@ "type": "string" }, "docs": { - "type": "object", - "properties": { - "show": { - "type": "boolean" - } - } + "$ref": "#/$defs/docs_config" }, "group": { "$ref": "#/$defs/group" @@ -490,12 +469,7 @@ "type": "string" }, "docs": { - "type": "object", - "properties": { - "show": { - "type": "boolean" - } - } + "$ref": "#/$defs/docs_config" }, "group": { "$ref": "#/$defs/group" @@ -814,6 +788,23 @@ }, "additionalProperties": false }, + "docs_config": { + "title": "Docs config", + "type": "object", + "description": "Configurations for the appearance of nodes in the dbt documentation.", + "properties": { + "node_color": { + "type": "string", + "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": { + "type": "boolean", + "default": true + } + }, + "additionalProperties": false + }, "entity": { "required": ["name", "type"], "type": "object", diff --git a/schemas/dbt_yml_files.json b/schemas/dbt_yml_files.json index 34be77c..0dddc06 100644 --- a/schemas/dbt_yml_files.json +++ b/schemas/dbt_yml_files.json @@ -48,13 +48,7 @@ "type": "string" }, "docs": { - "type": "object", - "required": ["show"], - "properties": { - "show": { - "type": "boolean" - } - } + "$ref": "#/$defs/docs_config" } } } @@ -173,12 +167,7 @@ "type": "string" }, "docs": { - "type": "object", - "properties": { - "show": { - "type": "boolean" - } - } + "$ref": "#/$defs/docs_config" } }, "additionalProperties": false @@ -318,12 +307,7 @@ "type": "string" }, "docs": { - "type": "object", - "properties": { - "show": { - "type": "boolean" - } - } + "$ref": "#/$defs/docs_config" }, "group": { "type": "string" @@ -414,12 +398,7 @@ "type": "string" }, "docs": { - "type": "object", - "properties": { - "show": { - "type": "boolean" - } - } + "$ref": "#/$defs/docs_config" }, "tests": { "type": "array", @@ -497,12 +476,7 @@ "type": "string" }, "docs": { - "type": "object", - "properties": { - "show": { - "type": "boolean" - } - } + "$ref": "#/$defs/docs_config" }, "meta": { "type": "object" @@ -743,6 +717,23 @@ } } }, + "docs_config": { + "title": "Docs config", + "type": "object", + "description": "Configurations for the appearance of nodes in the dbt documentation.", + "properties": { + "node_color": { + "type": "string", + "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": { + "type": "boolean", + "default": true + } + }, + "additionalProperties": false + }, "freshness_definition": { "default": { "warn_after": { diff --git a/tests/1.5/valid/dbt_yml_files.yml b/tests/1.5/valid/dbt_yml_files.yml index 0731c87..bbca6d5 100644 --- a/tests/1.5/valid/dbt_yml_files.yml +++ b/tests/1.5/valid/dbt_yml_files.yml @@ -12,6 +12,9 @@ models: - name: my_second_dbt_model description: "A starter dbt model" + docs: + show: true + node_color: yellow columns: - name: id description: "The primary key for this table" diff --git a/tests/1.6/valid/dbt_yml_files.yml b/tests/1.6/valid/dbt_yml_files.yml index 504efd2..d3c7f0b 100644 --- a/tests/1.6/valid/dbt_yml_files.yml +++ b/tests/1.6/valid/dbt_yml_files.yml @@ -12,6 +12,9 @@ models: - name: my_second_dbt_model description: "A starter dbt model" + docs: + show: true + node_color: yellow columns: - name: id description: "The primary key for this table" From 50729296a3edd60f9a4e6aa5a2a064944449d7e2 Mon Sep 17 00:00:00 2001 From: dave-connors-3 <73915542+dave-connors-3@users.noreply.github.com> Date: Tue, 31 Oct 2023 22:03:48 -0500 Subject: [PATCH 3/3] `invalidate_hard_deletes` for snapshots (#100) * update schemas and tests * update to boolean or jinja string ref --- schemas/1.5/dbt_project-1.5.json | 9 +++++++++ schemas/1.6/dbt_project-1.6.json | 9 +++++++++ schemas/dbt_project.json | 9 +++++++++ tests/1.5/valid/dbt_project.yml | 1 + tests/1.6/valid/dbt_project.yml | 1 + 5 files changed, 29 insertions(+) diff --git a/schemas/1.5/dbt_project-1.5.json b/schemas/1.5/dbt_project-1.5.json index f3c500c..1070aac 100644 --- a/schemas/1.5/dbt_project-1.5.json +++ b/schemas/1.5/dbt_project-1.5.json @@ -207,6 +207,9 @@ }, "additionalProperties": false }, + "invalidate_hard_deletes": { + "$ref": "#/$defs/boolean_or_jinja_string" + }, "jinja_string": { "type": "string", "pattern": "\\{\\{.*\\}\\}" @@ -557,6 +560,9 @@ "+group": { "$ref": "#/$defs/group" }, + "+invalidate_hard_deletes": { + "$ref": "#/$defs/invalidate_hard_deletes" + }, "+meta": { "$ref": "#/$defs/meta" }, @@ -608,6 +614,9 @@ "group": { "$ref": "#/$defs/group" }, + "invalidate_hard_deletes": { + "$ref": "#/$defs/invalidate_hard_deletes" + }, "meta": { "$ref": "#/$defs/meta" }, diff --git a/schemas/1.6/dbt_project-1.6.json b/schemas/1.6/dbt_project-1.6.json index 428c184..232aa1e 100644 --- a/schemas/1.6/dbt_project-1.6.json +++ b/schemas/1.6/dbt_project-1.6.json @@ -204,6 +204,9 @@ }, "additionalProperties": false }, + "invalidate_hard_deletes": { + "$ref": "#/$defs/boolean_or_jinja_string" + }, "jinja_string": { "type": "string", "pattern": "\\{\\{.*\\}\\}" @@ -519,6 +522,9 @@ "+group": { "$ref": "#/$defs/group" }, + "+invalidate_hard_deletes": { + "$ref": "#/$defs/invalidate_hard_deletes" + }, "+meta": { "$ref": "#/$defs/meta" }, @@ -570,6 +576,9 @@ "group": { "$ref": "#/$defs/group" }, + "invalidate_hard_deletes": { + "$ref": "#/$defs/invalidate_hard_deletes" + }, "meta": { "$ref": "#/$defs/meta" }, diff --git a/schemas/dbt_project.json b/schemas/dbt_project.json index 39f8b62..e94c8d7 100644 --- a/schemas/dbt_project.json +++ b/schemas/dbt_project.json @@ -198,6 +198,9 @@ }, "additionalProperties": false }, + "invalidate_hard_deletes": { + "$ref": "#/$defs/boolean_or_jinja_string" + }, "jinja_string": { "type": "string", "pattern": "\\{\\{.*\\}\\}" @@ -527,6 +530,9 @@ "+grants": { "$ref": "#/$defs/grants" }, + "+invalidate_hard_deletes": { + "$ref": "#/$defs/invalidate_hard_deletes" + }, "+meta": { "$ref": "#/$defs/meta" }, @@ -575,6 +581,9 @@ "grants": { "$ref": "#/$defs/grants" }, + "invalidate_hard_deletes": { + "$ref": "#/$defs/invalidate_hard_deletes" + }, "meta": { "$ref": "#/$defs/meta" }, diff --git a/tests/1.5/valid/dbt_project.yml b/tests/1.5/valid/dbt_project.yml index 384ec3a..b5e8c94 100644 --- a/tests/1.5/valid/dbt_project.yml +++ b/tests/1.5/valid/dbt_project.yml @@ -79,6 +79,7 @@ tests: snapshots: test: +target_schema: schema + +invalidate_hard_deletes: true +target_database: database +grants: select: ["role"] diff --git a/tests/1.6/valid/dbt_project.yml b/tests/1.6/valid/dbt_project.yml index 2e89b0a..843ca49 100644 --- a/tests/1.6/valid/dbt_project.yml +++ b/tests/1.6/valid/dbt_project.yml @@ -79,6 +79,7 @@ snapshots: test: +target_schema: schema +target_database: database + +invalidate_hard_deletes: true +grants: select: ['role']