Skip to content

TST: Tests and fix for unhandled data types in Excel writers. #5122

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 1 commit into from
Oct 14, 2013
Merged

TST: Tests and fix for unhandled data types in Excel writers. #5122

merged 1 commit into from
Oct 14, 2013

Conversation

jmcnamara
Copy link
Contributor

Added tests and a fix for unhandled numpy data types in the
Excel writers. Issue #3122.

@jmcnamara
Copy link
Contributor Author

Some background to this PR:

  1. The original issue ExcelWriter fails with columns with int32 dtype #3122 is due to the fact that xlwt whitelists the types that it handles and raises an exception for unhandled types. The fact that certain numpy types aren't identified correctly may be a numpy bug but their devs have rejected that as an issue.
  2. The pandas/io/excel.py module contains a _conv_value() method to map pandas/numpy types to types handled by xlwt/openpyxl.
  3. This PR extends/strengthens the _conv_value() function to handle more generic types.
  4. This PR adds more extensive, although non-exhaustive, tests for numpy data types.
  5. XlwsWriter doesn't require the _conv_value() method since it has its own type conversion methods. So I've removed that from the xlsxwriter engine.

Added tests and a fix for unhandled numpy data types in the
Excel writers. Issue #3122.
@jreback
Copy link
Contributor

jreback commented Oct 7, 2013

@jtratner ?

@jtratner
Copy link
Contributor

jtratner commented Oct 8, 2013

Going to take a look tonight or tomorrow.
On Oct 7, 2013 7:36 PM, "jreback" [email protected] wrote:

@jtratner https://github.com/jtratner ?


Reply to this email directly or view it on GitHubhttps://github.com//pull/5122#issuecomment-25854366
.

@jreback
Copy link
Contributor

jreback commented Oct 14, 2013

@jtratner this ok for merging?

@jtratner
Copy link
Contributor

Looks good.

jtratner added a commit that referenced this pull request Oct 14, 2013
TST: Tests and fix for unhandled data types in Excel writers.
@jtratner jtratner merged commit 4559e32 into pandas-dev:master Oct 14, 2013
@jtratner
Copy link
Contributor

Thanks for fixing this!

@jtratner
Copy link
Contributor

And 👍 for not doing _conv_value where it's not needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants