mirror of
https://github.com/dbt-labs/dbt-core
synced 2025-12-21 21:01:28 +00:00
Compare commits
4 Commits
enable-pos
...
jsonschema
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
83e4b10c35 | ||
|
|
7a26868e63 | ||
|
|
cac84a18c4 | ||
|
|
b123c78538 |
@@ -276,12 +276,45 @@
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
"ColumnConfig": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"meta": {
|
||||||
|
"type": [
|
||||||
|
"object",
|
||||||
|
"null"
|
||||||
|
],
|
||||||
|
"additionalProperties": true
|
||||||
|
},
|
||||||
|
"tags": {
|
||||||
|
"anyOf": [
|
||||||
|
{
|
||||||
|
"$ref": "#/definitions/StringOrArrayOfStrings"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "null"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"additionalProperties": false
|
||||||
|
},
|
||||||
"ColumnProperties": {
|
"ColumnProperties": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"required": [
|
"required": [
|
||||||
"name"
|
"name"
|
||||||
],
|
],
|
||||||
"properties": {
|
"properties": {
|
||||||
|
"config": {
|
||||||
|
"anyOf": [
|
||||||
|
{
|
||||||
|
"$ref": "#/definitions/ColumnConfig"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "null"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
"constraints": {
|
"constraints": {
|
||||||
"type": [
|
"type": [
|
||||||
"array",
|
"array",
|
||||||
@@ -320,7 +353,6 @@
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"meta": true,
|
|
||||||
"name": {
|
"name": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
@@ -343,16 +375,6 @@
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"tags": {
|
|
||||||
"anyOf": [
|
|
||||||
{
|
|
||||||
"$ref": "#/definitions/StringOrArrayOfStrings"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "null"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"tests": {
|
"tests": {
|
||||||
"type": [
|
"type": [
|
||||||
"array",
|
"array",
|
||||||
@@ -2289,6 +2311,12 @@
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
"database": {
|
||||||
|
"type": [
|
||||||
|
"string",
|
||||||
|
"null"
|
||||||
|
]
|
||||||
|
},
|
||||||
"dbt_valid_to_current": {
|
"dbt_valid_to_current": {
|
||||||
"type": [
|
"type": [
|
||||||
"string",
|
"string",
|
||||||
@@ -2345,6 +2373,12 @@
|
|||||||
"null"
|
"null"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
"schema": {
|
||||||
|
"type": [
|
||||||
|
"string",
|
||||||
|
"null"
|
||||||
|
]
|
||||||
|
},
|
||||||
"snapshot_meta_column_names": {
|
"snapshot_meta_column_names": {
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
{
|
{
|
||||||
@@ -2371,18 +2405,6 @@
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"target_database": {
|
|
||||||
"type": [
|
|
||||||
"string",
|
|
||||||
"null"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"target_schema": {
|
|
||||||
"type": [
|
|
||||||
"string",
|
|
||||||
"null"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"unique_key": {
|
"unique_key": {
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
{
|
{
|
||||||
@@ -2456,16 +2478,6 @@
|
|||||||
"null"
|
"null"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"freshness": {
|
|
||||||
"anyOf": [
|
|
||||||
{
|
|
||||||
"$ref": "#/definitions/FreshnessDefinition"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "null"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"loaded_at_field": {
|
"loaded_at_field": {
|
||||||
"type": [
|
"type": [
|
||||||
"string",
|
"string",
|
||||||
@@ -2484,13 +2496,6 @@
|
|||||||
"null"
|
"null"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"meta": {
|
|
||||||
"type": [
|
|
||||||
"object",
|
|
||||||
"null"
|
|
||||||
],
|
|
||||||
"additionalProperties": true
|
|
||||||
},
|
|
||||||
"name": {
|
"name": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
@@ -2524,16 +2529,6 @@
|
|||||||
"items": {
|
"items": {
|
||||||
"$ref": "#/definitions/Tables"
|
"$ref": "#/definitions/Tables"
|
||||||
}
|
}
|
||||||
},
|
|
||||||
"tags": {
|
|
||||||
"anyOf": [
|
|
||||||
{
|
|
||||||
"$ref": "#/definitions/StringOrArrayOfStrings"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "null"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"additionalProperties": false
|
"additionalProperties": false
|
||||||
@@ -2552,6 +2547,33 @@
|
|||||||
"string",
|
"string",
|
||||||
"null"
|
"null"
|
||||||
]
|
]
|
||||||
|
},
|
||||||
|
"freshness": {
|
||||||
|
"anyOf": [
|
||||||
|
{
|
||||||
|
"$ref": "#/definitions/FreshnessDefinition"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "null"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"meta": {
|
||||||
|
"type": [
|
||||||
|
"object",
|
||||||
|
"null"
|
||||||
|
],
|
||||||
|
"additionalProperties": true
|
||||||
|
},
|
||||||
|
"tags": {
|
||||||
|
"anyOf": [
|
||||||
|
{
|
||||||
|
"$ref": "#/definitions/StringOrArrayOfStrings"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "null"
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"additionalProperties": false
|
"additionalProperties": false
|
||||||
@@ -2610,16 +2632,6 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"external": true,
|
"external": true,
|
||||||
"freshness": {
|
|
||||||
"anyOf": [
|
|
||||||
{
|
|
||||||
"$ref": "#/definitions/FreshnessDefinition"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "null"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"identifier": {
|
"identifier": {
|
||||||
"type": [
|
"type": [
|
||||||
"string",
|
"string",
|
||||||
@@ -2644,13 +2656,6 @@
|
|||||||
"null"
|
"null"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"meta": {
|
|
||||||
"type": [
|
|
||||||
"object",
|
|
||||||
"null"
|
|
||||||
],
|
|
||||||
"additionalProperties": true
|
|
||||||
},
|
|
||||||
"name": {
|
"name": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
@@ -2664,16 +2669,6 @@
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"tags": {
|
|
||||||
"anyOf": [
|
|
||||||
{
|
|
||||||
"$ref": "#/definitions/StringOrArrayOfStrings"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "null"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"tests": {
|
"tests": {
|
||||||
"type": [
|
"type": [
|
||||||
"array",
|
"array",
|
||||||
@@ -2689,11 +2684,44 @@
|
|||||||
"TablesConfig": {
|
"TablesConfig": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
|
"enabled": {
|
||||||
|
"type": [
|
||||||
|
"boolean",
|
||||||
|
"null"
|
||||||
|
]
|
||||||
|
},
|
||||||
"event_time": {
|
"event_time": {
|
||||||
"type": [
|
"type": [
|
||||||
"string",
|
"string",
|
||||||
"null"
|
"null"
|
||||||
]
|
]
|
||||||
|
},
|
||||||
|
"freshness": {
|
||||||
|
"anyOf": [
|
||||||
|
{
|
||||||
|
"$ref": "#/definitions/FreshnessDefinition"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "null"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"meta": {
|
||||||
|
"type": [
|
||||||
|
"object",
|
||||||
|
"null"
|
||||||
|
],
|
||||||
|
"additionalProperties": true
|
||||||
|
},
|
||||||
|
"tags": {
|
||||||
|
"anyOf": [
|
||||||
|
{
|
||||||
|
"$ref": "#/definitions/StringOrArrayOfStrings"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "null"
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"additionalProperties": false
|
"additionalProperties": false
|
||||||
|
|||||||
@@ -83,8 +83,3 @@ models:
|
|||||||
docs:
|
docs:
|
||||||
node_color: purple
|
node_color: purple
|
||||||
show: true
|
show: true
|
||||||
|
|
||||||
sources:
|
|
||||||
- name: my_source
|
|
||||||
tables:
|
|
||||||
- name: my_table
|
|
||||||
|
|||||||
@@ -0,0 +1,74 @@
|
|||||||
|
sources:
|
||||||
|
- name: my_source
|
||||||
|
description: description
|
||||||
|
database: raw
|
||||||
|
schema: jaffle_shop
|
||||||
|
loader: test
|
||||||
|
loaded_at_field: column_name
|
||||||
|
config:
|
||||||
|
enabled: true
|
||||||
|
event_time: column_name
|
||||||
|
meta:
|
||||||
|
test: 1
|
||||||
|
freshness:
|
||||||
|
warn_after:
|
||||||
|
count: 1
|
||||||
|
period: minute
|
||||||
|
error_after:
|
||||||
|
count: 2
|
||||||
|
period: hour
|
||||||
|
filter: "column_name = 1"
|
||||||
|
|
||||||
|
# # overrides: test
|
||||||
|
|
||||||
|
quoting:
|
||||||
|
database: true
|
||||||
|
schema: true
|
||||||
|
identifier: true
|
||||||
|
|
||||||
|
tables:
|
||||||
|
- name: my_table
|
||||||
|
description: description
|
||||||
|
identifier: table_identifier
|
||||||
|
loaded_at_field: column_name
|
||||||
|
tests:
|
||||||
|
- not_null
|
||||||
|
quoting:
|
||||||
|
database: true
|
||||||
|
schema: true
|
||||||
|
identifier: true
|
||||||
|
external:
|
||||||
|
location: location
|
||||||
|
file_format: file_format
|
||||||
|
row_format: row_format
|
||||||
|
tbl_properties: tbl_properties
|
||||||
|
partitions:
|
||||||
|
- name: column_name
|
||||||
|
data_type: data_type
|
||||||
|
description: description
|
||||||
|
meta:
|
||||||
|
test: 1
|
||||||
|
additional_property: additional_value
|
||||||
|
columns:
|
||||||
|
- name: column_name
|
||||||
|
description: description
|
||||||
|
meta:
|
||||||
|
test: 1
|
||||||
|
quote: true
|
||||||
|
tests:
|
||||||
|
- not_null
|
||||||
|
tags: ["tags"]
|
||||||
|
config:
|
||||||
|
enabled: true
|
||||||
|
event_time: column_name
|
||||||
|
meta:
|
||||||
|
test: 1
|
||||||
|
tags: ["tag"]
|
||||||
|
freshness:
|
||||||
|
warn_after:
|
||||||
|
count: 1
|
||||||
|
period: minute
|
||||||
|
error_after:
|
||||||
|
count: 2
|
||||||
|
period: hour
|
||||||
|
filter: "column_name = 1"
|
||||||
@@ -562,18 +562,30 @@ class TestList:
|
|||||||
"json": {
|
"json": {
|
||||||
"config": {
|
"config": {
|
||||||
"enabled": True,
|
"enabled": True,
|
||||||
"event_time": None,
|
"event_time": "column_name",
|
||||||
"freshness": None,
|
"freshness": {
|
||||||
|
"error_after": {
|
||||||
|
"count": 2,
|
||||||
|
"period": "hour",
|
||||||
|
},
|
||||||
|
"warn_after": {
|
||||||
|
"count": 1,
|
||||||
|
"period": "minute",
|
||||||
|
},
|
||||||
|
"filter": "column_name = 1",
|
||||||
|
},
|
||||||
|
"meta": {"test": 1},
|
||||||
|
"tags": ["tag"],
|
||||||
},
|
},
|
||||||
"unique_id": "source.test.my_source.my_table",
|
"unique_id": "source.test.my_source.my_table",
|
||||||
"original_file_path": normalize("models/schema.yml"),
|
"original_file_path": normalize("models/sources.yml"),
|
||||||
"package_name": "test",
|
"package_name": "test",
|
||||||
"name": "my_table",
|
"name": "my_table",
|
||||||
"source_name": "my_source",
|
"source_name": "my_source",
|
||||||
"resource_type": "source",
|
"resource_type": "source",
|
||||||
"tags": [],
|
"tags": [],
|
||||||
},
|
},
|
||||||
"path": self.dir("models/schema.yml"),
|
"path": self.dir("models/sources.yml"),
|
||||||
}
|
}
|
||||||
# should we do this --select automatically for a user if if 'source' is
|
# should we do this --select automatically for a user if if 'source' is
|
||||||
# in the resource types and there is no '--select' or '--exclude'?
|
# in the resource types and there is no '--select' or '--exclude'?
|
||||||
|
|||||||
Reference in New Issue
Block a user