Skip to content

Commit

Permalink
Allow config blocks in sources' tables, add event_time (#166)
Browse files Browse the repository at this point in the history
* Allow config blocks in sources' tables, add event_time

* Add event_time for models too
  • Loading branch information
joellabes authored Oct 3, 2024
1 parent 7059086 commit 0192557
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 2 deletions.
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 @@ -825,6 +825,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 @@ -1830,6 +1840,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 @@ -306,3 +305,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

0 comments on commit 0192557

Please sign in to comment.