-
Notifications
You must be signed in to change notification settings - Fork 16
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
fct_vehicle_locations_grouped
- calculate direction from the prior position
#3771
Conversation
1a9122d
to
a7cdecf
Compare
Warehouse report 📦 Checks/potential follow-upsChecks indicate the following action items may be necessary.
Changed incremental models 🔀calitp_warehouse.mart.gtfs_quality.fct_daily_service_alerts_message_age_summary calitp_warehouse.mart.gtfs_quality.fct_daily_trip_updates_message_age_summary calitp_warehouse.mart.gtfs_quality.fct_daily_vehicle_positions_latency_statistics calitp_warehouse.mart.gtfs_quality.fct_daily_vehicle_positions_message_age_summary calitp_warehouse.mart.gtfs_quality.fct_daily_vendor_vehicle_positions_message_age_summary calitp_warehouse.mart.gtfs_quality.fct_daily_with_trip_vehicle_positions_message_age_summary calitp_warehouse.mart.gtfs.fct_service_alerts_messages_unnested calitp_warehouse.mart.gtfs.fct_trip_updates_no_stop_times calitp_warehouse.mart.gtfs.fct_vehicle_locations calitp_warehouse.mart.gtfs.fct_vehicle_locations_grouped calitp_warehouse.intermediate.gtfs.int_gtfs_rt__service_alerts_day_map_grouping calitp_warehouse.intermediate.gtfs.int_gtfs_rt__service_alerts_trip_day_map_grouping calitp_warehouse.intermediate.gtfs.int_gtfs_rt__trip_updates_trip_day_map_grouping calitp_warehouse.intermediate.gtfs.int_gtfs_rt__vehicle_positions_trip_day_map_grouping DAGLegend (in order of precedence)
|
@vevetron: Am i supposed to do uniqueness or 99.9% proportion tests on |
Within dim_stop_times, where a
|
@vevetron: I can't get the not null test to pass, but I did run a Steps I tried:
Thoughts for how to proceed and get rid of a failing test? |
When I try to run this it all errors out. Maybe because I don't have any data to test with. 21:14:51 Compilation Error in model fct_vehicle_locations_grouped (models/mart/gtfs/fct_vehicle_locations_grouped.sql)
|
@vevetron: I materialized a day / one operator in my The tests that didn't pass have to do with not having a |
I had two different sources of errors. I had your old Then when running
error. This is also mitigated by running This is seems to happen for all incremental materialization tables so it's not this pr's fault
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think it's necessaryto materialize this table since this query probably won't happen a lot and we can use the materialized fct_vehicle_locations
and calculate on the fly. But I'm not 100% sure. Still looks good! Please be sure to squash.
This ended up creating errors. I guess I didn't have a full grasp of the error messages I was seeing. |
Description
Change how vehicle positions are grouped within
mart_gtfs.fct_vehicle_locations_grouped
.After using it in
data-analyses
, work here isn't behaving as expected, and we're losing rows we should have, and not grouping other rows that should be grouped.Some noticeable differences are:
vp_direction
should be calculated from previous position. Solution: use lag to compare it to the prior and then group not-moving vehicle positions together.fct_vehicle_locations_grouped
was using current to next location and then using the keys to merge it backkey
andnext_location_key
.next_location_key
is missing, but when you sort based onlocation_timestamp
, there is a next timestampPart of #3645
Related to #3660, #3672
Type of change
How has this been tested?
Tests:
Post-merge follow-ups