Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow config blocks in sources' tables, add event_time #166

Merged
merged 2 commits into from
Oct 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions schemas/latest/dbt_yml_files-latest.json
Original file line number Diff line number Diff line change
Expand Up @@ -820,6 +820,16 @@
"$ref": "#/$defs/column_properties"
}
},
"config": {
"type": "object",
"properties": {
"event_time": {
"type": "string",
"description": "The column that represents the actual moment the row's event happened. Contrast with, for example, when it was loaded to the warehouse."
},
"additionalProperties": true
}
},
"data_tests": {
"type": "array",
"items": {
Expand Down Expand Up @@ -1825,6 +1835,10 @@
}
}
},
"event_time": {
"type": "string",
"description": "The column that represents the actual moment the row's event happened. Contrast with, for example, when it was loaded to the warehouse."
},
"file_format": {
"type": "string"
},
Expand Down
25 changes: 23 additions & 2 deletions tests/latest/valid/dbt_yml_files.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# this file was generated with dbt init with dbt 1.2.1

models:
- name: my_first_dbt_model
description: "A starter dbt model"
Expand Down Expand Up @@ -34,6 +32,7 @@ models:
config:
contract:
enforced: true
event_time: "created_at"
columns:
- name: id
description: "The primary key for this table"
Expand Down Expand Up @@ -298,3 +297,25 @@ saved_queries:
alias: my_export_alias
export_as: table
schema: my_export_schema_name


sources:
- name: some_source_name
loaded_at_field: _etl_loaded_at
freshness:
error_after:
count: 2
period: day
warn_after:
count: 1
period: day
tables:
- name: some_table_name
config:
event_time: "created_at"
- name: another_table_name
columns:
- name: my_unique_column
description: This sure is a column
data_tests:
- unique
Loading