-
-
Notifications
You must be signed in to change notification settings - Fork 18.6k
Make DataFrame.to_html output full content #24841
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
Changes from 2 commits
5d8890a
bfad29e
eef4490
8ef0c9a
73e808a
49f45d1
2963bfa
9e4459b
ad1e83c
e07775d
1092d55
b12f658
0e581ad
5c2e9c2
cd63aa5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,6 +15,8 @@ | |
|
||
import pandas.io.formats.format as fmt | ||
|
||
lorum_ipsum = "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum." # noqa | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can you be specificerror when using noqa There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. if your happy using that text, i'll break the string up over several lines instead of using the # noqa directive There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes that would be better actually There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. or make it a fixture, or use an existing fixture. i'm open to suggestions There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. oh a fixture would be good There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. top level conftest.py? session scope is ok for immutable string |
||
|
||
|
||
def expected_html(datapath, name): | ||
""" | ||
|
@@ -600,3 +602,20 @@ def test_to_html_render_links(render_links, expected, datapath): | |
result = df.to_html(render_links=render_links) | ||
expected = expected_html(datapath, expected) | ||
assert result == expected | ||
|
||
|
||
@pytest.mark.parametrize('max_colwidth', [10, 20, 50, 100]) | ||
def test_display_max_colwidth(max_colwidth): | ||
df = DataFrame([lorum_ipsum]) | ||
with pd.option_context('display.max_colwidth', max_colwidth): | ||
result = df._repr_html_() | ||
expected = lorum_ipsum[:max_colwidth - 4] + '...' | ||
assert expected in result | ||
|
||
|
||
@pytest.mark.parametrize('max_colwidth', [10, 20, 50, 100]) | ||
def test_ignore_display_max_colwidth(max_colwidth): | ||
df = DataFrame([lorum_ipsum]) | ||
with pd.option_context('display.max_colwidth', max_colwidth): | ||
result = df.to_html() | ||
assert lorum_ipsum in result |
Uh oh!
There was an error while loading. Please reload this page.