Skip to content

Reject duplicate headers in dictionary views - #147

Open
rupayon123 wants to merge 1 commit into
swiftcsv:masterfrom
rupayon123:fix/reject-duplicate-named-headers-20261003
Open

rupayon123 wants to merge 1 commit into
swiftcsv:masterfrom
rupayon123:fix/reject-duplicate-named-headers-20261003

Conversation

@rupayon123

@rupayon123 rupayon123 commented Oct 3, 2026 •

Copy link
Copy Markdown

Duplicate header names currently lose columns when CSV rows are represented as dictionaries. Reject them with CSVParseError.duplicateHeader(name:) in dictionary-backed views and enumeration, while keeping CSV<Enumerated> available for repeated headers whose columns remain positionally distinct.

Added regressions for CSV<Named>, dictionary enumeration and the enumerated view using the translation CSV shape from #134. The enumerated-view test verifies that both columns named en are retained.

Closes #134.

Validation recorded on October 3:

  • Local Swift test run: 45 tests passed, including the three duplicate-header regressions.
  • Swift 4.2 language-mode test run was recorded as passing.
  • SwiftLint was unavailable locally.

Current head: a8b15cf46c5fb27ca85755978879d53ee4392418. The exact-head Swift Actions run requires maintainer approval; remote tests have not run. No maintainer acceptance is claimed.

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.

Columns are silently lost if multiple columns have the same name

1 participant