fix: Update notebooks to use public_marts schema
dbt creates mart tables in public_marts schema, not public. Updated all notebook SQL queries to use the correct schema. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -50,8 +50,8 @@
|
||||
" transit_per_1000,\n",
|
||||
" total_amenities,\n",
|
||||
" population\n",
|
||||
"FROM mart_neighbourhood_amenities\n",
|
||||
"WHERE year = (SELECT MAX(year) FROM mart_neighbourhood_amenities)\n",
|
||||
"FROM public_marts.mart_neighbourhood_amenities\n",
|
||||
"WHERE year = (SELECT MAX(year) FROM public_marts.mart_neighbourhood_amenities)\n",
|
||||
"ORDER BY total_amenities_per_1000 DESC\n",
|
||||
"\"\"\"\n",
|
||||
"\n",
|
||||
|
||||
@@ -44,8 +44,8 @@
|
||||
" transit_index,\n",
|
||||
" amenity_index,\n",
|
||||
" amenity_tier\n",
|
||||
"FROM mart_neighbourhood_amenities\n",
|
||||
"WHERE year = (SELECT MAX(year) FROM mart_neighbourhood_amenities)\n",
|
||||
"FROM public_marts.mart_neighbourhood_amenities\n",
|
||||
"WHERE year = (SELECT MAX(year) FROM public_marts.mart_neighbourhood_amenities)\n",
|
||||
"ORDER BY amenity_index DESC\n",
|
||||
"\"\"\"\n",
|
||||
"\n",
|
||||
|
||||
@@ -44,8 +44,8 @@
|
||||
" transit_count,\n",
|
||||
" population,\n",
|
||||
" amenity_tier\n",
|
||||
"FROM mart_neighbourhood_amenities\n",
|
||||
"WHERE year = (SELECT MAX(year) FROM mart_neighbourhood_amenities)\n",
|
||||
"FROM public_marts.mart_neighbourhood_amenities\n",
|
||||
"WHERE year = (SELECT MAX(year) FROM public_marts.mart_neighbourhood_amenities)\n",
|
||||
" AND transit_per_1000 IS NOT NULL\n",
|
||||
"ORDER BY transit_per_1000 DESC\n",
|
||||
"\"\"\"\n",
|
||||
|
||||
@@ -45,8 +45,8 @@
|
||||
" population,\n",
|
||||
" income_quintile,\n",
|
||||
" pct_renter_occupied\n",
|
||||
"FROM mart_neighbourhood_demographics\n",
|
||||
"WHERE year = (SELECT MAX(year) FROM mart_neighbourhood_demographics)\n",
|
||||
"FROM public_marts.mart_neighbourhood_demographics\n",
|
||||
"WHERE year = (SELECT MAX(year) FROM public_marts.mart_neighbourhood_demographics)\n",
|
||||
" AND median_age IS NOT NULL\n",
|
||||
"ORDER BY median_age DESC\n",
|
||||
"\"\"\"\n",
|
||||
|
||||
@@ -47,8 +47,8 @@
|
||||
" income_quintile,\n",
|
||||
" population,\n",
|
||||
" unemployment_rate\n",
|
||||
"FROM mart_neighbourhood_demographics\n",
|
||||
"WHERE year = (SELECT MAX(year) FROM mart_neighbourhood_demographics)\n",
|
||||
"FROM public_marts.mart_neighbourhood_demographics\n",
|
||||
"WHERE year = (SELECT MAX(year) FROM public_marts.mart_neighbourhood_demographics)\n",
|
||||
"ORDER BY median_household_income DESC\n",
|
||||
"\"\"\"\n",
|
||||
"\n",
|
||||
|
||||
@@ -44,8 +44,8 @@
|
||||
" land_area_sqkm,\n",
|
||||
" median_household_income,\n",
|
||||
" pct_renter_occupied\n",
|
||||
"FROM mart_neighbourhood_demographics\n",
|
||||
"WHERE year = (SELECT MAX(year) FROM mart_neighbourhood_demographics)\n",
|
||||
"FROM public_marts.mart_neighbourhood_demographics\n",
|
||||
"WHERE year = (SELECT MAX(year) FROM public_marts.mart_neighbourhood_demographics)\n",
|
||||
" AND population_density IS NOT NULL\n",
|
||||
"ORDER BY population_density DESC\n",
|
||||
"\"\"\"\n",
|
||||
|
||||
@@ -47,8 +47,8 @@
|
||||
" avg_rent_2bed,\n",
|
||||
" median_household_income,\n",
|
||||
" is_affordable\n",
|
||||
"FROM mart_neighbourhood_housing\n",
|
||||
"WHERE year = (SELECT MAX(year) FROM mart_neighbourhood_housing)\n",
|
||||
"FROM public_marts.mart_neighbourhood_housing\n",
|
||||
"WHERE year = (SELECT MAX(year) FROM public_marts.mart_neighbourhood_housing)\n",
|
||||
"ORDER BY affordability_index ASC\n",
|
||||
"\"\"\"\n",
|
||||
"\n",
|
||||
|
||||
@@ -45,8 +45,8 @@
|
||||
" AVG(avg_rent_2bed) as avg_rent_2bed,\n",
|
||||
" AVG(avg_rent_3bed) as avg_rent_3bed,\n",
|
||||
" AVG(rent_yoy_change_pct) as avg_yoy_change\n",
|
||||
"FROM mart_neighbourhood_housing\n",
|
||||
"WHERE year >= (SELECT MAX(year) - 5 FROM mart_neighbourhood_housing)\n",
|
||||
"FROM public_marts.mart_neighbourhood_housing\n",
|
||||
"WHERE year >= (SELECT MAX(year) - 5 FROM public_marts.mart_neighbourhood_housing)\n",
|
||||
"GROUP BY year\n",
|
||||
"ORDER BY year\n",
|
||||
"\"\"\"\n",
|
||||
|
||||
@@ -44,8 +44,8 @@
|
||||
" income_quintile,\n",
|
||||
" total_rental_units,\n",
|
||||
" average_dwelling_value\n",
|
||||
"FROM mart_neighbourhood_housing\n",
|
||||
"WHERE year = (SELECT MAX(year) FROM mart_neighbourhood_housing)\n",
|
||||
"FROM public_marts.mart_neighbourhood_housing\n",
|
||||
"WHERE year = (SELECT MAX(year) FROM public_marts.mart_neighbourhood_housing)\n",
|
||||
" AND pct_owner_occupied IS NOT NULL\n",
|
||||
"ORDER BY pct_renter_occupied DESC\n",
|
||||
"\"\"\"\n",
|
||||
|
||||
@@ -44,8 +44,8 @@
|
||||
" population,\n",
|
||||
" livability_score,\n",
|
||||
" crime_rate_per_100k\n",
|
||||
"FROM mart_neighbourhood_overview\n",
|
||||
"WHERE year = (SELECT MAX(year) FROM mart_neighbourhood_overview)\n",
|
||||
"FROM public_marts.mart_neighbourhood_overview\n",
|
||||
"WHERE year = (SELECT MAX(year) FROM public_marts.mart_neighbourhood_overview)\n",
|
||||
" AND median_household_income IS NOT NULL\n",
|
||||
" AND safety_score IS NOT NULL\n",
|
||||
"ORDER BY median_household_income DESC\n",
|
||||
|
||||
@@ -49,8 +49,8 @@
|
||||
" amenity_score,\n",
|
||||
" population,\n",
|
||||
" median_household_income\n",
|
||||
"FROM mart_neighbourhood_overview\n",
|
||||
"WHERE year = (SELECT MAX(year) FROM mart_neighbourhood_overview)\n",
|
||||
"FROM public_marts.mart_neighbourhood_overview\n",
|
||||
"WHERE year = (SELECT MAX(year) FROM public_marts.mart_neighbourhood_overview)\n",
|
||||
"ORDER BY livability_score DESC\n",
|
||||
"\"\"\"\n",
|
||||
"\n",
|
||||
|
||||
@@ -43,8 +43,8 @@
|
||||
" safety_score,\n",
|
||||
" affordability_score,\n",
|
||||
" amenity_score\n",
|
||||
"FROM mart_neighbourhood_overview\n",
|
||||
"WHERE year = (SELECT MAX(year) FROM mart_neighbourhood_overview)\n",
|
||||
"FROM public_marts.mart_neighbourhood_overview\n",
|
||||
"WHERE year = (SELECT MAX(year) FROM public_marts.mart_neighbourhood_overview)\n",
|
||||
" AND livability_score IS NOT NULL\n",
|
||||
"ORDER BY livability_score DESC\n",
|
||||
"\"\"\"\n",
|
||||
|
||||
@@ -47,8 +47,8 @@
|
||||
" homicide_count,\n",
|
||||
" total_incidents,\n",
|
||||
" crime_rate_per_100k\n",
|
||||
"FROM mart_neighbourhood_safety\n",
|
||||
"WHERE year = (SELECT MAX(year) FROM mart_neighbourhood_safety)\n",
|
||||
"FROM public_marts.mart_neighbourhood_safety\n",
|
||||
"WHERE year = (SELECT MAX(year) FROM public_marts.mart_neighbourhood_safety)\n",
|
||||
"ORDER BY total_incidents DESC\n",
|
||||
"LIMIT 15\n",
|
||||
"\"\"\"\n",
|
||||
|
||||
@@ -47,8 +47,8 @@
|
||||
" safety_tier,\n",
|
||||
" total_incidents,\n",
|
||||
" population\n",
|
||||
"FROM mart_neighbourhood_safety\n",
|
||||
"WHERE year = (SELECT MAX(year) FROM mart_neighbourhood_safety)\n",
|
||||
"FROM public_marts.mart_neighbourhood_safety\n",
|
||||
"WHERE year = (SELECT MAX(year) FROM public_marts.mart_neighbourhood_safety)\n",
|
||||
"ORDER BY crime_rate_per_100k DESC\n",
|
||||
"\"\"\"\n",
|
||||
"\n",
|
||||
|
||||
@@ -45,8 +45,8 @@
|
||||
" AVG(break_enter_rate_per_100k) as avg_break_enter_rate,\n",
|
||||
" SUM(total_incidents) as total_city_incidents,\n",
|
||||
" AVG(crime_yoy_change_pct) as avg_yoy_change\n",
|
||||
"FROM mart_neighbourhood_safety\n",
|
||||
"WHERE year >= (SELECT MAX(year) - 5 FROM mart_neighbourhood_safety)\n",
|
||||
"FROM public_marts.mart_neighbourhood_safety\n",
|
||||
"WHERE year >= (SELECT MAX(year) - 5 FROM public_marts.mart_neighbourhood_safety)\n",
|
||||
"GROUP BY year\n",
|
||||
"ORDER BY year\n",
|
||||
"\"\"\"\n",
|
||||
|
||||
Reference in New Issue
Block a user