-
Notifications
You must be signed in to change notification settings - Fork 35
Make CSV importer configurable via ConfigArgParse #166
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
MrlixiangWE
wants to merge
2
commits into
apache:master
Choose a base branch
from
MrlixiangWE:fix/119-csv-configargparse
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am really on the fence with
CONFIG_KEY_ALIASES. @MrlixiangWE can you please elaborate your thoughts on why do we want to introduce them?My take is, if we really dislike
quotechar- now is the time to break backwards compatibility and rename it toquote-chareverywhere (although, I'd like to know the justification for it). OTOH if we can live withquotechar, why don't we just addcsv-quotecharand call it a day?Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The alias table goes away either way — it was bridging a divergence this PR itself created. But let me give the justification you asked for, which I should have led with in the first round instead of just renaming things.
Across the config surface, multi-word names are separated:
time_column,csv_options,update_statement,test_groups,base_branch,bigquery.project_idin YAML;--bigquery-project-id,--since-commit,--config-fileon the CLI;BIGQUERY_PROJECT_IDand friends in the environment.quotecharis the one concatenated exception (not countinghostnameandusername, which are ordinary words). It comes from Python's csv API, but someone writing an otava config shouldn't need to know that — it's just one more special spelling to memorize. That's what the original rename was about — and it matched the names the code itself already used (CsvOptions.quote_char, and the per-test loader key). When you asked to keep the existing name, I took that to mean the per-test files specifically, restoredquotecharthere, and named the new flag--csv-quote-charto match the other options — then papered over the gap with the alias. In hindsight I should have raised the naming question openly instead of doing it in halves.One thing worth knowing before we decide: on current master the per-test loader reads only
quote_char:otava/otava/test_config.py
Lines 257 to 259 in cd5bc1e
so the
quotecharin docs/CSV.md and examples/csv/config/otava.yaml is silently ignored today — the example never notices because its CSV has no quoted fields. The docs and the code already disagree, and a full rename toquote_charwouldn't break any config that actually works.So my vote is the deliberate rename:
quote_charin YAML,--csv-quote-char,CSV_QUOTE_CHAR, docs and examples updated to match, no aliases and no fallback. If you'd rather keepquotechar, I'll do that instead —--csv-quotecharand done. Either way the PR ends with exactly one public spelling.