carolinux / gdata-python-client

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

Cannot insert into a spreadsheet if column title contains a space. #592

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create a spreadsheet
2. Make on column have a space in it e.g. 'Test Suite'
3. Try to use InsertRow API to insert a new row which has a value for Test 
Suite.

What is the expected output? What do you see instead?
The row should be added

What version of the product are you using?
2.0.16

Please provide any additional information below.

Code like this...

    myDict = {'Test Suite': 'MyTestSuite', 'test':'mytest', 'failure':'myfailure', 'project':''}
    entry = gd_client.InsertRow(myDict, spreadSheetKey, workSheetKey)

will give you a stacktrace like this...

Traceback (most recent call last):
  File "C:\tools\ides\eclipse\indigo32bit\plugins\org.python.pydev.debug_2.4.0.2012020116\pysrc\pydevd.py", line 1307, in <module>
    debugger.run(setup['file'], None, None)
  File "C:\tools\ides\eclipse\indigo32bit\plugins\org.python.pydev.debug_2.4.0.2012020116\pysrc\pydevd.py", line 1060, in run
    pydev_imports.execfile(file, globals, locals) #execute the script
  File "C:\Users\Alex\workspaces\pythonWS\PythonProj1\src\run_nightlies.py", line 547, in <module>
    main()
  File "C:\Users\Alex\workspaces\pythonWS\PythonProj1\src\run_nightlies.py", line 87, in main
    do_nightlies();
  File "C:\Users\Alex\workspaces\pythonWS\PythonProj1\src\run_nightlies.py", line 171, in do_nightlies
    add_new_failures_to_spreasheet(newFailures);
  File "C:\Users\Alex\workspaces\pythonWS\PythonProj1\src\run_nightlies.py", line 543, in add_new_failures_to_spreasheet
    entry = gd_client.InsertRow(myDict, spreadSheetKey, workSheetKey)
  File "C:\Python27\lib\site-packages\gdata\spreadsheet\service.py", line 339, in InsertRow
    converter=gdata.spreadsheet.SpreadsheetsListFromString)
  File "C:\Python27\lib\site-packages\gdata\service.py", line 1236, in Post
    media_source=media_source, converter=converter)
  File "C:\Python27\lib\site-packages\gdata\service.py", line 1358, in PostOrPut
    'reason': server_response.reason, 'body': result_body}
gdata.service.RequestError: {'status': 400, 'body': 'Attribute name 
&quot;Suite&quot; associated with an element type &quot;ns1:Test&quot; must be 
followed by the &#39; = &#39; character.', 'reason': 'Bad Request'}

Original issue reported on code.google.com by bre...@gmail.com on 5 Feb 2012 at 9:34

GoogleCodeExporter commented 9 years ago
Sorry bad name for title.  Should be:  Cannot insert into a spreadsheet if 
column title contains a space.

Original comment by bre...@gmail.com on 5 Feb 2012 at 9:35

GoogleCodeExporter commented 9 years ago
I updated the title.

Original comment by afs...@google.com on 13 Feb 2012 at 3:38

GoogleCodeExporter commented 9 years ago
Hey did anyone has any resolution for this ? I am facing the same issue using 
java client API ? Help me if anyone has any pointers for this.

Original comment by gsa...@google.com on 12 Jun 2012 at 5:03

GoogleCodeExporter commented 9 years ago
it seems that upper case letters cause the same issue

Original comment by gi...@eventbrite.com on 15 Aug 2012 at 11:17

GoogleCodeExporter commented 9 years ago
i encountered the same issue..
even after using lowercase letters for column names i couldn't insert the row 
if any column had a space in column name like 'mobile no.'

changing 'mobile no.' to 'mobile_no.' didn't work too :(
row got inserted but the data for the column didn't!

eagerly waiting for a fix!

Original comment by dhirajk...@gmail.com on 24 Dec 2012 at 10:29

GoogleCodeExporter commented 9 years ago
any updates ?

Original comment by pallavi....@paxcel.net on 2 Jul 2013 at 12:58

GoogleCodeExporter commented 9 years ago
Hi everyone, i've encountered a problem trying to submit data to my spreadsheet 
from app engine. It works well on my development server, but google app engine 
gives a server 500 error. 

Original comment by eng.mesembe on 23 Aug 2013 at 6:01

GoogleCodeExporter commented 9 years ago
the api auto convert your header into "lowercase-and-no-space-header", so, in 
your API, you just need "testsuite" to access the column named "Test Suite" 
without any change to the spreadsheet itself! (by following this link: 
http://stackoverflow.com/a/11605522/3161505). I tested in java version of gdata

Original comment by tntuan07...@gmail.com on 2 Jun 2014 at 3:11