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

Update NTD validation models for 2024 (Blackcat) #3483

Open
erikamov opened this issue Sep 28, 2024 · 6 comments
Open

Update NTD validation models for 2024 (Blackcat) #3483

erikamov opened this issue Sep 28, 2024 · 6 comments
Assignees
Labels
product: ntd reporting Items related to ntd reporting pipeline. Product owner is Christian.

Comments

@erikamov
Copy link
Contributor

erikamov commented Sep 28, 2024

User story / feature request

As an Analyst
I want to use NTD validation models for 2024 data

Acceptance Criteria

Check if the models bellow are displaying data for the correct year (2024).

Intermediate models:

  • cal-itp-data-infra.staging.int_ntd_a10_facilitiesdata
  • cal-itp-data-infra.staging.int_ntd_rr20_financial_fare_revenues
  • cal-itp-data-infra.staging.int_ntd_rr20_financial_specific_funds
  • cal-itp-data-infra.staging.int_ntd_rr20_financial_total_exp
  • cal-itp-data-infra.staging.int_ntd_rr20_service_1alldata
  • cal-itp-data-infra.staging.int_ntd_rr20_service_3ratios_wide

Mart models:

  • cal-itp-data-infra.mart_ntd_validation.fct_ntd_rr20_funds_checks
  • cal-itp-data-infra.mart_ntd_validation.fct_ntd_rr20_service_checks

Models bellow are not in use anymore and can be dropped:

  • cal-itp-data-infra.staging.stg_ntd_2022_rr20_exp_by_mode
  • cal-itp-data-infra.staging.stg_ntd_2022_rr20_financial
  • cal-itp-data-infra.staging.stg_ntd_2022_rr20_service

Notes

Process details and changes described on Deliverable 4 - NTD Data Orchestration Pipeline

Based on a conversation with Christian Suyat, some changes need to done for 2024:

Other related links: DAG, stg, int, mart models.

@erikamov erikamov self-assigned this Sep 28, 2024
@erikamov
Copy link
Contributor Author

erikamov commented Oct 1, 2024

Work in progress on 3483-ntd-validation-2024 branch.

erikamov added a commit that referenced this issue Oct 2, 2024
erikamov added a commit that referenced this issue Oct 2, 2024
erikamov added a commit that referenced this issue Oct 3, 2024
erikamov added a commit that referenced this issue Oct 3, 2024
…ed on the timestamp that the DAG run started.

[#3483]
@erikamov
Copy link
Contributor Author

erikamov commented Oct 3, 2024

PR is ready for review.

@ohrite ohrite added this to the National Transit Database milestone Oct 3, 2024
erikamov added a commit that referenced this issue Oct 4, 2024
…ed on the timestamp that the DAG run started.

[#3483]
@erikamov
Copy link
Contributor Author

erikamov commented Oct 7, 2024

PR merged, waiting for next DAG run and update tables tomorrow.

@erikamov
Copy link
Contributor Author

erikamov commented Oct 8, 2024

Tables were successfully updated today.

Changes are done, the only pending item is to drop the models bellow that are not in use anymore:

  • cal-itp-data-infra.staging.stg_ntd_2022_rr20_exp_by_mode
  • cal-itp-data-infra.staging.stg_ntd_2022_rr20_financial
  • cal-itp-data-infra.staging.stg_ntd_2022_rr20_service

@evansiroky evansiroky added the product: ntd reporting Items related to ntd reporting pipeline. Product owner is Christian. label Oct 8, 2024
erikamov added a commit that referenced this issue Oct 9, 2024
erikamov added a commit that referenced this issue Oct 9, 2024
@ohrite ohrite removed this from the National Transit Database milestone Oct 9, 2024
erikamov added a commit that referenced this issue Oct 9, 2024
@csuyat-dot
Copy link
Contributor

Found new column names in the Blackcat 2024 API that need to be added. See below for a list of the new columns names and attached txt file.

  • NTDTransitAssetManagement
    Type
    Notes
    LastModifiedDate

  • NTDAssetAndResourceInfo
    TotalVehicles
    ActiveVehicles
    DedicatedFleet
    NoCapitalReplacementResponsibility
    AutomatedorAutonomousVehicles
    Manufacturer
    DescribeOtherManufacturer
    Model
    YearRebuilt
    OtherFuelType
    DuelFuelType
    StandingCapacity
    OtherOwnershipType
    EmergencyVehicles
    TypeofLastRenewal
    UsefulLifeBenchmark
    MilesThisYear
    AverageLifetimeMilesPerActiveVehicle

  • NTDReportingRR20_Rural
    AnnualVehicleRevMilesComments
    AnnualVehicleRevHoursComments
    AnnualUnlinkedPassTripsComments
    AnnualVehicleMaxServiceComments
    SponsoredServiceUPTComments

  • NTDReportingTAMNarrative
    VehiclesToBePurchasesNextYear

updated external_table_all_ntdreports.yaml.txt

erikamov added a commit that referenced this issue Oct 11, 2024
erikamov added a commit that referenced this issue Oct 14, 2024
…on value_checks and description to service checks

[#3483]
erikamov added a commit that referenced this issue Oct 14, 2024
erikamov added a commit that referenced this issue Oct 15, 2024
erikamov added a commit that referenced this issue Oct 15, 2024
…on value_checks and description to service checks

[#3483]
erikamov added a commit that referenced this issue Oct 15, 2024
erikamov added a commit that referenced this issue Oct 16, 2024
… NTD validation service check.

Also display values on value_check with two decimal numbers.

[#3483]
erikamov added a commit that referenced this issue Oct 16, 2024
…on by zero error on NTD Validation Service Check, and fix information on value_checks and description.

[#3483]
erikamov added a commit that referenced this issue Oct 16, 2024
…ked column for NTD Validation VOMS and Vins Checks

[#3483]
erikamov added a commit that referenced this issue Oct 16, 2024
…on by zero error on NTD Validation Service Check, and fix information on value_checks and description.

[#3483]
erikamov added a commit that referenced this issue Oct 16, 2024
…ked column for NTD Validation VOMS and Vins Checks

[#3483]
@erikamov
Copy link
Contributor Author

On this last PR:

  • Added new columns requested by Christian Suyat on external table all_ntdreports.
  • Fixed some issues on NTD validation models:
    • Division by zero error: Added new clauses on fct_ntd_rr20_service_checks to verify if the values are not NULL or Zero before the calculation, and fixed ROUND function to use only at the end of the calculation.
    • Blank value_checked results: Replaced NULL values by " " (space) to make the Concatenation function to return the existing values on fct_ntd_rr20_service_checks, fct_ntd_a30_vomscheck.
    • Blank Organizations: Return Organization names from last year table when the Organization does not exist in the current year on int_ntd_a30_voms_vins_totals
    • No information about the year: Added year_of_data column on fct_ntd_a30_vomscheck

Note: As much as I want to fix indentation and some patterns on those files, I couldn't change much because it was making hard to see the real changes (GIT DIFF), so it could be added to next iterations.

All models were already updated by the DAG and looking good so far. Christian will keep checking.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
product: ntd reporting Items related to ntd reporting pipeline. Product owner is Christian.
Projects
None yet
Development

No branches or pull requests

4 participants