Skip to content

BUG accept and deprecate negative integer for max_colwidth #31569

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

Merged
merged 11 commits into from
Feb 2, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
accept none
  • Loading branch information
glemaitre committed Feb 2, 2020
commit 85a0308997c2b17608fbee7338f38c8cc4bd63f0
2 changes: 1 addition & 1 deletion pandas/core/config_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ def _deprecate_negative_int_max_colwidth(key):
"max_colwidth",
50,
max_colwidth_doc,
validator=is_int,
validator=is_instance_factory([type(None), int]),
cb=_deprecate_negative_int_max_colwidth,
)
if is_terminal():
Expand Down
2 changes: 0 additions & 2 deletions pandas/tests/io/formats/test_format.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,10 +243,8 @@ def test_repr_deprecation_negative_int(self):
# FIXME: remove in version 1.2 after deprecation cycle
# Non-regression test for:
# https://github.com/pandas-dev/pandas/issues/31532
value = get_option("display.max_colwidth")
with tm.assert_produces_warning(FutureWarning):
set_option("display.max_colwidth", -1)
set_option("display.max_colwidth", value)

def test_repr_chop_threshold(self):
df = DataFrame([[0.1, 0.5], [0.5, -0.1]])
Expand Down