Skip to content

Commit

Permalink
add _dt where needed, and disable translations
Browse files Browse the repository at this point in the history
  • Loading branch information
atvaccaro committed Jan 19, 2023
1 parent 47c0858 commit 2fe7099
Show file tree
Hide file tree
Showing 18 changed files with 23 additions and 1 deletion.
3 changes: 3 additions & 0 deletions warehouse/models/mart/gtfs/dim_translations.sql
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
{{ config(enabled=False) }}
-- we do not actually process translations right now

WITH make_dim AS (
{{ make_schedule_file_dimension_from_dim_schedule_feeds(
ref('dim_schedule_feeds'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ stg_gtfs_schedule__agency AS (
SELECT
base64_url,
ts,
dt AS _dt,
{{ trim_make_empty_string_null('agency_id') }} AS agency_id,
{{ trim_make_empty_string_null('agency_name') }} AS agency_name,
{{ trim_make_empty_string_null('agency_url') }} AS agency_url,
Expand Down
1 change: 1 addition & 0 deletions warehouse/models/staging/gtfs/stg_gtfs_schedule__areas.sql
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ stg_gtfs_schedule__areas AS (
SELECT
base64_url,
ts,
dt AS _dt,
{{ trim_make_empty_string_null('area_id') }} AS area_id,
{{ trim_make_empty_string_null('area_name') }} AS area_name
FROM external_areas
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ stg_gtfs_schedule__attributions AS (
SELECT
base64_url,
ts,
dt AS _dt,
{{ trim_make_empty_string_null('organization_name') }} AS organization_name,
{{ trim_make_empty_string_null('attribution_id') }} AS attribution_id,
{{ trim_make_empty_string_null('agency_id') }} AS agency_id,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ stg_gtfs_schedule__calendar AS (
SELECT
base64_url,
ts,
dt AS _dt,
{{ trim_make_empty_string_null('service_id') }} AS service_id,
SAFE_CAST({{ trim_make_empty_string_null('monday') }} AS INTEGER) AS monday,
SAFE_CAST({{ trim_make_empty_string_null('tuesday') }} AS INTEGER) AS tuesday,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ stg_gtfs_schedule__calendar_dates AS (
SELECT
base64_url,
ts,
dt AS _dt,
{{ trim_make_empty_string_null('service_id') }} AS service_id,
PARSE_DATE("%Y%m%d", {{ trim_make_empty_string_null('date') }}) AS date,
SAFE_CAST({{ trim_make_empty_string_null('exception_type') }} AS INTEGER) AS exception_type
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ stg_gtfs_schedule__fare_attributes AS (
SELECT
base64_url,
ts,

dt AS _dt,
{{ trim_make_empty_string_null('fare_id') }} AS fare_id,
{{ trim_make_empty_string_null('price') }} AS price,
{{ trim_make_empty_string_null('currency_type') }} AS currency_type,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ stg_gtfs_schedule__fare_leg_rules AS (
SELECT
base64_url,
ts,
dt AS _dt,
{{ trim_make_empty_string_null('leg_group_id') }} AS leg_group_id,
{{ trim_make_empty_string_null('networK_id') }} AS network_id,
{{ trim_make_empty_string_null('from_area_id') }} AS from_area_id,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ stg_gtfs_schedule__fare_products AS (
SELECT
base64_url,
ts,
dt AS _dt,
{{ trim_make_empty_string_null('fare_product_id') }} AS fare_product_id,
{{ trim_make_empty_string_null('fare_product_name') }} AS fare_product_name,
SAFE_CAST({{ trim_make_empty_string_null('amount') }} AS FLOAT64) AS amount,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ stg_gtfs_schedule__fare_rules AS (
SELECT
base64_url,
ts,
dt AS _dt,
{{ trim_make_empty_string_null('fare_id') }} AS fare_id,
{{ trim_make_empty_string_null('route_id') }} AS route_id,
{{ trim_make_empty_string_null('origin_id') }} AS origin_id,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ stg_gtfs_schedule__fare_transfer_rules AS (
SELECT
base64_url,
ts,
dt AS _dt,
{{ trim_make_empty_string_null('from_leg_group_id') }} AS from_leg_group_id,
{{ trim_make_empty_string_null('to_leg_group_id') }} AS to_leg_group_id,
SAFE_CAST({{ trim_make_empty_string_null('transfer_count') }} AS INTEGER) AS transfer_count,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ stg_gtfs_schedule__feed_info AS (
SELECT
base64_url,
ts,
dt AS _dt,
{{ trim_make_empty_string_null('feed_publisher_name') }} AS feed_publisher_name,
{{ trim_make_empty_string_null('feed_publisher_url') }} AS feed_publisher_url,
{{ trim_make_empty_string_null('feed_lang') }} AS feed_lang,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ stg_gtfs_schedule__frequencies AS (
SELECT
base64_url,
ts,
dt AS _dt,
{{ trim_make_empty_string_null('trip_id') }} AS trip_id,
{{ trim_make_empty_string_null('start_time') }} AS start_time,
{{ trim_make_empty_string_null('end_time') }} AS end_time,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ stg_gtfs_schedule__levels AS (
SELECT
base64_url,
ts,
dt AS _dt,
{{ trim_make_empty_string_null('level_id') }} AS level_id,
level_index,
{{ trim_make_empty_string_null('level_name') }} AS level_name
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ stg_gtfs_schedule__routes AS (
SELECT
base64_url,
ts,
dt AS _dt,
{{ trim_make_empty_string_null('route_id') }} AS route_id,
{{ trim_make_empty_string_null('route_type') }} AS route_type,
{{ trim_make_empty_string_null('agency_id') }} AS agency_id,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ stg_gtfs_schedule__stop_areas AS (
SELECT
base64_url,
ts,
dt AS _dt,
{{ trim_make_empty_string_null('area_id') }} AS area_id,
{{ trim_make_empty_string_null('stop_id') }} AS stop_id
FROM external_stop_areas
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ stg_gtfs_schedule__transfers AS (
SELECT
base64_url,
ts,
dt AS _dt,
{{ trim_make_empty_string_null('from_stop_id') }} AS from_stop_id,
{{ trim_make_empty_string_null('to_stop_id') }} AS to_stop_id,
SAFE_CAST({{ trim_make_empty_string_null('transfer_type') }} AS INTEGER) AS transfer_type,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
{{ config(enabled=False) }}
-- we do not actually process translations right now

WITH external_translations AS (
SELECT *
FROM {{ source('external_gtfs_schedule', 'translations') }}
Expand All @@ -12,6 +15,7 @@ stg_gtfs_schedule__translations AS (
SELECT
base64_url,
ts,
dt AS _dt,
{{ trim_make_empty_string_null('table_name') }} AS table_name,
{{ trim_make_empty_string_null('field_name') }} AS field_name,
{{ trim_make_empty_string_null('language') }} AS language,
Expand Down

0 comments on commit 2fe7099

Please sign in to comment.