feat(cli): add --select flag for csv/json value column selection#140
Merged
Conversation
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
Parse comma-separated column specs with optional {rename} labels and
quote escaping. Wire through CommonOptions into csv/json parsers with
flag-order series, group overlap validation, and a warning when used
with benchmark parsers.
Fresh worktrees were missing node_modules, causing astro/prettier not found errors. Run pnpm install when node_modules is absent.
fahimfaisaal
force-pushed
the
feat/cols-flag
branch
from
June 20, 2026 03:55
cdae655 to
5908958
Compare
Use strconv.Unquote for quoted names, reuse chartColumns for numeric checks, inline group overlap validation and display labels, drop low-value tests.
Renames the csv/json value-column flag, config field, parser helpers, tests, and docs for clearer intent.
Add unit tests for flag parsing failures, invalid ParseConfig input, and JSON explicit column resolution errors to close patch coverage gaps.
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.
Summary
Adds a
--selectflag to the root command and all chart subcommands for selecting which CSV/JSON columns become chart value series, with optional rename via{label}syntax.When omitted, behavior is unchanged — numeric columns are still auto-detected.
Usage
vizb sales.csv --select=price,count vizb sales.csv --select=price{Unit price},count{Total count per week} vizb sales.csv --select="price{USD}",count # quote names containing , { or }Behavior
--selectand--group--selectImplementation
pkg/parser/select_spec.go— quote-aware parsing,{rename}, group overlap validationCommonOptions— flag wired throughparser.Config.Select(parser/input layer, not chart-specific)pkg/parser/csvandpkg/parser/json— explicit column resolution + renamedStat.TypeAlso
Taskfile.yml— auto-runpnpm installinbuild:docs,build:ui, andformatwhennode_modulesis missing (fixes fresh worktree builds)Test plan
go test ./...passestask buildpasses (docs, UI, CLI binary)