Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion dbt/models/proximity/columns.md
Original file line number Diff line number Diff line change
Expand Up @@ -527,7 +527,7 @@ Speed limit for the nearest highway road.
Road data sourced from Illinois Department of Transportation.
{% enddocs %}

## nearest_road_highway_surface type
## nearest_road_highway_surface_type

{% docs column_nearest_road_highway_surface_type %}
Surface type for the nearest highway road (for example brick, stone, etc.).
Expand Down
3 changes: 3 additions & 0 deletions dbt/models/proximity/proximity.vw_pin10_proximity.sql
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@ SELECT
cnt_pin_num_school.num_school_data_year,
cnt_pin_num_school.num_school_rating_data_year,

dist_pin_to_airport.airport_ohare_dist_ft,
dist_pin_to_airport.airport_midway_dist_ft,
dist_pin_to_airport.airport_dnl_total,
dist_pin_to_airport.airport_data_year,

dist_pin_to_bike_trail.nearest_bike_trail_id,
dist_pin_to_bike_trail.nearest_bike_trail_name,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ SELECT
dist_pin_to_road_highway.nearest_road_highway_speed_limit,
dist_pin_to_road_highway.nearest_road_highway_surface_type,
dist_pin_to_road_highway.nearest_road_highway_lanes,
dist_pin_to_road_highway.nearest_road_highway_data_year,

dist_pin_to_secondary_road.nearest_secondary_road_osm_id,
dist_pin_to_secondary_road.nearest_secondary_road_name,
Expand Down
80 changes: 63 additions & 17 deletions dbt/models/proximity/schema.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ models:
meta:
description: cnt_pin_num_bus_stop should match spatial_parcel
- unique_combination_of_columns:
name: proximity_cnt_pin_num_bus_stop_unique_by_pin10_and_year
combination_of_columns:
- pin10
- year
meta:
description: cnt_pin_num_bus_stop should be unique by pin10 and year
name: proximity_cnt_pin_num_bus_stop_unique_by_pin10_and_year
combination_of_columns:
- pin10
- year
meta:
description: cnt_pin_num_bus_stop should be unique by pin10 and year

- name: proximity.cnt_pin_num_foreclosure
description: '{{ doc("table_cnt_pin_num_foreclosure") }}'
Expand Down Expand Up @@ -272,13 +272,13 @@ models:
- name: proximity.dist_pin_to_major_road
description: '{{ doc("table_dist_pin_to_major_road") }}'
data_tests:
- unique_combination_of_columns:
name: proximity_dist_pin_to_major_road_unique_by_pin10_and_year
combination_of_columns:
- pin10
- year
meta:
description: dist_pin_to_major_road should be unique by pin10 and year
- unique_combination_of_columns:
name: proximity_dist_pin_to_major_road_unique_by_pin10_and_year
combination_of_columns:
- pin10
- year
meta:
description: dist_pin_to_major_road should be unique by pin10 and year

- name: proximity.dist_pin_to_metra_route
description: '{{ doc("table_dist_pin_to_metra_route") }}'
Expand Down Expand Up @@ -631,8 +631,14 @@ models:
meta:
description: vw_pin10_proximity should be unique by pin10 and year
columns: &vw_proximity_columns
- name: airport_data_year
description: '{{ doc("column_airport_data_year") }}'
- name: airport_dnl_total
description: '{{ doc("column_airport_dnl_total") }}'
- name: airport_midway_dist_ft
description: '{{ doc("column_airport_midway_dist_ft") }}'
- name: airport_ohare_dist_ft
description: '{{ doc("column_airport_ohare_dist_ft") }}'
Comment on lines +634 to +641
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Nitpick, required] It looks like these fields are defined in the vw_pin10_proximity_fill query:

dist_pin_to_airport.airport_ohare_dist_ft,
dist_pin_to_airport.airport_midway_dist_ft,
dist_pin_to_airport.airport_dnl_total,
dist_pin_to_airport.airport_data_year,

But they're not defined in vw_pin10_proximity:

dist_pin_to_airport.airport_dnl_total,

That means they end up with blank types in the vw_pin10_proximity docs, since those fields are not present in the table, meaning dbt can't infer types for them:

Image

Maybe @wrridgeway knows why these airport metadata fields are missing from vw_pin10_proximity? If there's no good reason for the discrepancy, then the easiest fix here should just be to add these metadata fields to the vw_pin10_proximity query, which will automatically populate their data types in the dbt docs.

- name: avg_school_rating_in_half_mile
description: '{{ doc("column_avg_school_rating_in_half_mile") }}'
- name: lake_michigan_data_year
Expand Down Expand Up @@ -677,12 +683,12 @@ models:
description: '{{ doc("column_nearest_golf_course_dist_ft") }}'
- name: nearest_golf_course_id
description: '{{ doc("column_nearest_golf_course_id") }}'
- name: nearest_grocery_store_data_year
description: '{{ doc("shared_column_data_year") }}'
- name: nearest_grocery_store_dist_ft
description: '{{ doc("column_nearest_grocery_store_dist_ft") }}'
- name: nearest_grocery_store_name
description: '{{ doc("column_nearest_grocery_store_name") }}'
- name: nearest_grocery_store_name
description: '{{ doc("column_nearest_grocery_store_name") }}'
- name: nearest_hospital_data_year
description: '{{ doc("shared_column_data_year") }}'
- name: nearest_hospital_dist_ft
Expand Down Expand Up @@ -751,6 +757,48 @@ models:
description: '{{ doc("column_nearest_railroad_id") }}'
- name: nearest_railroad_name
description: '{{ doc("column_nearest_railroad_name") }}'
- name: nearest_road_arterial_daily_traffic
description: '{{ doc("column_nearest_road_arterial_daily_traffic") }}'
- name: nearest_road_arterial_data_year
description: '{{ doc("shared_column_data_year") }}'
- name: nearest_road_arterial_dist_ft
description: '{{ doc("column_nearest_road_arterial_dist_ft") }}'
- name: nearest_road_arterial_lanes
description: '{{ doc("column_nearest_road_arterial_lanes") }}'
- name: nearest_road_arterial_name
description: '{{ doc("column_nearest_road_arterial_name") }}'
- name: nearest_road_arterial_speed_limit
description: '{{ doc("column_nearest_road_arterial_speed_limit") }}'
- name: nearest_road_arterial_surface_type
description: '{{ doc("column_nearest_road_arterial_surface_type") }}'
- name: nearest_road_collector_daily_traffic
description: '{{ doc("column_nearest_road_collector_daily_traffic") }}'
- name: nearest_road_collector_data_year
description: '{{ doc("shared_column_data_year") }}'
- name: nearest_road_collector_dist_ft
description: '{{ doc("column_nearest_road_collector_dist_ft") }}'
- name: nearest_road_collector_lanes
description: '{{ doc("column_nearest_road_collector_lanes") }}'
- name: nearest_road_collector_name
description: '{{ doc("column_nearest_road_collector_name") }}'
- name: nearest_road_collector_speed_limit
description: '{{ doc("column_nearest_road_collector_speed_limit") }}'
- name: nearest_road_collector_surface_type
description: '{{ doc("column_nearest_road_collector_surface_type") }}'
- name: nearest_road_highway_daily_traffic
description: '{{ doc("column_nearest_road_highway_daily_traffic") }}'
- name: nearest_road_highway_data_year
description: '{{ doc("shared_column_data_year") }}'
Comment on lines +790 to +791
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Nitpick, required] Similar to above, this field is defined in vw_pin10_proximity:

dist_pin_to_road_highway.nearest_road_highway_data_year,

But it's missing from vw_pin10_proximity_fill:

dist_pin_to_road_highway.nearest_road_highway_name,
dist_pin_to_road_highway.nearest_road_highway_dist_ft,
dist_pin_to_road_highway.nearest_road_highway_daily_traffic,
dist_pin_to_road_highway.nearest_road_highway_speed_limit,
dist_pin_to_road_highway.nearest_road_highway_surface_type,
dist_pin_to_road_highway.nearest_road_highway_lanes,

Which leads to an empty data type in the docs:

Image

@wrridgeway Same as above: Are we good to add this data_year column to vw_pin10_proximity so that it matches vw_pin10_proximity_fill?

- name: nearest_road_highway_dist_ft
description: '{{ doc("column_nearest_road_highway_dist_ft") }}'
- name: nearest_road_highway_lanes
description: '{{ doc("column_nearest_road_highway_lanes") }}'
- name: nearest_road_highway_name
description: '{{ doc("column_nearest_road_highway_name") }}'
- name: nearest_road_highway_speed_limit
description: '{{ doc("column_nearest_road_highway_speed_limit") }}'
- name: nearest_road_highway_surface_type
description: '{{ doc("column_nearest_road_highway_surface_type") }}'
- name: nearest_secondary_road_data_year
description: '{{ doc("shared_column_data_year") }}'
- name: nearest_secondary_road_dist_ft
Expand All @@ -769,8 +817,6 @@ models:
description: '{{ doc("shared_column_data_year") }}'
- name: nearest_university_dist_ft
description: '{{ doc("column_nearest_university_dist_ft") }}'
- name: nearest_university_gnis_code
description: '{{ doc("column_nearest_university_gnis_code") }}'
- name: nearest_university_name
description: '{{ doc("column_nearest_university_name") }}'
- name: nearest_vacant_land_data_year
Expand Down
Loading