Skip to content

Commit

Permalink
Node color (#99)
Browse files Browse the repository at this point in the history
* update schemas with ref for node color

* add validity tests

* update default schema too
  • Loading branch information
dave-connors-3 authored Nov 1, 2023
1 parent a1e1f19 commit d5beba0
Show file tree
Hide file tree
Showing 5 changed files with 73 additions and 94 deletions.
55 changes: 23 additions & 32 deletions schemas/1.5/dbt_yml_files-1.5.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,7 @@
"type": "string"
},
"docs": {
"type": "object",
"required": ["show"],
"properties": {
"show": {
"type": "boolean"
}
}
"$ref": "#/$defs/docs_config"
},
"group": {
"$ref": "#/$defs/group"
Expand Down Expand Up @@ -176,13 +170,8 @@
"type": "string"
},
"docs": {
"type": "object",
"properties": {
"show": {
"type": "boolean"
}
}
}
"$ref": "#/$defs/docs_config"
}
},
"additionalProperties": false
}
Expand Down Expand Up @@ -324,12 +313,7 @@
"type": "string"
},
"docs": {
"type": "object",
"properties": {
"show": {
"type": "boolean"
}
}
"$ref": "#/$defs/docs_config"
},
"group": {
"$ref": "#/$defs/group"
Expand Down Expand Up @@ -420,12 +404,7 @@
"type": "string"
},
"docs": {
"type": "object",
"properties": {
"show": {
"type": "boolean"
}
}
"$ref": "#/$defs/docs_config"
},
"group": {
"$ref": "#/$defs/group"
Expand Down Expand Up @@ -506,12 +485,7 @@
"type": "string"
},
"docs": {
"type": "object",
"properties": {
"show": {
"type": "boolean"
}
}
"$ref": "#/$defs/docs_config"
},
"group": {
"$ref": "#/$defs/group"
Expand Down Expand Up @@ -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": {
Expand Down
53 changes: 22 additions & 31 deletions schemas/1.6/dbt_yml_files-1.6.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,7 @@
"type": "string"
},
"docs": {
"type": "object",
"required": ["show"],
"properties": {
"show": {
"type": "boolean"
}
}
"$ref": "#/$defs/docs_config"
},
"group": {
"$ref": "#/$defs/group"
Expand Down Expand Up @@ -176,12 +170,7 @@
"type": "string"
},
"docs": {
"type": "object",
"properties": {
"show": {
"type": "boolean"
}
}
"$ref": "#/$defs/docs_config"
}
},
"additionalProperties": false
Expand Down Expand Up @@ -257,12 +246,7 @@
"type": "string"
},
"docs": {
"type": "object",
"properties": {
"show": {
"type": "boolean"
}
}
"$ref": "#/$defs/docs_config"
},
"group": {
"$ref": "#/$defs/group"
Expand Down Expand Up @@ -353,12 +337,7 @@
"type": "string"
},
"docs": {
"type": "object",
"properties": {
"show": {
"type": "boolean"
}
}
"$ref": "#/$defs/docs_config"
},
"group": {
"$ref": "#/$defs/group"
Expand Down Expand Up @@ -490,12 +469,7 @@
"type": "string"
},
"docs": {
"type": "object",
"properties": {
"show": {
"type": "boolean"
}
}
"$ref": "#/$defs/docs_config"
},
"group": {
"$ref": "#/$defs/group"
Expand Down Expand Up @@ -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",
Expand Down
53 changes: 22 additions & 31 deletions schemas/dbt_yml_files.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,7 @@
"type": "string"
},
"docs": {
"type": "object",
"required": ["show"],
"properties": {
"show": {
"type": "boolean"
}
}
"$ref": "#/$defs/docs_config"
}
}
}
Expand Down Expand Up @@ -173,12 +167,7 @@
"type": "string"
},
"docs": {
"type": "object",
"properties": {
"show": {
"type": "boolean"
}
}
"$ref": "#/$defs/docs_config"
}
},
"additionalProperties": false
Expand Down Expand Up @@ -318,12 +307,7 @@
"type": "string"
},
"docs": {
"type": "object",
"properties": {
"show": {
"type": "boolean"
}
}
"$ref": "#/$defs/docs_config"
},
"group": {
"type": "string"
Expand Down Expand Up @@ -414,12 +398,7 @@
"type": "string"
},
"docs": {
"type": "object",
"properties": {
"show": {
"type": "boolean"
}
}
"$ref": "#/$defs/docs_config"
},
"tests": {
"type": "array",
Expand Down Expand Up @@ -497,12 +476,7 @@
"type": "string"
},
"docs": {
"type": "object",
"properties": {
"show": {
"type": "boolean"
}
}
"$ref": "#/$defs/docs_config"
},
"meta": {
"type": "object"
Expand Down Expand Up @@ -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": {
Expand Down
3 changes: 3 additions & 0 deletions tests/1.5/valid/dbt_yml_files.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
3 changes: 3 additions & 0 deletions tests/1.6/valid/dbt_yml_files.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit d5beba0

Please sign in to comment.