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

DbtTestFail: test.calitp_warehouse.unique_proportion_fct_vehicle_locations_grouped_0_9999__trip_instance_key.a... #3720

Open
cal-itp-sentry bot opened this issue Feb 19, 2025 · 1 comment

Comments

@cal-itp-sentry
Copy link

cal-itp-sentry bot commented Feb 19, 2025

Sentry Issue: CAL-ITP-DATA-INFRA-2D5C

DbtTestFail: test.calitp_warehouse.unique_proportion_fct_vehicle_locations_grouped_0_9999__trip_instance_key.ab78e501d7 - Got 1 result, configured to fail if != 0

Fix fct_vehicle_locations #3599 first and it may fix these errors too.

  • not_null_fct_vehicle_locations_grouped_trip_instance_key

    Table: mart_gtfs.fct_vehicle_locations_grouped
    Column: trip_instance_key

    Failing because of 8,718,512 records with null trip_instance_key

select *
from mart_gtfs.fct_vehicle_locations_grouped
where trip_instance_key is null
  • unique_proportion_fct_vehicle_locations_grouped_0_9999__trip_instance_key

    Table: mart_gtfs.fct_vehicle_locations_grouped
    Column: trip_instance_key (macro test_unique_proportion at_least: 0.9999)

    Failing because it is returning 0.008506957, need to be at least 0.9999

with validation as (
  select
    sum(case when row_number > 1 then 0 else 1 end) / cast(count(*) as numeric) as unique_proportion
  from (select
    trip_instance_key
    , row_number() over (partition by trip_instance_key) as row_number
  from mart_gtfs.fct_vehicle_locations_grouped) row_counts
),
validation_errors as (
  select
    unique_proportion
  from validation
  where unique_proportion < 0.9999 or unique_proportion > 1
)
select
  *
from validation_errors
@cal-itp-sentry
Copy link
Author

Sentry issue: CAL-ITP-DATA-INFRA-2D5B

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

0 participants