Conversation
CSV 0.10 accepted a selector function for `select` and `drop`. 1.0 rejected it and pointed users at `Tables.Scan`, but a Scan cannot express a computed rule over header names, such as normalizing each name before matching it against a list (#1207). The function only needs header names, which are settled before any value is read, so `_selectpositions` turns it into the Bool mask it already accepts. Every reader that settles columns (`File`, `lazy`, `File(lazyfile)`, `Rows`, `Chunks`, and multi-source vectors) gets it through that one path. As in 0.10, the function receives the column position and the (normalized) `Symbol` name and must return a `Bool`. `types` and `pool` still reject functions. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1210 +/- ##
=======================================
Coverage 95.75% 95.75%
=======================================
Files 9 9
Lines 5489 5491 +2
=======================================
+ Hits 5256 5258 +2
Misses 233 233 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1207.
CSV 0.10 accepted a selector function of the form
(i, name) -> Boolforselectanddrop. 1.0 rejected it and pointed users atTables.Scan. A Scan cannot express a computed rule over header names, such as normalizing each name before matching it against a list, which is the #1207 workflow.Change
_selectpositionsnow turns the function into the Bool mask it already accepts.CSV.File,CSV.lazy,CSV.File(lazyfile),CSV.Rows,CSV.Chunks, and multi-source vectors.Symbolname (afternormalizenames) and must return aBool.typesandpoolstill reject functions.Rowsdocstring.Tests
select and drop functionstestset:Filefrom IO and from bytes,drop, all-false masks,lazy,Rows,Chunks, multi-source vectors,normalizenames, positions underCSV.File(lazyfile), and a non-Boolreturn.--check-bounds=yes -t4),test/api.jlon Julia 1.10,test/quality.jl11/11, and the docs build.drop=_drop. It must callString(name)beforeUnicode.normalize, because the name is aSymbol, as in 0.10.🤖 Generated with Claude Code