Skip to content

BUG: Fix categorical formatter not folding the output when it exceeds display width #17639

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 3 commits into from

Conversation

Lunran
Copy link

@Lunran Lunran commented Sep 23, 2017

Let me know if further refactoring is required.

"""
Return the formatted data as a unicode string
"""
from pandas.io.formats.console import get_console_size
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 copying this here?

Copy link
Author

Choose a reason for hiding this comment

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

because i didn't think up a good idea to reuse Index#_format_data() in base.py. (and the output is slightly different.)
any idea?

@codecov
Copy link

codecov bot commented Sep 23, 2017

Codecov Report

Merging #17639 into master will decrease coverage by 0.02%.
The diff coverage is 85%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #17639      +/-   ##
==========================================
- Coverage   91.22%   91.19%   -0.03%     
==========================================
  Files         163      163              
  Lines       49655    49710      +55     
==========================================
+ Hits        45297    45334      +37     
- Misses       4358     4376      +18
Flag Coverage Δ
#multiple 88.99% <85%> (-0.01%) ⬇️
#single 40.13% <1.66%> (-0.11%) ⬇️
Impacted Files Coverage Δ
pandas/core/categorical.py 95.59% <100%> (ø) ⬆️
pandas/io/formats/format.py 95.61% <84.74%> (-0.47%) ⬇️
pandas/io/gbq.py 25% <0%> (-58.34%) ⬇️
pandas/core/frame.py 97.77% <0%> (-0.1%) ⬇️

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 f797c1d...640149e. Read the comment docs.

@codecov
Copy link

codecov bot commented Sep 23, 2017

Codecov Report

Merging #17639 into master will decrease coverage by 0.02%.
The diff coverage is 85%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #17639      +/-   ##
==========================================
- Coverage   91.22%   91.19%   -0.03%     
==========================================
  Files         163      163              
  Lines       49655    49710      +55     
==========================================
+ Hits        45297    45334      +37     
- Misses       4358     4376      +18
Flag Coverage Δ
#multiple 88.99% <85%> (-0.01%) ⬇️
#single 40.13% <1.66%> (-0.11%) ⬇️
Impacted Files Coverage Δ
pandas/core/categorical.py 95.59% <100%> (ø) ⬆️
pandas/io/formats/format.py 95.61% <84.74%> (-0.47%) ⬇️
pandas/io/gbq.py 25% <0%> (-58.34%) ⬇️
pandas/core/frame.py 97.77% <0%> (-0.1%) ⬇️

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 f797c1d...640149e. Read the comment docs.

1 similar comment
@codecov
Copy link

codecov bot commented Sep 23, 2017

Codecov Report

Merging #17639 into master will decrease coverage by 0.02%.
The diff coverage is 85%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #17639      +/-   ##
==========================================
- Coverage   91.22%   91.19%   -0.03%     
==========================================
  Files         163      163              
  Lines       49655    49710      +55     
==========================================
+ Hits        45297    45334      +37     
- Misses       4358     4376      +18
Flag Coverage Δ
#multiple 88.99% <85%> (-0.01%) ⬇️
#single 40.13% <1.66%> (-0.11%) ⬇️
Impacted Files Coverage Δ
pandas/core/categorical.py 95.59% <100%> (ø) ⬆️
pandas/io/formats/format.py 95.61% <84.74%> (-0.47%) ⬇️
pandas/io/gbq.py 25% <0%> (-58.34%) ⬇️
pandas/core/frame.py 97.77% <0%> (-0.1%) ⬇️

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 f797c1d...640149e. Read the comment docs.

@sinhrks sinhrks added Bug Categorical Categorical Data Type Output-Formatting __repr__ of pandas objects, to_string labels Sep 27, 2017
@jreback
Copy link
Contributor

jreback commented Nov 10, 2017

can you rebase / update (and move whatsnew to 0.22.0)

@jreback
Copy link
Contributor

jreback commented Dec 2, 2017

closing as stale. if you want to re-visit this, pls ping.

@jreback jreback closed this Dec 2, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Categorical Categorical Data Type Output-Formatting __repr__ of pandas objects, to_string
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BUG: Categorical repr can exceed options.display.width
3 participants