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

Fix trip duplication in Graph Builder DSJ mapping #5794

Merged

Conversation

vpaturet
Copy link
Contributor

@vpaturet vpaturet commented Apr 8, 2024

Summary

As detailed in #5793, querying passing times for a replaced DatedServiceJourney fails currently with a NullPointerException.

The root cause is the creation of a duplicated Trip object during graph building when resolving the reference to the ServiceJourney associated with a replaced DatedServiceJourney.
Since looking up a given Trip in a Timetable is based on object identity rather than object equality (see

), the lookup fails and leads to a NullPointerException.

The issue can be solved by using a deduplicator when creating the Trip object during graph building.

Issue

Close #5793

Unit tests

Added unit test.

Documentation

No

Changelog

@vpaturet vpaturet added Bug NeTEx This issue is related to the Netex model/import. labels Apr 8, 2024
@vpaturet vpaturet self-assigned this Apr 8, 2024
@vpaturet vpaturet marked this pull request as ready for review April 9, 2024 14:21
@vpaturet vpaturet requested a review from a team as a code owner April 9, 2024 14:21
Copy link

codecov bot commented Apr 9, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 67.86%. Comparing base (0bed0f2) to head (1896c99).
Report is 10 commits behind head on dev-2.x.

Additional details and impacted files
@@            Coverage Diff             @@
##             dev-2.x    #5794   +/-   ##
==========================================
  Coverage      67.85%   67.86%           
+ Complexity     16546    16545    -1     
==========================================
  Files           1906     1906           
  Lines          72291    72292    +1     
  Branches        7444     7444           
==========================================
+ Hits           49055    49059    +4     
+ Misses         20716    20709    -7     
- Partials        2520     2524    +4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@vpaturet vpaturet added the Entur Test This is currently being tested at Entur label Apr 10, 2024
@vpaturet vpaturet requested a review from eibakke April 10, 2024 06:47
Copy link
Contributor

@eibakke eibakke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks fairly straightforward to me.

@vpaturet vpaturet merged commit 28e3fc6 into opentripplanner:dev-2.x Apr 16, 2024
5 checks passed
@vpaturet vpaturet deleted the fix_trip_duplication_in_DSJ_mapping branch April 16, 2024 09:09
t2gran pushed a commit that referenced this pull request Apr 16, 2024
@t2gran t2gran added this to the 2.6 (next release) milestone May 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Entur Test This is currently being tested at Entur NeTEx This issue is related to the Netex model/import.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error when querying passing times for a replaced DatedServiceJourney
4 participants