Skip to content
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

Review NTD Validation models #3501

Merged
merged 3 commits into from
Oct 16, 2024
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ schema_fields:
type: INTEGER
- name: Size
type: STRING
- name: Type
type: STRING
- name: DOTCapitalResponsibility
type: FLOAT
- name: OrganizationCapitalResponsibility
Expand All @@ -95,6 +97,10 @@ schema_fields:
type: STRING
- name: PrivateMode
type: STRING
- name: Note
type: STRING
- name: LastModifiedDate
type: TIMESTAMP
- name: ntdassetandresourceinfo_data
type: RECORD
mode: REPEATED
Expand Down Expand Up @@ -139,6 +145,44 @@ schema_fields:
type: STRING
- name: LastModifiedDate
type: TIMESTAMP
- name: AgencyFleetId
type: STRING
- name: TotalVehicles
type: INTEGER
- name: ActiveVehicles
type: INTEGER
- name: DedicatedFleet
type: BOOLEAN
- name: NoCapitalReplacementResponsibility
type: BOOLEAN
- name: AutomatedorAutonomousVehicles
type: STRING
- name: Manufacturer
type: STRING
- name: DescribeOtherManufacturer
type: STRING
- name: Model
type: STRING
- name: YearRebuilt
type: INTEGER
- name: OtherFuelType
type: STRING
- name: DuelFuelType
type: STRING
- name: StandingCapacity
type: INTEGER
- name: OtherOwnershipType
type: STRING
- name: EmergencyVehicles
type: BOOLEAN
- name: TypeofLastRenewal
type: STRING
- name: UsefulLifeBenchmark
type: INTEGER
- name: MilesThisYear
type: INTEGER
- name: AverageLifetimeMilesPerActiveVehicle
type: INTEGER
- name: ntdreportingp10_data
type: RECORD
mode: REPEATED
Expand Down Expand Up @@ -320,14 +364,24 @@ schema_fields:
type: STRING
- name: AnnualVehicleRevMiles
type: INTEGER
- name: AnnualVehicleRevMilesComments
type: STRING
- name: AnnualVehicleRevHours
type: INTEGER
- name: AnnualVehicleRevHoursComments
type: STRING
- name: AnnualUnlinkedPassTrips
type: INTEGER
- name: AnnualUnlinkedPassTripsComments
type: STRING
- name: AnnualVehicleMaxService
type: INTEGER
- name: AnnualVehicleMaxServiceComments
type: STRING
- name: SponsoredServiceUPT
type: INTEGER
- name: SponsoredServiceUPTComments
type: STRING
- name: Quantity
type: INTEGER
- name: LastModifiedDate
Expand Down Expand Up @@ -372,6 +426,8 @@ schema_fields:
type: STRING
- name: VehiclesToBeRetiredBeyondULB
type: INTEGER
- name: VehiclesToBePurchasesNextYear
type: INTEGER
- name: VehiclesPastULBInTAM
type: INTEGER
- name: LastModifiedDate
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@ vins_a30 as (
GROUP BY organization, fiscal_year
)

select voms_rr20.*, vins_a30.a30_vin_n
SELECT COALESCE(voms_rr20.organization, vins_a30.organization) as organization,
COALESCE(voms_rr20.fiscal_year, vins_a30.fiscal_year) as fiscal_year,
voms_rr20.rr20_voms,
vins_a30.a30_vin_n
FROM voms_rr20
FULL OUTER JOIN vins_a30
ON voms_rr20.organization = vins_a30.organization
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@
WITH rr20f_180 as (
SELECT organization,
"RR20F-180: VOMS across forms" as name_of_check,
fiscal_year as year_of_data,
CASE WHEN ROUND(rr20_voms, 1) > ROUND(a30_vin_n, 1)
THEN "Fail"
ELSE "Pass"
END as check_status,
CONCAT("RR-20 VOMS = ", CAST(ROUND(rr20_voms, 1) AS STRING),
"# A-30 VINs = ", CAST(ROUND(a30_vin_n, 1) AS STRING)) AS value_checked,
CONCAT("RR-20 VOMS = ", IF(rr20_voms IS NULL, ' ', CAST(ROUND(rr20_voms, 1) AS STRING)),
", A-30 VINs = ", IF(a30_vin_n IS NULL, ' ', CAST(ROUND(a30_vin_n, 1) AS STRING))
) AS value_checked,
CASE WHEN ROUND(rr20_voms, 1) > ROUND(a30_vin_n, 1)
THEN "Total VOMS is greater than total A-30 vehicles reported. Please clarify."
ELSE "VOMS & A-30 vehicles reported are equal to and/or lower than active inventory."
Expand Down
Loading
Loading