Skip to content

Add seed table for ntd_id (2022) and (organization) source_record_id #3366

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
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
242 changes: 242 additions & 0 deletions warehouse/models/mart/ntd/dim_org_seed_results.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,242 @@
ntd_id,ntd_id_2022,test_ntd_id,name
90003,90003,90003,San Francisco Bay Area Rapid Transit District
90004,90004,90004,Golden Empire Transit District
90006,90006,90006,Santa Cruz Metropolitan Transit District
90008,90008,90008,City of Santa Monica
90009,90009,90009,San Mateo County Transit District
90010,90010,90010,City of Torrance
90012,90012,90012,San Joaquin Regional Transit District
90013,90013,90013,Santa Clara Valley Transportation Authority
90014,90014,90014,Alameda-Contra Costa Transit District
90015,90015,90015,City and County of San Francisco
90016,90016,90016,"Golden Gate Bridge, Highway and Transportation District"
90017,90017,90017,City of Santa Rosa
90019,90019,90019,Sacramento Regional Transit District
90020,90020,90020,Santa Barbara Metropolitan Transit District
90022,90022,90022,City of Norwalk
90023,90023,90023,Long Beach Transit
90024,90024,90024,City of La Mirada
90026,90026,90026,San Diego Metropolitan Transit System
90027,90027,90027,City of Fresno
90029,90029,90029,OmniTrans
90030,90030,90030,North County Transit District
90031,90031,90031,Riverside Transit Agency
90035,90035,90035,Gold Coast Transit
90035,90035,90035,Gold Coast Transit District
90036,90036,90036,Orange County Transportation Authority
90039,90039,90039,City of Culver City
90041,90041,90041,City of Montebello
90042,90042,90042,City of Gardena
90043,90043,90043,City of Commerce
90044,90044,90044,City of Arcadia
90050,90050,90050,City of Simi Valley
90052,90052,90052,City of Corona
90061,90061,90061,Yuba-Sutter Transit Authority
90062,90062,90062,Monterey-Salinas Transit
90078,90078,90078,Central Contra Costa Transit Authority
90078,90078,90078,Contra Costa County Transportation Authority
90079,90079,90079,SunLine Transit Agency
90086,90086,90086,City of Riverside
90087,90087,90087,City of Santa Maria
90088,90088,90088,Napa Valley Transportation Authority
90089,90089,90089,Sonoma County
90090,90090,90090,Yolo County Transportation District
90091,90091,90091,City of Visalia
90092,90092,90092,City of Fairfield
90093,90093,90093,Redding Area Bus Authority
90094,,90094,Metropolitan Transportation Commission
90095,90095,90095,San Diego Association of Governments
90119,90119,90119,City of Laguna Beach
90121,90121,90121,Antelope Valley Transit Authority
90134,90134,90134,Peninsula Corridor Joint Powers Board
90142,90142,90142,"University of California, Davis"
90144,90144,90144,"Livermore / Amador
Valley Transit Authority"
90144,90144,90144,Livermore / Amador Valley Transit Authority
90144,90144,90144,Livermore-Amador Valley Transit Authority
90146,90146,90146,Foothill Transit
90147,90147,90147,City of Los Angeles
90148,90148,90148,Victor Valley Transit Authority
90149,90149,90149,City of Lompoc
90151,90151,90151,Southern California Regional Rail Authority
90154,90154,90154,Los Angeles County Metropolitan Transportation Authority
90155,90155,90155,City of Vacaville
90156,90156,90156,City of San Luis Obispo
90157,90157,90157,Access Services
90159,90159,90159,Western Contra Costa Transit Authority
90161,90161,90161,City of Union City
90162,90162,90162,Eastern Contra Costa Transit Authority
90163,90163,90163,City of Camarillo
90164,90164,90164,Ventura County Transportation Commission
90165,90165,90165,City of Thousand Oaks
90167,90167,90167,City of Davis
90168,90168,90168,City of Roseville
90171,90171,90171,City of Santa Clarita
90173,90173,90173,Transit Joint Powers Authority for Merced County
90175,90175,90175,City of Lodi
90182,90182,90182,San Joaquin Regional Rail Commission
90194,90194,90194,City of Atascadero
90196,90196,90196,Placer County
90197,90197,90197,City of Tracy
90198,90198,90198,City of Porterville
90199,90199,90199,City of Madera
90200,90200,90200,Kings County Area Public Transit Agency
90201,90201,90201,City of Turlock
90206,90206,90206,San Luis Obispo Regional Transit Authority
90208,90208,90208,Butte County Association of Governments
90211,90211,90211,Anaheim Transportation Network
90213,90213,90213,City of Petaluma
90214,90214,90214,City of Redondo Beach
9R02-90216,90216,90216,Sacramento County
90217,90217,90217,City of Manteca
90218,90218,90218,Riverside County Transportation Commission
90223,90223,90223,Paratransit Inc.
90225,90225,90225,San Francisco Bay Area Water Emergency Transit Authority
90226,90226,90226,Imperial County Transportation Commission
90227,90227,90227,City of Moorpark
90229,90229,90229,El Dorado County Transit Authority
90230,90230,90230,California Vanpool Authority
90232,90232,90232,Solano County Transit
90233,90233,90233,Yuma County Intergovernmental Public Transportation Authority
90234,90234,90234,Marin County Transit District
90238,90238,90238,City of Delano
90243,90243,90243,Easy Lift Transportation
90246,90246,90246,City of Agoura Hills
90247,90247,90247,City of Alhambra
90249,90249,90249,City of Avalon
90250,90250,90250,City of Azusa
90251,90251,90251,City of Baldwin Park
90252,90252,90252,City of Bell
90253,90253,90253,City of Bell Gardens
90254,90254,90254,City of Bellflower
90255,90255,90255,City of Beverly Hills
90256,90256,90256,City of Burbank
90257,90257,90257,City of Calabasas
90258,90258,90258,City of Carson
90259,90259,90259,City of Cerritos
90260,90260,90260,City of Compton
90261,90261,90261,City of Covina
90262,90262,90262,City of Cudahy
90263,90263,90263,City of Downey
90265,90265,90265,City of El Monte
90266,90266,90266,City of Glendora
90267,90267,90267,City of Huntington Park
90268,90268,90268,City of Inglewood
90271,90271,90271,Los Angeles County
90281,90281,90281,City of Lynwood
90282,90282,90282,City of Malibu
90283,90283,90283,City of Manhattan Beach
90284,90284,90284,City of Maywood
90285,90285,90285,City of Monrovia
90286,90286,90286,City of Monterey Park
90287,90287,90287,Palos Verdes Peninsula Transit Authority
90288,90288,90288,City of Pico Rivera
90289,90289,90289,City of Rosemead
90290,90290,90290,City of Santa Fe Springs
90291,90291,90291,City of South Gate
90292,90292,90292,City of South Pasadena
90293,90293,90293,City of West Covina
90294,90294,90294,City of West Hollywood
90295,90295,90295,City of Whittier
90296,90296,90296,City of Claremont
90298,90298,90298,Ventura County
90299,90299,90299,Sonoma-Marin Area Rail Transit District
90300,90300,90300,City of Artesia
90301,90301,90301,City of Lakewood
90302,90302,90302,San Bernardino County Transportation Authority
90303,90303,90303,Santa Barbara County Association of Governments
90306,,90306,Stanislaus Regional Transit Authority
90310,,90310,Tulare County Regional Transit Agency
9R02-91000,91000,91000,Amador Regional Transit System
9R02-91002,91002,91002,City of Corcoran
9R02-91005,91005,91005,Madera County
9R02-91006,91006,91006,City of Ridgecrest
9R02-91007,91007,91007,Fresno County Rural Transit Agency
9R02-91008,91008,91008,Modoc Transportation Agency
9R02-91008,91008,91008,Modoc Transportation Authority
9R02-91009,91009,91009,San Benito County Local Transportation Authority
9R02-91012,91012,91012,Mountain Area Regional Transit Authority
9R02-91014,91014,91014,City of Rio Vista
9R02-91018,91018,91018,City of Arcata
9R02-91020,91020,91020,City of Needles
9R02-91027,91027,91027,City of Arvin
9R02-91028,91028,91028,City of Solvang
9R02-91032,91032,91032,City of Auburn
9R02-91035,91035,91035,Trinity County
9R02-91036,91036,91036,Humboldt Transit Authority
9R02-91038,91038,91038,Sierra County Transportation Commission
9R02-91041,91041,91041,City of Dixon
9R02-91043,91043,91043,City of Guadalupe
9R02-91047,91047,91047,Mendocino Transit Authority
9R02-91048,91048,91048,Siskiyou County
9R02-91053,91053,91053,Lake Transit Authority
9R02-91055,91055,91055,Tulare County Area Transit
9R02-91057,91057,91057,Tuolumne County Transit Agency
9R02-91058,91058,91058,City of Ojai
9R02-91059,91059,91059,Kern County
9R02-91062,91062,91062,Eastern Sierra Transit Authority
9R02-91066,91066,91066,City of Taft
9R02-91070,91070,91070,Yosemite Area Regional Transportation System
9R02-91071,91071,91071,City of Chowchilla
9R02-91074,91074,91074,City of Tehachapi
9R02-91078,91078,91078,City of Escalon
9R02-91082,91082,91082,Mariposa County
9R02-91088,91088,91088,Glenn County
9R02-91089,91089,91089,Tehama County
9R02-91090,91090,91090,Basin Transit
9R02-91090,91090,91090,Morongo Basin Transit Authority
91092,91092,91092,Tahoe Transportation District
9R02-91093,91093,91093,City of Eureka
9R02-91095,91095,91095,Nevada County
9R02-91097,91097,91097,Redwood Coast Transit Authority
9R02-91098,91098,91098,Lassen Transit Service Agency
9R02-91101,91101,91101,Town of Truckee
9R02-91110,91110,91110,City of McFarland
9R02-91111,91111,91111,City of California City
9R02-91112,91112,91112,Colusa County Transit Agency
9R02-91116,91116,91116,Alpine County
9R02-91119,91119,91119,Plumas County
9R02-91120,91120,91120,City of Shafter
99262,99262,99262,Yurok Tribe
99292,99292,99292,Blue Lake Rancheria
99316,99316,99316,Chemehuevi Indian Tribe
99358,99358,99358,Morongo Band of Mission Indians
99364,99364,99364,North Fork Rancheria of Mono Indians of California
99422,99422,99422,San Joaquin Council of Governments
99423,99423,99423,City of Glendale
99424,99424,99424,City of Pasadena
99245,99425,99425,Pomona Valley Transportation Authority
99425,99425,99425,Pomona Valley Transportation Authority
9R02-99426,99426,99426,City of Wasco
9R02-99442,99442,99442,Calaveras Transit Agency
99452,,99452,Elk Valley Rancheria
9R02-99454,99454,99454,Palo Verde Valley Transit Agency
99268,99268,,Bishop Paiute Tribe
9R02-91063,91063,,Calaveras County
9R02,9R02,,California Department of Transportation
9R02-91040,91040,,City of Dinuba
90264,90264,,City of Duarte
A0003-99449,99449,,City of El Segundo
90205,90205,,City of Elk Grove
90220,90220,,City of Folsom
A0003-99450,99450,,City of Hawaiian Gardens
A0003-99445,,,City of La Habra Heights
90280,90280,,City of Lawndale
90235,90235,,City of Lincoln
90007,90007,,City of Modesto
A0003-99448,,,City of Palmdale
A0003-99451,99451,,City of San Fernando
A0003-99447,99447,,City of Sierra Madre
A0003-99443,99443,,City of South El Monte
90244,90244,,City of Tulare
9R02-91079,91079,,City of Woodlake
90236,90236,,Historic: Stanislaus Regional Transit
A0003-99444,,,Hollywood Burbank Airport
9R02-005,,,Plumas County Transportation Commission
99310,,,"Quechan Tribe of the Fort Yuma Indian Reservation, California & Arizona"
90308,,,Sacramento Area Council of Governments
90297,90297,,San Luis Obispo Council of Governments
9R02-99438,99438,,Shasta County
90236,90236,,Stanislaus Regional Transit
99256,99256,,Susanville Indian Rancheria
99370,99370,,Tule River Tribe
15 changes: 13 additions & 2 deletions warehouse/models/mart/transit_database/dim_organizations.sql
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,18 @@ ntd_agency_to_organization AS (
SELECT * FROM {{ ref('_deprecated__ntd_agency_to_organization') }}
),


bridge_ntd_organization AS (
SELECT
CAST(ntd_id AS STRING) as test_ntd_id,
source_record_id
FROM {{ ref('ntd_id_to_source_record_id') }}
),

dim_organizations AS (
SELECT
key,
source_record_id,
COALESCE(dim.source_record_id, bridge_ntd_organization.source_record_id) AS source_record_id,
name,
organization_type,
roles,
Expand All @@ -35,15 +43,18 @@ dim_organizations AS (
IF(LENGTH(ntd_id) >= 10,
SUBSTR(ntd_id, -5),
ntd_id) AS ntd_id_2022,
test_ntd_id,
public_currently_operating,
public_currently_operating_fixed_route,
_is_current,
_valid_from,
_valid_to

FROM dim
LEFT JOIN ntd_agency_to_organization ntd_to_org
LEFT JOIN ntd_agency_to_organization AS ntd_to_org
ON source_record_id = ntd_to_org.organization_record_id
LEFT JOIN bridge_ntd_organization
ON dim.source_record_id = bridge_ntd_organization.source_record_id
)

SELECT * FROM dim_organizations
6 changes: 6 additions & 0 deletions warehouse/seeds/_seeds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -208,3 +208,9 @@ seeds:
- name: organization_name
tests:
- unique
- name: ntd_id_to_source_record_id
description: |
test crosswalk from ntd_id_2022 to (organization)_source_record_id
columns:
- name: ntd_id
- name: source_record_id
Loading
Loading