googleads / googleads/google-ads-ruby

Google::Ads::GoogleAds::GoogleAdsClient#service.feed_item.mutate_feed_items returns error for unused field FIELD_CANNOT_BE_CLEARED

Open
#181 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug difficulty: medium
Dominant language
Ruby
Stars
83
Forks
72
Avg merge
16m
Merged PRs (30d)
1

Description

Hi,

Now I try to rewrite my API call to feed and feed_item operation from Adwords API to Google Ads API.
I have a problem when I call mutate_feed_items for DYNAMIC_CUSTOM feed, and it seems to be a bug.

My code like the following, ...

# client = Google::Ads::Googleds::GoogleAdsClient instance
# original_feed_item = generate via client.resource.feed_item, attributes from API query result.

operations = []

operation = client.operation.update_resource.feed_item(original_feed_item) do |modify_feed_item|
  ...
  # set values to update
end

if !opearation.update_mask.empty?
  operations << operation
end

if !operations.empty?
  client.service.feed_item.mutate_feed_items(MY_CUSTOMER_ID, operations)
end

then it raise error Google::Gax::InvalidArgumentError, and logged.

I, [2019-08-07T14:47:16.960735 #76554]  INFO -- : Incoming response (errors):
Error 1: {"errorCode":{"fieldError":"FIELD_CANNOT_BE_CLEARED"},"message":"The field cannot be cleared.","location":{"fieldPathElements":[{"fieldName":"operations","index":},{"fieldName":"update"},{"fieldName":"attribute_values"},{"fieldName":"boolean_value"}]}}
...

feed_item for DYNAMIC_CUSTOM has no field of type boolean, so it seems to be a bug.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the mutate_feed_items call and the update_mask handling shown in the issue, then trace how attribute_values and boolean_value are generated for a DYNAMIC_CUSTOM feed item. Reproduce the FIELD_CANNOT_BE_CLEARED response and confirm that an update containing only applicable fields completes without that error.

Written by the indexing model from the issue text.

Assessment

Tech stack
ruby
Domain
api
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.