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

BUG: boolean/string in OdsWriter #54994

Closed
3 tasks done
dimastbk opened this issue Sep 4, 2023 · 0 comments · Fixed by #54996
Closed
3 tasks done

BUG: boolean/string in OdsWriter #54994

dimastbk opened this issue Sep 4, 2023 · 0 comments · Fixed by #54996
Labels
Bug IO Excel read_excel, to_excel
Milestone

Comments

@dimastbk
Copy link
Contributor

dimastbk commented Sep 4, 2023

Pandas version checks

  • I have checked that this issue has not already been reported.

  • I have confirmed this bug exists on the latest version of pandas.

  • I have confirmed this bug exists on the main branch of pandas.

Reproducible Example

import pandas as pd
pd.DataFrame([[True, "string", 1, 1.0]]).to_excel("output.ods")

Issue Description

OdsWriter doesn't follow specification when writing boolean/string value (passing those values in office:value attribute of table-cell). Below screenshot from content.xml and LibreOffice, which can't represent bad boolean.

image

Expected Behavior

Boolean value in office:value-boolean and string value in office:string-value attributes.

image

Installed Versions

INSTALLED VERSIONS

commit : 6980379c251716a14f990c7c1b935822a1a6165b
python : 3.10.12.final.0
python-bits : 64
OS : Linux
OS-release : 6.2.0-31-generic
Version : #31~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Wed Aug 16 13:45:26 UTC 2
machine : x86_64
processor : x86_64
byteorder : little
LC_ALL : None
LANG : en_US.UTF-8
LOCALE : en_US.UTF-8

pandas : 2.1.1+0.g6980379c25.dirty
numpy : 1.24.4
pytz : 2023.3
dateutil : 2.8.2
setuptools : 59.6.0
pip : 23.2.1
Cython : 0.29.33
pytest : 7.4.1
hypothesis : 6.83.2
sphinx : 6.2.1
blosc : 1.11.1
feather : None
xlsxwriter : 3.1.2
lxml.etree : 4.9.3
html5lib : 1.1
pymysql : 1.4.6
psycopg2 : 2.9.7
jinja2 : 3.1.2
IPython : 8.15.0
pandas_datareader : None
bs4 : 4.12.2
bottleneck : 1.3.7
dataframe-api-compat: None
fastparquet : 2023.8.0
fsspec : 2023.9.0
gcsfs : 2023.9.0
matplotlib : 3.7.2
numba : 0.57.1
numexpr : 2.8.5
odfpy : None
openpyxl : 3.1.2
pandas_gbq : None
pyarrow : 13.0.0
pyreadstat : 1.2.3
pyxlsb : 1.0.10
s3fs : 2023.9.0
scipy : 1.11.2
sqlalchemy : 2.0.20
tables : 3.8.0
tabulate : 0.9.0
xarray : 2023.8.0
xlrd : 2.0.1
zstandard : 0.21.0
tzdata : 2023.3
qtpy : None
pyqt5 : None

@dimastbk dimastbk added Bug Needs Triage Issue that has not been reviewed by a pandas team member labels Sep 4, 2023
dimastbk added a commit to dimastbk/pandas that referenced this issue Sep 4, 2023
dimastbk added a commit to dimastbk/pandas that referenced this issue Sep 6, 2023
dimastbk added a commit to dimastbk/pandas that referenced this issue Sep 7, 2023
@rhshadrach rhshadrach added IO Excel read_excel, to_excel and removed Needs Triage Issue that has not been reviewed by a pandas team member labels Sep 12, 2023
@rhshadrach rhshadrach added this to the 2.2 milestone Sep 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug IO Excel read_excel, to_excel
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants