Skip to content

Rjf/investigate omf panic#82

Merged
robfitzgerald merged 13 commits intomainfrom
rjf/investigate-omf-panic
Jan 27, 2026
Merged

Rjf/investigate omf panic#82
robfitzgerald merged 13 commits intomainfrom
rjf/investigate-omf-panic

Conversation

@robfitzgerald
Copy link
Collaborator

@robfitzgerald robfitzgerald commented Jan 20, 2026

this PR closes #80 by making the "during" field into an enum that can either be an OSM OpeningHoursExpression or just a String in the case that the opening hours is not valid.

while attempting to download denver, i encountered a segment with during = "sunset", which is not a valid entry. it will now be captured in the Unexpected(String) variant of the new DuringExpression.

along the way,

  • i moved the bambam_omf.rs binary into main.rs following the pattern of other bambam crates
  • moved batch_size and object_source into the CLI (i was exploring issues with collection more broadly)
  • replaced sort and pop with max while finding the latest release

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes a panic issue (#80) that occurred when encountering invalid opening hours expressions (e.g., "sunset") during data collection from Overture Maps. The fix introduces a new DuringExpression enum that can handle both valid OSM opening hours expressions and unexpected string values.

Changes:

  • Introduced DuringExpression enum to gracefully handle invalid opening hours expressions as Unexpected(String) variant
  • Moved binary entry point from src/bin/bambam_omf.rs to src/main.rs following project conventions
  • Exposed batch_size and object_store as CLI arguments for better configurability
  • Refactored latest release detection to use max_by_key instead of sort + pop

Reviewed changes

Copilot reviewed 8 out of 9 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
rust/bambam-omf/src/main.rs New main entry point with proper error handling via Result return type
rust/bambam-omf/src/collection/record/during_expression.rs New enum type to handle both valid and invalid opening hours expressions
rust/bambam-omf/src/collection/record/transportation_segment.rs Updated to use DuringExpression instead of OpeningHoursExpression; contains commented-out code
rust/bambam-omf/src/collection/record/mod.rs Added during_expression module
rust/bambam-omf/src/collection/object_source.rs Added ValueEnum derive, Display impl, and serde rename attributes for CLI support
rust/bambam-omf/src/collection/collector.rs Refactored to use max_by_key and improved error message
rust/bambam-omf/src/app/omf_app.rs Added batch_size and object_store CLI arguments
rust/bambam-omf/src/app/network.rs Updated to accept and use new CLI parameters
rust/bambam-omf/src/bin/bambam_omf.rs Removed - functionality moved to main.rs

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Collaborator

@yamilbknsu yamilbknsu left a comment

Choose a reason for hiding this comment

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

Looks good, thank you for picking up the organization of the input parameters along the way!

I have move a couple stuff around in this fashion in my branches but nothing too complex to solve I think.

Also, about the timeouts in #80, I think those are the same ones I was randomly getting last year and I thought I solved them with the io_handle thing. If that is not enough, I believe the row group optimization should totally do it, but we can keep an eye on that.

@robfitzgerald
Copy link
Collaborator Author

i rolled back this change because of conflicts with other concurrent work: Exposed batch_size and object_store as CLI arguments for better configurability

@robfitzgerald robfitzgerald merged commit 02e93a7 into main Jan 27, 2026
1 check passed
@robfitzgerald robfitzgerald deleted the rjf/investigate-omf-panic branch January 27, 2026 18:00
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

Successfully merging this pull request may close these issues.

robust handling of network + deserialization errors during omf import

3 participants