-
Notifications
You must be signed in to change notification settings - Fork 35
make smart quoting available as a flag #6
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
Conversation
bulk_insert.py
Outdated
| # Initialize CSV reader that ignores leading whitespace in each field | ||
| # and does not modify input quote characters | ||
| self.reader = csv.reader(self.infile, skipinitialspace=True, quoting=csv.QUOTE_NONE) | ||
| #self.reader = csv.reader(self.infile, skipinitialspace=True) |
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.
Delete commented line
bulk_insert.py
Outdated
| @click.option('--max-token-count', '-c', default=1024, help='max number of processed CSVs to send per query (default 1024)') | ||
| @click.option('--max-buffer-size', '-b', default=2048, help='max buffer size in megabytes (default 2048)') | ||
| @click.option('--max-token-size', '-t', default=500, help='max size of each token in megabytes (default 500, max 512)') | ||
| @click.option('--max-token-size', '-t', default=500, help='max size of each token in megabytes (default 500, max 512)') |
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.
Duplicate option line
| @click.option('--max-buffer-size', '-b', default=2048, help='max buffer size in megabytes (default 2048)') | ||
| @click.option('--max-token-size', '-t', default=500, help='max size of each token in megabytes (default 500, max 512)') | ||
| @click.option('--max-token-size', '-t', default=500, help='max size of each token in megabytes (default 500, max 512)') | ||
| @click.option('--quote-minimal/--no-quote-minimal', '-q/-d', default=False, help='only quote those fields which contain special characters such as delimiter, quotechar or any of the characters in lineterminator') |
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 don't think the -d alternate is strictly necessary, but if you think it is helpful then I have no objection!
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.
just kind of helpful for me as I'm lazy
jeffreylovitz
left a comment
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.
Great addition, thanks @maguec !
Some minor notes in comments, but this addition works very well for me.
|
@jeffreylovitz removed the duplicate line and the commented line. pls review |
|
Thanks, @maguec! |
Handle the case where there are quotes around an entry that cause the following error