Skip to content

Commit bd36cac

Browse files
authored
Merge pull request #4 from HackYourFuture/remove-dbt-init
Ship dbt_project.yml; drop dbt init from Task 1
2 parents 47dab80 + 4824774 commit bd36cac

3 files changed

Lines changed: 33 additions & 19 deletions

File tree

.github/workflows/dbt-parse.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: dbt parse
22

33
# Validates project structure and Jinja without a database connection.
4-
# Runs only once dbt_project.yml exists (i.e. after Task 1 is done).
4+
# dbt_project.yml ships with the template, so this always runs.
55
# The static autograder (.hyf/test.sh) runs separately via grade-assignment.yml.
66

77
on:
@@ -21,7 +21,7 @@ jobs:
2121
echo "present=true" >> "$GITHUB_OUTPUT"
2222
else
2323
echo "present=false" >> "$GITHUB_OUTPUT"
24-
echo "::warning::dbt_project.yml not found -- complete Task 1 (dbt init) first. Skipping parse."
24+
echo "::warning::dbt_project.yml not found -- it ships with the template; did you delete it? Skipping parse."
2525
fi
2626
- uses: actions/setup-python@v5
2727
if: steps.check.outputs.present == 'true'

README.md

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ HackYourFuture Data Track, Week 10. The full brief (business question, tasks, an
66

77
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.
88

9-
## What this repo gives you (and what it does not)
9+
## What this repo gives you
1010

11-
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`.
11+
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.
1212

1313
```text
14-
. <- this repo becomes the dbt project root
15-
├── dbt_project.yml <- NOT included: you create this in Task 1
14+
. <- this repo is the dbt project root
15+
├── dbt_project.yml <- ready to run: staging = view, marts = table
1616
├── packages.yml <- TODO stub: declare dbt_utils (Task 5)
1717
├── profiles.yml.example <- connection template: copy to profiles.yml
1818
├── macros/
@@ -35,20 +35,9 @@ This repo contains the **support files** around the dbt project: templates, TODO
3535
└── AI_ASSIST.md <- template: document one LLM session (Task 8)
3636
```
3737

38-
## Task 1: create the dbt project into this repo
38+
## Task 1: connect to the shared database
3939

40-
`dbt init` always generates a new subfolder, so create the project next to this repo and move its `dbt_project.yml` in:
41-
42-
```bash
43-
# from inside this repo
44-
dbt init nyc_taxi_borough_daily --skip-profile-setup
45-
mv nyc_taxi_borough_daily/dbt_project.yml .
46-
rm -rf nyc_taxi_borough_daily/
47-
```
48-
49-
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:`.
50-
51-
## Connect to the shared database
40+
The project is already initialised, so Task 1 is just pointing it at the database with your personal schema.
5241

5342
1. Copy the connection template and set your personal schema:
5443

dbt_project.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: 'nyc_taxi_borough_daily'
2+
version: '1.0.0'
3+
config-version: 2
4+
5+
# This project connects to the profile of the same name in profiles.yml.
6+
profile: 'nyc_taxi_borough_daily'
7+
8+
model-paths: ["models"]
9+
macro-paths: ["macros"]
10+
test-paths: ["tests"]
11+
12+
target-path: "target"
13+
clean-targets:
14+
- "target"
15+
- "dbt_packages"
16+
17+
# Folder-level materialization defaults. Staging models stay as views (cheap,
18+
# always fresh); the mart is built as a table (queried repeatedly by the
19+
# dashboard). You can override per model with {{ config(materialized='...') }}.
20+
models:
21+
nyc_taxi_borough_daily:
22+
staging:
23+
+materialized: view
24+
marts:
25+
+materialized: table

0 commit comments

Comments
 (0)