Skip to content

Commit

Permalink
feat: add _blacklist support and fmt, fix up code
Browse files Browse the repository at this point in the history
  • Loading branch information
z3z1ma committed Sep 6, 2023
1 parent 70a132c commit 97643dd
Show file tree
Hide file tree
Showing 9 changed files with 148 additions and 68 deletions.
7 changes: 7 additions & 0 deletions .changes/0.12.1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
## 0.12.1 - 2023-09-06
### Added
* blacklist feature via reserved _blacklist key in dbt-osmosis key under vars
### Fixed
* database variable referenced before assignment if using string syntax
* column metadata could pass name both in kwarg and explicitly which is incorrect
* attempt to fix streamlit app
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,14 @@ adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html),
and is generated by [Changie](https://github.com/miniscruff/changie).


## 0.12.1 - 2023-09-06
### Added
* blacklist feature via reserved _blacklist key in dbt-osmosis key under vars
### Fixed
* database variable referenced before assignment if using string syntax
* column metadata could pass name both in kwarg and explicitly which is incorrect
* attempt to fix streamlit app

## 0.12.0 - 2023-09-03
### Added
* managed sources key can now include database
Expand Down
13 changes: 7 additions & 6 deletions demo_duckdb/dbt_project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,22 @@ version: "0.1"

profile: "jaffle_shop"

model-paths: ["models"]
seed-paths: ["seeds"]
test-paths: ["tests"]
analysis-paths: ["analysis"]
macro-paths: ["macros"]
model-paths: [ "models" ]
seed-paths: [ "seeds" ]
test-paths: [ "tests" ]
analysis-paths: [ "analysis" ]
macro-paths: [ "macros" ]

target-path: "target"
clean-targets:
- "target"
- "dbt_modules"
- "logs"

require-dbt-version: [">=1.0.0", "<2.0.0"]
require-dbt-version: [ ">=1.0.0", "<2.0.0" ]

models:
+dbt-osmosis: schema.yml
jaffle_shop:
materialized: table
staging:
Expand Down
Binary file modified demo_duckdb/jaffle_shop.duckdb
Binary file not shown.
16 changes: 8 additions & 8 deletions demo_duckdb/models/schema.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ models:
- name: number_of_orders
description: Count of the number of orders a customer has placed

- name: total_order_amount
description: Total value (AUD) of a customer's orders

- name: customer_lifetime_value
data_type: DOUBLE
description: ''
- name: orders
description: This table has basic information about orders, as well as some derived facts based on payments

Expand Down Expand Up @@ -56,11 +56,6 @@ models:
- accepted_values:
values: ['placed', 'shipped', 'completed', 'return_pending', 'returned']

- name: amount
description: Total amount (AUD) of the order
tests:
- not_null

- name: credit_card_amount
description: Amount of the order (AUD) paid for by credit card
tests:
Expand All @@ -80,3 +75,8 @@ models:
description: Amount of the order (AUD) paid for by gift card
tests:
- not_null
- name: amount
description: Total amount (AUD) of the order
tests:
- not_null

23 changes: 23 additions & 0 deletions demo_duckdb/models/staging/schema.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,47 @@ models:
- unique
- not_null

data_type: INTEGER
- name: first_name
data_type: VARCHAR
description: ''
- name: last_name
data_type: VARCHAR
description: ''
- name: stg_orders
columns:
- name: order_id
tests:
- unique
- not_null
data_type: INTEGER
- name: customer_id
data_type: INTEGER
description: ''
- name: order_date
data_type: DATE
description: ''
- name: status
tests:
- accepted_values:
values: ['placed', 'shipped', 'completed', 'return_pending', 'returned']

data_type: VARCHAR
- name: stg_payments
columns:
- name: payment_id
tests:
- unique
- not_null
data_type: INTEGER
- name: order_id
data_type: INTEGER
description: ''
- name: payment_method
tests:
- accepted_values:
values: ['credit_card', 'coupon', 'bank_transfer', 'gift_card']
data_type: VARCHAR
- name: amount
data_type: DOUBLE
description: ''
2 changes: 1 addition & 1 deletion demo_duckdb/profiles.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ jaffle_shop:
path: "demo_duckdb/jaffle_shop.duckdb"
test:
type: duckdb
path: "jaffle_shop.duckdb"
path: "{{env_var('PWD')}}/jaffle_shop.duckdb"
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "dbt-osmosis"
version = "0.12.0"
version = "0.12.1"
description = "A dbt server and suite of optional developer tools to make developing with dbt delightful."
authors = ["z3z1ma <[email protected]>"]
license = "Apache-2.0"
Expand Down
Loading

0 comments on commit 97643dd

Please sign in to comment.