Skip to content

Conversation

@limx0
Copy link

@limx0 limx0 commented Jul 3, 2016

No description provided.

@codecov-io
Copy link

codecov-io commented Jul 3, 2016

Current coverage is 84.31% (diff: 100%)

Merging #13552 into master will decrease coverage by 0.97%

@@ master #13552 diff @@ ========================================== Files 139 138 -1 Lines 50241 51157 +916 Methods 0 0 Messages 0 0 Branches 0 0 ========================================== + Hits 42851 43131 +280  - Misses 7390 8026 +636  Partials 0 0 

Powered by Codecov. Last update 5d791cc...d599b10


def _put_lines(buf, lines):
if any(isinstance(x, compat.text_type) for x in lines):
if any(not isinstance(x, compat.text_type) for x in lines):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why are you suggesting this change? This changes the display output of .info(). what exactly is the problem?

@jreback jreback added the Output-Formatting __repr__ of pandas objects, to_string label Jul 3, 2016
@limx0
Copy link
Author

limx0 commented Jul 3, 2016

@jreback the following raises a TypeError

import pandas as pd from io import StringIO buf = StringIO() pd.DataFrame().info(buf=buf) 2642 if any(isinstance(x, compat.text_type) for x in lines): 2643 lines = [compat.text_type(x) for x in lines] -> 2644 buf.write('\n'.join(lines)) 2645 2646 TypeError: unicode argument expected, got 'str'

Which I believe this PR fixes (and is the proper intention of the code)

@jorisvandenbossche
Copy link
Member

@limx0 Can you add a test for the actual info issue?

skip = False

def test_put_lines(self):
from io import StringIO
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

StringIO is already imported from pandas.compat

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

further, can you add the pr number in a comment on the first line?

@limx0
Copy link
Author

limx0 commented Aug 17, 2016

@jorisvandenbossche this is now working in the latest master. Closing this PR

@limx0 limx0 closed this Aug 17, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Output-Formatting __repr__ of pandas objects, to_string

4 participants