google-ads-python: ExceptionHandling Error
When producing an exception in the Query, the exception isn’t handled correctly
SELECT
campaign.id, campaign.status,campaign.advertising_channel_type,ad_group.id, ad_group.status,search_term_view.search_term,search_term_view.status,
segments.date,
segments.device,
segments.search_term_match_type,
metrics.impressions,
metrics.clicks,
metrics.cost_micros,
metrics.conversions,
metrics.conversions_value
FROM
search_term_view
WHERE
metrics.impressions > None
AND segments.date BETWEEN '2019-10-05' AND '2020-01-02'
LIMIT 10000
Error above is metrics.impressions > None
Produces the following
google_ads_failure = self._get_google_ads_failure(trailing_metadata)
File "/venv/lib/python3.7/site-packages/google/ads/google_ads/interceptors/exception_interceptor.py",
line 68, in _get_google_ads_failure
ga_failure = error_protos.errors_pb2.GoogleAdsFailure()
AttributeError: module 'google.ads.google_ads.v2.proto.errors' has no attribute 'errors_pb2'
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 1
- Comments: 18 (5 by maintainers)
It is about error handling in general,
exception_interceptorfails to load theerrors_pb2module and it throws this exception no matter what the internal error wasIt will be addressed in the near future, likely before the next major Google Ads API release.