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

BUG display.max_colwidth do not accept -1 for unlimited width #31532

Closed
glemaitre opened this issue Feb 1, 2020 · 2 comments · Fixed by #31569
Closed

BUG display.max_colwidth do not accept -1 for unlimited width #31532

glemaitre opened this issue Feb 1, 2020 · 2 comments · Fixed by #31569
Labels
Deprecate Functionality to remove in pandas Output-Formatting __repr__ of pandas objects, to_string Regression Functionality that used to work in a prior pandas version
Milestone

Comments

@glemaitre
Copy link
Contributor

Code Sample, a copy-pastable example if possible

import pandas as pd
pd.set_option("display.max_colwidth", -1)

Problem description

There is a regression with "display.max_colwidth". In the past, it was only accepting integer. The way to no limit the size was to pass -1. In pandas 1,0, this option becomes more consistent and not limiting the width should be set with None. However, the support for negative integer was removed.

Thus, one would need to either set to -1 or None depending on the pandas version. It would be best to support both options. Potentially, support for negative integer could be removed with a deprecation cycle.

@charlesdong1991 charlesdong1991 added the Deprecate Functionality to remove in pandas label Feb 1, 2020
@jorisvandenbossche jorisvandenbossche added the Regression Functionality that used to work in a prior pandas version label Feb 1, 2020
@jorisvandenbossche jorisvandenbossche added this to the 1.0.1 milestone Feb 1, 2020
@jorisvandenbossche jorisvandenbossche added the Output-Formatting __repr__ of pandas objects, to_string label Feb 1, 2020
@MarcoGorelli
Copy link
Member

MarcoGorelli commented Feb 2, 2020

It would be best to support both options. Potentially, support for negative integer could be removed with a deprecation cycle.

@jorisvandenbossche Is this what we're going for then - add support for -1 back in, but raise a FutureWarning alerting the user that it'll no longer work in a future version?

It reminds me of the header argument in read_csv, whereby header=-1 used to work in 0.24, then in 0.25 it didn't (see #27779) and so we now raise

ValueError: Passing negative integer to header is invalid. For no header, use header=None instead

Perhaps the current ValueError message could just have an extra line specifically instructing to use None instead of -1, in the case that -1 is passed?

@glemaitre
Copy link
Contributor Author

I made a PR to reverse the support and add a deprecation cycle.

gregcaporaso added a commit to qiime2/q2-sample-classifier that referenced this issue Apr 30, 2024
gregcaporaso added a commit to qiime2/q2-sample-classifier that referenced this issue May 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Deprecate Functionality to remove in pandas Output-Formatting __repr__ of pandas objects, to_string Regression Functionality that used to work in a prior pandas version
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants