Skip to content

BUG to_clipboard passes the wrong sep to to_csv #21398

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

Closed
wants to merge 2 commits into from
Closed

BUG to_clipboard passes the wrong sep to to_csv #21398

wants to merge 2 commits into from

Conversation

anhqle
Copy link

@anhqle anhqle commented Jun 9, 2018

Originally, the sep is \t as to_csv expects. A commit changes the sep to r'\t', causing an exception (because csv.writer expects the delimiter to be a one-character string). The exception is suppressed (with pass in the except block), causing the data frame to be passed to to_string downstream (even though it should be handled by to_csv)

Changing r't' back to \t is a quick fix, but just pass in the except block seems like the more problematic root cause (that I'm not handling here).

anhqle added 2 commits June 8, 2018 21:51
Originally, the sep is \t as to_csv expects. A commit changes the sep to r'\t', causing an exception. The exception is suppressed (with except: pass), causing the data frame to be passed to to_string downstream (even though it should be handled to to_csv)
@gfyoung gfyoung added the Regression Functionality that used to work in a prior pandas version label Jun 9, 2018
@gfyoung
Copy link
Member

gfyoung commented Jun 9, 2018

@anhqle : Thanks for this! Going to need a test to protect against this in the future.

@codecov
Copy link

codecov bot commented Jun 9, 2018

Codecov Report

Merging #21398 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master   #21398   +/-   ##
=======================================
  Coverage   91.89%   91.89%           
=======================================
  Files         153      153           
  Lines       49596    49596           
=======================================
  Hits        45576    45576           
  Misses       4020     4020
Flag Coverage Δ
#multiple 90.29% <ø> (ø) ⬆️
#single 41.86% <ø> (ø) ⬆️
Impacted Files Coverage Δ
pandas/io/clipboards.py 100% <ø> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 415012f...9e65713. Read the comment docs.

@anhqle
Copy link
Author

anhqle commented Jun 9, 2018

Close because duplicate of #21111

@anhqle anhqle closed this Jun 9, 2018
@jorisvandenbossche jorisvandenbossche added this to the No action milestone Jun 10, 2018
@jorisvandenbossche jorisvandenbossche added the Duplicate Report Duplicate issue or pull request label Jun 10, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Duplicate Report Duplicate issue or pull request Regression Functionality that used to work in a prior pandas version
Projects
None yet
Development

Successfully merging this pull request may close these issues.

to_clipboard undocumentedly changed from using to_csv to to_string downstream.
3 participants