You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Dec 29, 2022. It is now read-only.
Repository navigation
This repository was archived by the owner on Dec 29, 2022. It is now read-only.
The DeleteRow function results in the deletion of every other row when iterating through a ListFeed in a spreadsheet using python gdata in New Google Spreadsheets #2
I am having a problem using the DeleteRow function in New Google Spreadsheets.
I have prepared a NEW google spreadsheet and entered multiple rows of data into the worksheet. For example, I put the following in column A, each on its own row: ID, 1,2,3,4,5,6,7,8,9,10,11,12
Then I perform deleterow() in a loop over a ListFeed as follows:
for row in listFeed.entry:
gd_client.DeleteRow(row)
The expected output would be for the rows except the header to be deleted. What I see is that rows 2,4,6,8,10 and 12 remain. If I run it again, rows 4,8,12 remain. It is deleting every other row.
I am using gdata 2.0.18 and new google spreadsheets
This approach continues to work the old google spreadsheets. It does not work with the new google spreadsheets.
It looks like the behavior or row IDs have changed in New Sheets, such that the IDs change when rows are deleted. Deleting row 1 causes row 2 to become row 1 and take on it's ID, and row 3 to take on row 2's ID, etc. This would lead to the behavior you are reporting, where only alternating rows are being deleted.
This is a bug with the Spreadsheets API and New Sheets, and should be reported here:
You can work around this issue by deleting rows in reverse order (from bottom to top). This is not something that can be fixed in the client library however, so this issue should be closed.
Activity
kjumpei commentedon Feb 5, 2015
Hi. Is this problem resolved,or not yet?
I have same issue and old spreadsheet is worked too.
ksiadmin commentedon Feb 5, 2015
Still not resolved
kjumpei commentedon Feb 6, 2015
thanks.
aliafshar commentedon Feb 10, 2015
Likely this is not a client library bug, sorry. If the only difference is New vs Old spreadsheets. @erickoledadevrel
erickoledadevrel commentedon Feb 13, 2015
It looks like the behavior or row IDs have changed in New Sheets, such that the IDs change when rows are deleted. Deleting row 1 causes row 2 to become row 1 and take on it's ID, and row 3 to take on row 2's ID, etc. This would lead to the behavior you are reporting, where only alternating rows are being deleted.
This is a bug with the Spreadsheets API and New Sheets, and should be reported here:
https://code.google.com/a/google.com/p/apps-api-issues/issues/list
You can work around this issue by deleting rows in reverse order (from bottom to top). This is not something that can be fixed in the client library however, so this issue should be closed.
ksiadmin commentedon Feb 13, 2015
Thank you, I can use that work around! And I posted this at https://code.google.com/a/google.com/p/apps-api-issues/issues/detail?id=3739
and this can be closed
kjumpei commentedon Feb 14, 2015
Than you @ksiadmin @aliafshar @erickoledadevrel :-)