diff --git a/code_thingies/dbtlearn/models/fact/fact_reviews.sql b/code_thingies/dbtlearn/models/fact/fact_reviews.sql index 8a707fa..9fd3dc8 100644 --- a/code_thingies/dbtlearn/models/fact/fact_reviews.sql +++ b/code_thingies/dbtlearn/models/fact/fact_reviews.sql @@ -9,7 +9,9 @@ WITH src_reviews AS ( FROM {{ ref('src_reviews') }} ) -SELECT * +SELECT + {{ dbt_utils.surrogate_key(['listing_id', 'review_date', 'reviewer_name', 'review_text']) }} as review_id, + * FROM src_reviews WHERE diff --git a/code_thingies/dbtlearn/models/src/src_reviews.sql b/code_thingies/dbtlearn/models/src/src_reviews.sql index 987faeb..2a99151 100644 --- a/code_thingies/dbtlearn/models/src/src_reviews.sql +++ b/code_thingies/dbtlearn/models/src/src_reviews.sql @@ -5,6 +5,7 @@ WITH raw_reviews AS ( SELECT listing_id, date AS review_date, + reviewer_name AS reviewer_name, comments AS review_text, sentiment AS review_sentiment FROM diff --git a/code_thingies/dbtlearn/packages.yml b/code_thingies/dbtlearn/packages.yml new file mode 100644 index 0000000..9e74ff0 --- /dev/null +++ b/code_thingies/dbtlearn/packages.yml @@ -0,0 +1,3 @@ +packages: + - package: dbt-labs/dbt_utils + version: 0.8.0 \ No newline at end of file diff --git a/notes/8.md b/notes/8.md index bd7e45a..33003e5 100644 --- a/notes/8.md +++ b/notes/8.md @@ -80,4 +80,31 @@ You can also define your own custom generic tests. - Macros are jinja templates. - There are many built-in macros in dbt, but you can also use your own macros. -- dbt packages exist and you can use them to have more tests and macros that you can use. \ No newline at end of file +- dbt packages exist and you can use them to have more tests and macros that you can use. + + +## Documentation + +- Documentation is kept in the repo (yay) +- Documentation can be defined in yaml files or in standalone markdown files. For example, the landing page can be customized with an `overview.md` file. +- Documentation can be quick-served with dbt, but ideally you should compile it and serve it with a regular web server, like Nginx. +- + + + + + + + + + + + + + + + + + + +