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

Examples not working and suds resolver errors #41

Closed
smartermarketing opened this issue Nov 14, 2014 · 7 comments
Closed

Examples not working and suds resolver errors #41

smartermarketing opened this issue Nov 14, 2014 · 7 comments

Comments

@smartermarketing
Copy link

This is a reopening of #35 so refer to that issue for details

Running this on Ubuntu 12.04

@msaniscalchi I've set this up in a new virtualenv with only googleads + dependencies installed and the problem persists. You should be able to reproduce the error like this:

virtualenv gads;cd gads;source ./bin/activate
pip install googleads
wget https://github.com/googleads/googleads-python-lib/archive/master.zip
unzip master.zip
python googleads-python-lib-master/examples/adwords/v201409/optimization/estimate_keyword_traffic.py 

...

No handlers could be found for logger "suds.resolver"
Traceback (most recent call last):
  File "googleads-python-lib-master/examples/adwords/v201409/optimization/estimate_keyword_traffic.py", line 122, in <module>
main(adwords_client)
  File "googleads-python-lib-master/examples/adwords/v201409/optimization/estimate_keyword_traffic.py", line 101, in main
mean_avg_cpc = (long(estimate['min']['averageCpc']['microAmount']) +
  File "/home/vagrant/gads/local/lib/python2.7/site-packages/suds/sudsobject.py", line 154, in __getitem__
    return getattr(self, name)
AttributeError: 'StatsEstimate' object has no attribute 'averageCpc'

For good measure, here's the result when you add a logger for suds as well:
https://www.dropbox.com/s/oib6a6arg8ian1j/Screenshot%202014-11-14%2020.40.36.png?dl=0

@msaniscalchi
Copy link
Contributor

I've not been able to reproduce on a fresh Debian 7.2 VM or a non-fresh Ubuntu 12.04 machine. I'll see if I can try this out on a fresh Ubuntu 12.04 VM next.

Out of curiosity, have you tried doing anything else with the affected VM? I'd be very interested in knowing if this affects more than just this example.

@msaniscalchi
Copy link
Contributor

Also not reproducible on a fresh 12.04 VM. Odd.

One thing that comes to mind is that maybe you somehow installed a different version of suds. What version are you using?

@parander
Copy link

I can reproduce this issue as well. Tried 3 different versions of suds-jurko: 0.5, 0.6, 0.7 (dev. version) and i got the same result with all of them.

I'm using Ubuntu 14.04 VM (vagrant ubuntu/trusty64)

@msaniscalchi
Copy link
Contributor

I believe I've discovered the cause. The StatsEstimate won't include the averageCpc, averagePosition and clickThroughRate fields if clicksPerDay or impressionsPerDay are 0 as of v201406. It seems this sample wasn't adequately updated to handle the change, and it couldn't be reproduced earlier because the test account always provided a clicksPerDay and impressionsPerDay > 0.

Thanks for reporting! I'll add a fix for this in the next release and close this once available.

@schmilblick
Copy link

@msaniscalchi Cool, please note that there is an additional error in the screenshot provided. And that @parander also gets that error.

@parander
Copy link

Yes besides the averageCpc missing the logger reports plenty of these, which i assume is unrelated to the averageCpc thing:

suds.resolver [resolver.py:134] [ERROR] [root] (Money) not-found
suds.resolver [resolver.py:116] [ERROR] [find] path: "Money", not-found
suds.resolver [resolver.py:134] [ERROR] [root] (Keyword) not-found
suds.resolver [resolver.py:116] [ERROR] [find] path: "Keyword", not-found
....... repeated many times....
suds.resolver [resolver.py:134] [ERROR] [root] (Keyword) not-found
suds.resolver [resolver.py:116] [ERROR] [find] path: "Keyword", not-found

@parander
Copy link

suds.resolver [resolver.py:134] [ERROR] root not-found
suds.resolver [resolver.py:116] [ERROR] [find] path: "Money", not-found
suds.resolver [resolver.py:134] [ERROR] root not-found
suds.resolver [resolver.py:116] [ERROR] [find] path: "Keyword", not-found
... This still occurs (as of 2.3.0).

Add:
import logging
logging.basicConfig()

To the example to reproduce.

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

4 participants