Skip to content

feat: report empty required and recommended files - #2181

Open
mackenziereading19 wants to merge 1 commit into
MobilityData:masterfrom
mackenziereading19:1853-empty-required-recommended-files
Open

feat: report empty required and recommended files#2181
mackenziereading19 wants to merge 1 commit into
MobilityData:masterfrom
mackenziereading19:1853-empty-required-recommended-files

Conversation

@mackenziereading19

Copy link
Copy Markdown

Summary

This PR addresses #1853 by distinguishing GTFS files that are present with valid headers but contain no data rows.

The loader already treats a completely empty/headerless CSV as EmptyFileNotice. However, a headers-only file is considered parsable and previously produced no notice even when the file was required or recommended.

This change adds:

  • RequiredFileEmptyNotice (ERROR) for required files with headers but no data rows;
  • RecommendedFileEmptyNotice (WARNING) for recommended files with headers but no data rows;
  • no new notice for optional files with headers but no data rows;
  • updated EmptyFileNotice documentation so it only describes genuinely headerless files.

The parsed table remains PARSABLE_HEADERS_AND_ROWS in all headers-only cases because the file structure and headers are valid; the new notices describe the file-content requirement rather than reclassifying the table as missing or unparsable.

Tests

Added regression coverage for:

  • required headers-only file -> RequiredFileEmptyNotice;
  • recommended headers-only file -> RecommendedFileEmptyNotice;
  • optional headers-only file -> no empty-file notice.

Local verification:

  • full :core:test: pass;
  • targeted NoticeReferenceTest: pass;
  • :core:spotlessCheck and :main:spotlessCheck: pass;
  • git diff --check: pass.

Fixes #1853

@emmambd
emmambd requested a review from skalexch September 1, 2026 17:44
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.

Required and recommended notices on files with no rows

1 participant