diff --git a/.github/workflows/dbt-parse.yml b/.github/workflows/dbt-parse.yml index 5fae286..6e4f98c 100644 --- a/.github/workflows/dbt-parse.yml +++ b/.github/workflows/dbt-parse.yml @@ -1,7 +1,7 @@ name: dbt parse # Validates project structure and Jinja without a database connection. -# Runs only once dbt_project.yml exists (i.e. after Task 1 is done). +# dbt_project.yml ships with the template, so this always runs. # The static autograder (.hyf/test.sh) runs separately via grade-assignment.yml. on: @@ -21,7 +21,7 @@ jobs: echo "present=true" >> "$GITHUB_OUTPUT" else echo "present=false" >> "$GITHUB_OUTPUT" - echo "::warning::dbt_project.yml not found -- complete Task 1 (dbt init) first. Skipping parse." + echo "::warning::dbt_project.yml not found -- it ships with the template; did you delete it? Skipping parse." fi - uses: actions/setup-python@v5 if: steps.check.outputs.present == 'true' diff --git a/README.md b/README.md index f139669..31ca7ed 100644 --- a/README.md +++ b/README.md @@ -6,13 +6,13 @@ HackYourFuture Data Track, Week 10. The full brief (business question, tasks, an A dbt Core project called `nyc_taxi_borough_daily` that produces a mart at the grain **one row per (pickup_borough, pickup_date)** for the NYC Green Taxi January 2024 dataset already loaded in the shared Azure PostgreSQL instance. -## What this repo gives you (and what it does not) +## What this repo gives you -This repo contains the **support files** around the dbt project: templates, TODO stubs, and the autograder. It deliberately does **not** contain `dbt_project.yml`: creating the project is Task 1, and you do it yourself with `dbt init`. +This repo is a **ready-to-run dbt project**: the project config is wired up and every model, test, and report is a TODO stub for you to fill in. You do not scaffold anything: your job is to write the models, tests, and docs. ```text -. <- this repo becomes the dbt project root -├── dbt_project.yml <- NOT included: you create this in Task 1 +. <- this repo is the dbt project root +├── dbt_project.yml <- ready to run: staging = view, marts = table ├── packages.yml <- TODO stub: declare dbt_utils (Task 5) ├── profiles.yml.example <- connection template: copy to profiles.yml ├── macros/ @@ -35,20 +35,9 @@ This repo contains the **support files** around the dbt project: templates, TODO └── AI_ASSIST.md <- template: document one LLM session (Task 8) ``` -## Task 1: create the dbt project into this repo +## Task 1: connect to the shared database -`dbt init` always generates a new subfolder, so create the project next to this repo and move its `dbt_project.yml` in: - -```bash -# from inside this repo -dbt init nyc_taxi_borough_daily --skip-profile-setup -mv nyc_taxi_borough_daily/dbt_project.yml . -rm -rf nyc_taxi_borough_daily/ -``` - -Deleting the generated folder also removes the `models/example/` scaffolding the assignment warns about. Then open `dbt_project.yml` and remove the `example:` block under `models:`. - -## Connect to the shared database +The project is already initialised, so Task 1 is just pointing it at the database with your personal schema. 1. Copy the connection template and set your personal schema: diff --git a/dbt_project.yml b/dbt_project.yml new file mode 100644 index 0000000..94eed94 --- /dev/null +++ b/dbt_project.yml @@ -0,0 +1,25 @@ +name: 'nyc_taxi_borough_daily' +version: '1.0.0' +config-version: 2 + +# This project connects to the profile of the same name in profiles.yml. +profile: 'nyc_taxi_borough_daily' + +model-paths: ["models"] +macro-paths: ["macros"] +test-paths: ["tests"] + +target-path: "target" +clean-targets: + - "target" + - "dbt_packages" + +# Folder-level materialization defaults. Staging models stay as views (cheap, +# always fresh); the mart is built as a table (queried repeatedly by the +# dashboard). You can override per model with {{ config(materialized='...') }}. +models: + nyc_taxi_borough_daily: + staging: + +materialized: view + marts: + +materialized: table