Skip to content
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

[csv-] warn when guessed option differs from default #2690

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

midichef
Copy link
Contributor

@midichef midichef commented Jan 23, 2025

When csv is guessed without a filetype, visidata uses Python's csv library to guess the parsing options using csv.Sniffer. For the simplest csv files, it seems that doublequote is False, whereas the default in visidata is True. That can surprise users, as it did in #2689.

This PR makes the guessing process more obvious. It outputs a warning for all guessed CSV options that differ from visidata's defaults:

echo a,b |vd
...
guessed option csv_doublequote=False
guessed option csv_skipinitialspace=False

(versions that do the silent guessing are 3.0 and up)

Or should we override the Sniffer guesses to use visidata's defaults?

@midichef midichef changed the title [csv-] warn when guessed option differs from default #2690 [csv-] warn when guessed option differs from default Jan 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants