kamawanu / googlecode-gdata-python-client

Automatically exported from code.google.com/p/gdata-python-client
1 stars 0 forks source link

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 #715

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Prepare two *NEW* google spreadsheets, “input".  Enter multiple rows of 
data into the worksheet.  For example, put the following in column A, each on 
its own row: ID, 1,2,3,4,5,6,7,8,9,10,11,12  
2. Perform deleterow() in a loop over a ListFeed

import gdata.spreadsheet.service   
import gdata.service

ss_key = “google spreadsheet key";

gd_client = gdata.spreadsheet.service.SpreadsheetsService();

...
gd_client.ProgrammaticLogin();

feed = gd_client.GetWorksheetsFeed(ss_key);
worksheetID = feed.entry[int(feed.total_results.text)-1].id.text.rsplit('/', 
1)[1] 
listFeed = gd_client.GetListFeed(ss_key,  worksheetID);

for row in listFeed.entry:
     gd_client.DeleteRow(row)

What is the expected output? What do you see instead?
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.

What version of the product are you using?
gdata 2.0.18 and new google spreadsheets

Please provide any additional information below.
This approach continues to work the old google spreadsheets.  It does not work 
with the new google spreadsheets.

Original issue reported on code.google.com by kirbysol...@gmail.com on 18 Jan 2015 at 1:18

GoogleCodeExporter commented 9 years ago
Please raise this here: https://github.com/google/gdata-python-client/issues/new

Original comment by afs...@google.com on 20 Jan 2015 at 7:45