Skip to content

TST: add test to io/formats/test_to_html.py to close GH6131 #22588

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 4 commits into from
Sep 9, 2018

Conversation

simonjayhawkins
Copy link
Member

@simonjayhawkins simonjayhawkins commented Sep 4, 2018

@simonjayhawkins simonjayhawkins changed the title TST: add test for GH6131 TST: add test to io/formats/test_to_html.py to close GH6131 Sep 5, 2018
@gfyoung gfyoung added Testing pandas testing functions or related to the test suite Output-Formatting __repr__ of pandas objects, to_string IO HTML read_html, to_html, Styler.apply, Styler.applymap labels Sep 5, 2018
@gfyoung
Copy link
Member

gfyoung commented Sep 5, 2018

@simonjayhawkins : Thanks for this! Could you rebase onto master ?

@pep8speaks
Copy link

Hello @simonjayhawkins! Thanks for updating the PR.

@codecov
Copy link

codecov bot commented Sep 5, 2018

Codecov Report

Merging #22588 into master will increase coverage by 0.01%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #22588      +/-   ##
==========================================
+ Coverage   92.16%   92.17%   +0.01%     
==========================================
  Files         169      169              
  Lines       50708    50708              
==========================================
+ Hits        46734    46740       +6     
+ Misses       3974     3968       -6
Flag Coverage Δ
#multiple 90.58% <ø> (+0.01%) ⬆️
#single 42.35% <ø> (ø) ⬆️
Impacted Files Coverage Δ
pandas/io/formats/html.py 90.68% <0%> (+1.86%) ⬆️

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 996f361...c12f547. Read the comment docs.

@simonjayhawkins
Copy link
Member Author

@gfyoung

The rebase failed the CI checks again. I'll wait until #22597 is merged into master before trying again.

{'a': 'ab', 'b': 'bb', 'c': 'cc', 'd': 2},
{'a': 'ac', 'b': 'bc', 'c': 'cc', 'd': 3}
])
result = df.pivot_table(
Copy link
Member

Choose a reason for hiding this comment

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

Rather than creating df and then pivoting can you simplify and just create the desired frame (i.e. the result of the pivot)?

@@ -1844,6 +1844,64 @@ def test_to_html_no_index_max_rows(self):
</table>""")
assert result == expected

def test_to_html_pivot_table_max_cols(self):
# GH https://github.com/pandas-dev/pandas/issues/6131
Copy link
Member

Choose a reason for hiding this comment

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

Minor nit but don't need full link - can just do # GH 6131

@jreback jreback added this to the 0.24.0 milestone Sep 7, 2018
@simonjayhawkins
Copy link
Member Author

@WillAyd i made a couple of additional changes to your request in the latest commit which on hindsight may not have been such a good idea. i changed the name of the test since it no longer includes a pivot table command and secondly i took the opportunity of fixing a typo in the original problem description and so now the test does not faithfully recreate the original issue. will be happy to amend as necessary.

Copy link
Member

@WillAyd WillAyd left a comment

Choose a reason for hiding this comment

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

Thanks this lgtm - @mroeschke what do you think?

Copy link
Member

@mroeschke mroeschke left a comment

Choose a reason for hiding this comment

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

LGTM as well

@jreback jreback merged commit 0976e12 into pandas-dev:master Sep 9, 2018
@jreback
Copy link
Contributor

jreback commented Sep 9, 2018

thanks @simonjayhawkins

@simonjayhawkins simonjayhawkins deleted the issue6131 branch September 9, 2018 18:39
aeltanawy pushed a commit to aeltanawy/pandas that referenced this pull request Sep 20, 2018
Sup3rGeo pushed a commit to Sup3rGeo/pandas that referenced this pull request Oct 1, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
IO HTML read_html, to_html, Styler.apply, Styler.applymap Output-Formatting __repr__ of pandas objects, to_string Testing pandas testing functions or related to the test suite
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Missing ellipsis cells in pivot_table.to_html when limited by max_cols and len(rows) > 1
6 participants