Skip to content

Keep source column when sources vector has one file - #1192

Open
JohnCobbler wants to merge 2 commits into
JuliaData:mainfrom
JohnCobbler:fix/1146-source-column-single-source
Open

Keep source column when sources vector has one file#1192
JohnCobbler wants to merge 2 commits into
JuliaData:mainfrom
JohnCobbler:fix/1146-source-column-single-source

Conversation

@JohnCobbler

Copy link
Copy Markdown

File(sources::Vector; source=...) short-circuits a one-element vector to
File(sources[1]; kw...), forwarding only kw.... The source keyword is bound
to its own parameter, so it is not part of kw and gets dropped - a single-element
sources vector silently loses the requested source column, while the source-column
injection only runs in the multi-source path.

Skip the short-circuit when source is set, so a one-element vector falls through
to the general path that adds the column. The source === nothing fast path is
unchanged.

Added regression tests for a single-element sources vector: the source column
is present with Symbol/String/Pair names, and the no-source case still
matches the scalar CSV.File(path) result.

Fixes #1146

JohnCobbler and others added 2 commits July 24, 2026 15:28
The single-source short-circuit in File(::Vector) forwarded only kw...,
which omits the source keyword, so a one-element sources vector silently
dropped the requested source column. Skip the short-circuit when source
is set so the general path adds the column.

Co-authored-by: Claude <noreply@anthropic.com>
@codecov

codecov Bot commented Jul 24, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.79%. Comparing base (0a1fb3c) to head (d8abf44).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1192   +/-   ##
=======================================
  Coverage   90.79%   90.79%           
=======================================
  Files           9        9           
  Lines        2335     2335           
=======================================
  Hits         2120     2120           
  Misses        215      215           

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

source column-name missing when the input vector contains only one csv-file

1 participant