Skip to content

DRAFT: Fix for Issue/2089#2149

Draft
PatrickSteil wants to merge 2 commits intoMobilityData:masterfrom
PatrickSteil:fix/issue2089
Draft

DRAFT: Fix for Issue/2089#2149
PatrickSteil wants to merge 2 commits intoMobilityData:masterfrom
PatrickSteil:fix/issue2089

Conversation

@PatrickSteil
Copy link
Copy Markdown
Contributor

This is a draft PR for #2089.

Problem

When any row in a file had a field-level validation error (e.g. an invalid URL in agency.txt), CsvFileLoader set hasUnparsableRows = true and returned an UNPARSABLE_ROWS container while discarding all entities from that file, including valid ones.
This caused a silent cascade: if agency.txt had even one bad field value, the agency table appeared empty to downstream validators, meaning invalid agency_id references in routes.txt went unreported.

Root Cause

The hasUnparsableRows flag conflated two distinct problems:

  • Structural parse failures (wrong row length, row number overflow), the row genuinely cannot be parsed, and the entity should be discarded
  • Field-level validation errors (invalid URL, missing required field value), the row was parsed fine, the error is recorded, but the entity is excluded via the else if branch already

The flag was only correct for the first case. For the second, the error is already recorded in noticeContainer (line 126) and the entity is already excluded, setting hasUnparsableRows = true was redundant and harmful.

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.

1 participant