Skip to content
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

write_workbook errors with all integer table #227

Open
MarkPaulin opened this issue Aug 4, 2023 · 1 comment · Fixed by #231
Open

write_workbook errors with all integer table #227

MarkPaulin opened this issue Aug 4, 2023 · 1 comment · Fixed by #231
Assignees
Labels
bug 🐛 Something isn't working higher 🔴 investigate 🔍 Needs looking into M
Milestone

Comments

@MarkPaulin
Copy link

Describe the bug
write_workbook throws an error if a table has only integer columns.

To Reproduce
Steps to reproduce the behavior:

import gptables as gpt
import pandas as pd
df = pd.DataFrame({"a": [0], "b": [1]})
table = gpt.GPTable(df, table_name="table", title="numbers")
gpt.write_workbook(filename="example.xlsx", sheets={"table 1": table})

Expected behavior
write_workbook should work with tables that have all integer columns.

Additional context
The error comes from this line, which is checking if any cells contain only special characters. The way it works currently assumes gptable.table.stack() is a series of objects, but that isn't the case if all the columns are numeric.

I can submit a PR to bypass this check whenever gptable.table.stack() is a numeric type, if you think that's a suitable solution.

@rowanhemsi rowanhemsi added bug 🐛 Something isn't working investigate 🔍 Needs looking into labels Apr 23, 2024
@rowanhemsi rowanhemsi added this to the v1.2.0 milestone Apr 23, 2024
@rowanhemsi
Copy link
Collaborator

Thank you for flagging this Mark and sorry it has take so long for us to get back to you. We will take a look and try to get this fixed as soon as possible

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something isn't working higher 🔴 investigate 🔍 Needs looking into M
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants