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

Ghost rows and columns when using decorations (colors/borders) #24

Open
sirio81 opened this issue Oct 22, 2020 · 8 comments
Open

Ghost rows and columns when using decorations (colors/borders) #24

sirio81 opened this issue Oct 22, 2020 · 8 comments

Comments

@sirio81
Copy link

sirio81 commented Oct 22, 2020

import pyexcel_ods3
print(pyexcel_ods3.get_data('test.ods', keep_trailing_empty_cells=True))

test.ods contains a simple table

A1,B1
A2,B2

OrderedDict([('Sheet1', [['A1', 'B1'], ['A2', 'B2']])])

If add color to these 4 cells, the output of print is the same.
I add a color to the 3th row, I get a new "empty" row as output, an that's fine:
OrderedDict([('Sheet1', [['A1', 'B1'], ['A2', 'B2'], ['', ''], ['', '']])])

I remove the color from the 3th row by clicking to "No fill", I still get
OrderedDict([('Sheet1', [['A1', 'B1'], ['A2', 'B2'], ['', ''], ['', '']])])

I guess 'No fill' doesn't really remove the color info.
Removing the row by right click, does the job, no more empty row.
OrderedDict([('Sheet1', [['A1', 'B1'], ['A2', 'B2']])])

Now the more interesting part: click on column "A" (selection goes till the end of the sheet), add a color and print the table:
OrderedDict([('Sheet1', [['A1', 'B1'], ['A2', 'B2'], ['', ''], ['', '']])])

We get an extra empty row.
Now, if I remove the color form the whole column, I still get the empty row.
I shall remove column A to get rid of it but in such case I loose data.

OrderedDict([('Sheet1', [['B1'], ['B2']])])

Well, the issue is probably the same or very similar to the first case, bu in this case I have no way to work around it.
You get the very same issue if you add borders (or color) to cells C1, C2.
There are no values on these cells and you get
OrderedDict([('Sheet1', [['a1', 'b1', ''], ['a2', 'b2', '']])])
and this is fine.

Removing borders or colors is not going to remove the empty column, you have to right click and delete the column.

If select the whole rows 1 and 2, add color, the remove it, you can't get rid of the "empty" column (right click / delete on column "C" is not going to help).
OrderedDict([('Sheet1', [['a1', 'b1', ''], ['a2', 'b2', '']])])

So I think pyexcel3 shall handle cell where decorations have been totally remove and shall ignore decorations of whole rows or columns.

@chfw
Copy link
Member

chfw commented Oct 22, 2020

Interesting! Do you have the test fixtures already? They can be used to “train” my unit tests.

@sirio81
Copy link
Author

sirio81 commented Dec 16, 2020

Hi, by 'test fixtures', do you mean a file that cause the issue?

@chfw
Copy link
Member

chfw commented Dec 16, 2020

please help provide me a sample file to reproduce the bug?

@sirio81
Copy link
Author

sirio81 commented Dec 16, 2020

Here is the first case (color removed from line 3)
https://we.tl/t-rXwXho8309

@sirio81
Copy link
Author

sirio81 commented Dec 16, 2020

And this the case where I selected whole columns A and B, removed the color to the columns and add it only to the 4 cells with content.
In such case, removing row 3 doesn't fix the issue.

https://we.tl/t-KS2AHtr6SU

@sirio81
Copy link
Author

sirio81 commented Apr 13, 2021

Hi, any news about this issue?

@sirio81
Copy link
Author

sirio81 commented Apr 19, 2021

I opened the xml of a file that alway shows 2 empty rows and used xmlstarlet to pretty print it.
This is the part of xml code that I guess is causing the issue:
<table:table-row table:style-name="ro1" table:number-rows-repeated="1048565"> <table:table-cell table:number-columns-repeated="1016"/> </table:table-row> <table:table-row table:style-name="ro1"> <table:table-cell table:number-columns-repeated="1016"/> </table:table-row>
Hope this helps.

@sirio81
Copy link
Author

sirio81 commented Feb 23, 2022

Am I the only one noticing this issue?

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

No branches or pull requests

2 participants