TypeError: Parameter to MergeFrom() must be instance of same class

909 views
Skip to first unread message

Rohini Mishra

unread,
Feb 10, 2023, 3:51:08 AM2/10/23
to Google Ads API and AdWords API Forum
hello google team,


we are getting this error :
--------------------------------------------------------------------------- TypeError Traceback (most recent call last) Cell In[49], line 2 1 geo_target.geo_target_constant = "geoTargetConstants/5" ----> 2 keyword_plan_campaign.geo_targets.append(geo_target) TypeError: Parameter to MergeFrom() must be instance of same class: expected google.ads.googleads.v12.resources.KeywordPlanGeoTarget got KeywordPlanGeoTarget.

python version : Python 3.10.6
type(keyword_plan_campaign) : 
google.ads.googleads.v12.resources.types.keyword_plan_campaign.KeywordPlanCampaign
type(geo_target)
google.ads.googleads.v12.resources.types.keyword_plan_campaign.KeywordPlanGeoTarget
Message has been deleted

Google Ads API and AdWords API Forum

unread,
Feb 10, 2023, 1:25:34 PM2/10/23
to Google Ads API and AdWords API Forum
Re-posting the last inquiry (https://groups.google.com/g/adwords-api/c/BSDirrUzUco) from the forum as it wasn't routed to our support queue.

Regards,
Carmela
Google Ads API Team

Google Ads API and AdWords API Forum

unread,
Feb 10, 2023, 1:32:31 PM2/10/23
to Google Ads API and AdWords API Forum
Hi,

We are glad to assist you. With regards to concern, can you please provide us with the complete request and response logs with request ID, so that our team can better check and can provide the right recommendation or solution?

Note that the logs can be requested or provided to the developer handling the Google Ads API transactions when logging of the API requests has been enabled. You may check here for the Python client library.

You may then send the requested logs via the Reply privately to author option. If this option is not available, you may send the details directly to our googleadsa...@google.com alias instead.

Regards,
Carmela
Google Ads API Team
On Friday, February 10, 2023 at 4:51:08 PM UTC+8 rohini...@collegedunia.com wrote:
Message has been deleted

Google Ads API Forum Advisor

unread,
Feb 21, 2023, 2:10:26 PM2/21/23
to adwor...@googlegroups.com

Hi, 

This is Marjorie from the Google Ads API team as well. Thank you for getting back to us.

Thank you for providing complete logs where the error message shown. Moving forward to your concern, it appears that the issue is more on implementation/integration of our client libraries rather than anything specific to Google Ads API itself. Since this is more of an implementation/integration specific issue, then we would recommend reaching out to the developer who maintains our client libraries (Python) here.

In line with this matter, I had to delete your initial post in our forum thread due to the sensitive information contained. 

Have a great day.

Regards,

Google Logo
Marjorie
Google Ads API Team
 


ref:_00D1U1174p._5004Q2jEzsh:ref
Reply all
Reply to author
Forward
0 new messages