Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
c404177
rename bash/bin to remove dcp_ prefix
alexrichey Feb 25, 2026
280b699
add .envrc files to all products
alexrichey Feb 25, 2026
1354319
allow override dotfile path
alexrichey Feb 25, 2026
ea3e124
add a command for load_direnv.
alexrichey Feb 25, 2026
a085a30
Add staging models for all PLUTO inputs
alexrichey Feb 12, 2026
79f2895
Fix missed source table references (n58.1.9)
alexrichey Feb 13, 2026
570c390
Integrate dbt into build pipeline (n58.1.10)
alexrichey Feb 13, 2026
4729c0a
Migrate CSV lookups to dbt seeds (n58.1.11)
alexrichey Feb 13, 2026
65a094c
Replace 01_load_local_csvs.sh with dbt seed workflow
alexrichey Feb 19, 2026
be3e903
Fix dbt profiles and schema config issues
alexrichey Feb 19, 2026
8726179
Remove duplicate sources in _sources.yml
alexrichey Feb 19, 2026
c5681ba
Fix seed column type errors for BBL fields
alexrichey Feb 19, 2026
1e4c000
Fix column name case in pluto_input_condolot_descriptiveattributes
alexrichey Feb 19, 2026
296010c
change pluto_input_research to ref
alexrichey Feb 19, 2026
792faed
model fixups
alexrichey Feb 19, 2026
97d8740
Fix seed schema and staging model references
alexrichey Feb 24, 2026
26e2b59
Remove unnecessary schema override from PLUTO seeds
alexrichey Feb 24, 2026
7653bc4
kill 00_setup.sh. We don't actually run this.
alexrichey Feb 26, 2026
e1e364d
refactor pluto_input_geocodes to avoid table altering
alexrichey Feb 26, 2026
866b9ae
Ok, let's try recipe caching again!
alexrichey Feb 27, 2026
27253fb
downcase the seed files
alexrichey Mar 2, 2026
2102e9f
Fix pluto seed script to run from products/pluto directory
alexrichey Mar 3, 2026
039c065
fix gha script location
alexrichey Mar 3, 2026
a64bafd
fix seed types
alexrichey Mar 3, 2026
d897247
remaining src -> stg tables
alexrichey Mar 3, 2026
026e50b
fix pluto_input_research seed
alexrichey Mar 4, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions .envrc
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
#!/usr/bin/env bash

# Load all variables from .env file
dotenv .env
watch_file .env
if [ -n "$DATA_ENGINEERING_DOT_FILE_PATH" ] && [ -f "$DATA_ENGINEERING_DOT_FILE_PATH" ]; then
dotenv "$DATA_ENGINEERING_DOT_FILE_PATH"
watch_file "$DATA_ENGINEERING_DOT_FILE_PATH"
elif [ -f .env ]; then
dotenv .env
watch_file .env
fi

export PROJECT_ROOT_PATH="$PWD"

Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/pluto_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,11 @@ jobs:
- name: Dataloading
working-directory: products/pluto
run: python3 -m dcpy lifecycle builds load load --recipe-path ${{ inputs.recipe_file
}}.lock.yml
}}.lock.yml --cache-schema recipe_cache --cached-entity-type view

- name: Load Local Data
run: ./01_load_local_csvs.sh
- name: Load Local Data and DBT Staging
working-directory: products/pluto
run: ./pluto_build/01a_dbt_staging.sh

- name: building ...
run: ./02_build.sh
Expand Down
File renamed without changes.
4 changes: 4 additions & 0 deletions bash/bin/load_direnv.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash
# Load direnv environment variables for the current directory. Mostly for processes
# that, ahem, make use of non-interactive terminals
eval "$(direnv export bash)"
File renamed without changes.
File renamed without changes.
File renamed without changes.
11 changes: 11 additions & 0 deletions products/cbbr/.envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
source_up

export BUILD_ENGINE_DB=db-cbbr

# Load local .env if it exists
if [ -f .env ]; then
dotenv .env
watch_file .env
fi

export BUILD_ENGINE=$(echo_build_engine)
11 changes: 11 additions & 0 deletions products/cdbg/.envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
source_up

export BUILD_ENGINE_DB=db-cdbg

# Load local .env if it exists
if [ -f .env ]; then
dotenv .env
watch_file .env
fi

export BUILD_ENGINE=$(echo_build_engine)
11 changes: 11 additions & 0 deletions products/ceqr/.envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
source_up

export BUILD_ENGINE_DB=db-ceqr

# Load local .env if it exists
if [ -f .env ]; then
dotenv .env
watch_file .env
fi

export BUILD_ENGINE=$(echo_build_engine)
11 changes: 11 additions & 0 deletions products/checkbook/.envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
source_up

export BUILD_ENGINE_DB=db-checkbook

# Load local .env if it exists
if [ -f .env ]; then
dotenv .env
watch_file .env
fi

export BUILD_ENGINE=$(echo_build_engine)
11 changes: 11 additions & 0 deletions products/colp/.envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
source_up

export BUILD_ENGINE_DB=db-colp

# Load local .env if it exists
if [ -f .env ]; then
dotenv .env
watch_file .env
fi

export BUILD_ENGINE=$(echo_build_engine)
11 changes: 11 additions & 0 deletions products/cpdb/.envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
source_up

export BUILD_ENGINE_DB=db-cpdb

# Load local .env if it exists
if [ -f .env ]; then
dotenv .env
watch_file .env
fi

export BUILD_ENGINE=$(echo_build_engine)
11 changes: 11 additions & 0 deletions products/cscl/.envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
source_up

export BUILD_ENGINE_DB=db-cscl

# Load local .env if it exists
if [ -f .env ]; then
dotenv .env
watch_file .env
fi

export BUILD_ENGINE=$(echo_build_engine)
11 changes: 11 additions & 0 deletions products/developments/.envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
source_up

export BUILD_ENGINE_DB=db-devdb

# Load local .env if it exists
if [ -f .env ]; then
dotenv .env
watch_file .env
fi

export BUILD_ENGINE=$(echo_build_engine)
7 changes: 7 additions & 0 deletions products/edde/.envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
source_up

# Load local .env if it exists
if [ -f .env ]; then
dotenv .env
watch_file .env
fi
4 changes: 3 additions & 1 deletion products/facilities/.envrc
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
source_up

export BUILD_ENGINE_DB=db-facilities

# Load local .env if it exists
if [ -f .env ]; then
dotenv .env
watch_file .env
fi

export BUILD_ENGINE=$(dcp_echo_build_engine)
export BUILD_ENGINE=$(echo_build_engine)
11 changes: 11 additions & 0 deletions products/factfinder/.envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
source_up

export BUILD_ENGINE_DB=db-factfinder

# Load local .env if it exists
if [ -f .env ]; then
dotenv .env
watch_file .env
fi

export BUILD_ENGINE=$(echo_build_engine)
11 changes: 11 additions & 0 deletions products/green_fast_track/.envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
source_up

export BUILD_ENGINE_DB=db-green_fast_track

# Load local .env if it exists
if [ -f .env ]; then
dotenv .env
watch_file .env
fi

export BUILD_ENGINE=$(echo_build_engine)
7 changes: 7 additions & 0 deletions products/knownprojects/.envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
source_up

# Load local .env if it exists
if [ -f .env ]; then
dotenv .env
watch_file .env
fi
4 changes: 3 additions & 1 deletion products/pluto/.envrc
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
source_up

export BUILD_ENGINE_DB=db-pluto

# Load local .env if it exists
if [ -f .env ]; then
dotenv .env
watch_file .env
fi

export BUILD_ENGINE=$(dcp_echo_build_engine)
export BUILD_ENGINE=$(echo_build_engine)
6 changes: 5 additions & 1 deletion products/pluto/dbt_project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,14 @@ profile: "dcp-de-postgres"
model-paths: [ "models" ]
test-paths: [ "tests" ]

seeds:
pluto:
+quote_columns: true

tests:
+store_failures: true
+severity: "{{ env_var('TEST_SEVERITY', 'error') }}"
schema: "_tests"
+schema: "_tests"

vars:
version: "{{ env_var('VERSION') }}"
Expand Down
41 changes: 37 additions & 4 deletions products/pluto/models/_sources.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,43 @@ sources:
- name: recipe_sources
schema: "{{ env_var('BUILD_ENGINE_SCHEMA') }}"
tables:
- name: pluto_input_research
- name: pluto_input_cama_dof
- name: pluto_input_geocodes_raw
- name: pluto_input_numbldgs
- name: pluto_pts
- name: previous_pluto
- name: lpc_landmarks
- name: lpc_historic_districts
- name: dcp_edesignation
- name: dcp_councildistricts_wi
- name: dcp_cb2010_wi
- name: dcp_cb2020_wi
- name: dcp_ct2010_wi
- name: dcp_ct2020_wi
- name: dcp_cdboundaries_wi
- name: doitt_zipcodeboundaries
- name: dcp_school_districts
- name: dcp_zoningdistricts
- name: dcp_commercialoverlay
- name: dcp_limitedheight
- name: dcp_specialpurpose
- name: dcp_specialpurposesubdistricts
- name: dcp_zoningmapamendments
- name: dcp_zoningmapindex
- name: dcp_firecompanies
- name: dcp_policeprecincts
- name: dcp_healthareas
- name: dcp_healthcenters
- name: dsny_frequencies
- name: dcp_colp
- name: dpr_greenthumb
- name: dof_condo
- name: dof_dtm
- name: dof_shoreline
- name: fema_firms2007_100yr
- name: fema_pfirms2015_100yr
- name: dcp_transit_zones
- name: dcp_gis_mandatory_inclusionary_housing
- name: dcp_developments
description: >-
Contains changes in units resulting from new buildings, major alterations, and
Expand Down Expand Up @@ -44,8 +80,6 @@ sources:
]
- name: date_complete

- name: pluto_pts

- name: build_sources
schema: "{{ env_var('BUILD_ENGINE_SCHEMA') }}"
tables:
Expand All @@ -59,5 +93,4 @@ sources:
- name: previous_pluto
- name: export_pluto
description: final PLUTO table
- name: dcp_zoningdistricts
- name: dcp_zoning_maxfar
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ WITH historical_condo_unit_corrections AS (
SELECT
bbl,
old_value::numeric
FROM {{ source("recipe_sources", "pluto_input_research") }}
FROM {{ ref("pluto_input_research") }}
WHERE
field = 'unitsres'
AND substring(bbl, 7, 2) = '75'
Expand Down
13 changes: 13 additions & 0 deletions products/pluto/models/staging/stg__dcp_cb2010_wi.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{{
config(
materialized='table',
indexes=[
{'columns': ['geom'], 'type': 'gist'}
]
)
}}

SELECT
*,
wkb_geometry AS geom
FROM {{ source('recipe_sources', 'dcp_cb2010_wi') }}
13 changes: 13 additions & 0 deletions products/pluto/models/staging/stg__dcp_cb2020_wi.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{{
config(
materialized='table',
indexes=[
{'columns': ['geom'], 'type': 'gist'}
]
)
}}

SELECT
*,
wkb_geometry AS geom
FROM {{ source('recipe_sources', 'dcp_cb2020_wi') }}
13 changes: 13 additions & 0 deletions products/pluto/models/staging/stg__dcp_cdboundaries_wi.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{{
config(
materialized='table',
indexes=[
{'columns': ['geom'], 'type': 'gist'}
]
)
}}

SELECT
*,
wkb_geometry AS geom
FROM {{ source('recipe_sources', 'dcp_cdboundaries_wi') }}
12 changes: 12 additions & 0 deletions products/pluto/models/staging/stg__dcp_colp.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{{
config(
materialized='table',
indexes=[
{'columns': ['geom'], 'type': 'gist'}
]
)
}}

SELECT
*
FROM {{ source('recipe_sources', 'dcp_colp') }}
13 changes: 13 additions & 0 deletions products/pluto/models/staging/stg__dcp_commercialoverlay.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{{
config(
materialized='table',
indexes=[
{'columns': ['geom'], 'type': 'gist'}
]
)
}}

SELECT
*,
wkb_geometry AS geom
FROM {{ source('recipe_sources', 'dcp_commercialoverlay') }}
13 changes: 13 additions & 0 deletions products/pluto/models/staging/stg__dcp_councildistricts_wi.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{{
config(
materialized='table',
indexes=[
{'columns': ['geom'], 'type': 'gist'}
]
)
}}

SELECT
*,
wkb_geometry AS geom
FROM {{ source('recipe_sources', 'dcp_councildistricts_wi') }}
13 changes: 13 additions & 0 deletions products/pluto/models/staging/stg__dcp_ct2010_wi.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{{
config(
materialized='table',
indexes=[
{'columns': ['geom'], 'type': 'gist'}
]
)
}}

SELECT
*,
wkb_geometry AS geom
FROM {{ source('recipe_sources', 'dcp_ct2010_wi') }}
13 changes: 13 additions & 0 deletions products/pluto/models/staging/stg__dcp_ct2020_wi.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{{
config(
materialized='table',
indexes=[
{'columns': ['geom'], 'type': 'gist'}
]
)
}}

SELECT
*,
wkb_geometry AS geom
FROM {{ source('recipe_sources', 'dcp_ct2020_wi') }}
Loading
Loading