beti98 / google-api-python-client

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

Calling BatchHttpRequest.add() as shown in examples generates warning output on console. positional decorator incorrect? #233

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?

Use batched HTTP Requests as shown in this example code:

  batch = BatchHttpRequest()
  batch.add(service.animals().list(), list_animals)
  batch.add(service.farmers().list(), list_farmers)
  batch.execute(http=http)

Ref: https://developers.google.com/api-client-library/python/guide/batch

What is the expected output? What do you see instead?

No output expected; rather, I see this on the console:

  oauth2client/util.py/util.py:117:positional_wrapper(): add() takes at most 2 positional arguments (3 given)

What version of the product are you using? On what operating system?
  google-api-python-client==1.0

Please provide any additional information below.

The batch operations succeed, so it appears that there's something wrong with 
the declaration of BatchHttpRequest.add().

If you invoke .add() with 'callback=' keyword argument, the message does not 
appear.

  batch.add(service.farmers().list(), callback=list_farmers)

Original issue reported on code.google.com by inactiv...@gmail.com on 27 Jan 2013 at 5:00

GoogleCodeExporter commented 8 years ago
Environmental info: Python 2.7.3, Ubuntu 12.04 x64

Original comment by inactiv...@gmail.com on 27 Jan 2013 at 5:08

GoogleCodeExporter commented 8 years ago
Thanks, I'll update the docs.

Original comment by jcgregorio@google.com on 8 Feb 2013 at 3:58

GoogleCodeExporter commented 8 years ago
Docs updated.

Thanks again.

Original comment by jcgregorio@google.com on 8 Feb 2013 at 4:38