Skip to content

Inclusion of new NAMED_COLORS for MS Excel #18392

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 2 commits into from
Jan 24, 2018
Merged

Conversation

jfrfonseca
Copy link
Contributor

  • closes #xxxx
  • tests added / passed
  • passes git diff upstream/master -u -- "*.py" | flake8 --diff
  • whatsnew entry

@gfyoung gfyoung added IO Excel read_excel, to_excel Enhancement labels Nov 20, 2017
@gfyoung
Copy link
Member

gfyoung commented Nov 20, 2017

@jfrfonseca : Thanks for this PR! Quick question: do you know if we test that colors array in our Excel tests? If not, this might be a good time to write one to make sure we got those colors covered.

@codecov
Copy link

codecov bot commented Nov 21, 2017

Codecov Report

Merging #18392 into master will increase coverage by <.01%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #18392      +/-   ##
==========================================
+ Coverage   91.57%   91.57%   +<.01%     
==========================================
  Files         150      150              
  Lines       48702    48702              
==========================================
+ Hits        44597    44599       +2     
+ Misses       4105     4103       -2
Flag Coverage Δ
#multiple 89.94% <ø> (ø) ⬆️
#single 41.71% <ø> (ø) ⬆️
Impacted Files Coverage Δ
pandas/io/formats/excel.py 97.36% <ø> (+0.65%) ⬆️

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 2952fbd...3b161c5. Read the comment docs.

@jreback
Copy link
Contributor

jreback commented Jan 21, 2018

@gfyoung can you push a test for this

@jreback jreback added this to the 0.23.0 milestone Jan 21, 2018
@gfyoung gfyoung force-pushed the master branch 3 times, most recently from 3b9dd73 to 9f07018 Compare January 22, 2018 02:31
@gfyoung
Copy link
Member

gfyoung commented Jan 22, 2018

@jreback : Tests have been added, and all is green. PTAL.


expected["fill"]["fgColor"] = output_color

if input_color in (None, "not-a-color"):
Copy link
Contributor

Choose a reason for hiding this comment

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

can you separate this into 2 tests rather than do the if (IOW good colors) and bad colors (which show a warning?)

Copy link
Member

Choose a reason for hiding this comment

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

Done.

jfrfonseca and others added 2 commits January 22, 2018 09:07
included 'brown' (#A52A2A), 'pink' ('FFC0CB') and 'grey', US-standard spelling of the word 'gray'
@gfyoung
Copy link
Member

gfyoung commented Jan 23, 2018

@jreback : Change made, and all is green. PTAL.

}

with catch_warnings(record=True):
convert = CSSToExcelConverter()
Copy link
Contributor

Choose a reason for hiding this comment

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

so these don't actually raise? rather just show a warning? ok I guess

}

with catch_warnings(record=True):
convert = CSSToExcelConverter()
Copy link
Contributor

Choose a reason for hiding this comment

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

so these don't actually raise? rather just show a warning? ok I guess

Copy link
Contributor

Choose a reason for hiding this comment

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

so we aren't actually testing anything then?

Copy link
Contributor

Choose a reason for hiding this comment

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

note - I don't think they should raise as that puts a burden back on us. is it possible to check the warnings message? (note don't spend too much time on this, if its easy do it).

Copy link
Member

Choose a reason for hiding this comment

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

@jreback : When I call convert with an invalid color in my test case, it issues CSSWarning in 5 - 6 different places because of the invalid color (at least when I introspect with tm.assert_produces_warning).

@jreback jreback merged commit 7202635 into pandas-dev:master Jan 24, 2018
@jreback
Copy link
Contributor

jreback commented Jan 24, 2018

thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement IO Excel read_excel, to_excel
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants