google-ads-python icon indicating copy to clipboard operation
google-ads-python copied to clipboard

Hugh performance difference when calling RecommendationServiceClient.apply_recommendation with request vs with customer_id and operations

Open puerile22 opened this issue 3 years ago • 0 comments

When I tried to apply recommendations by using ApplyRecommendationRequest, it takes around 5 minutes to make 100 operations, but if I do it with something like this:

recommendation_response = recommendation_service.apply_recommendation(
        customer_id=customer_id, operations=operations
)

It usually finishes within seconds, the operations list also contains 100 apply recommendation operations.

This is how I build and apply the apply recommendation request:

request = client.get_type('ApplyRecommendationRequest')
request.customer_id = customer_id
request.partial_failure = True
request.operations = operations

recommendation_response = recommendation_service.apply_recommendation(
        request=request
)

Is it because of the partial_failure flag? Why is there a huge performance difference between these 2 approaches? Also when I use ApplyRecommendationRequest approach, I usually get a bunch of errors like Authorization of the client failed.

I'm using the latest version of this library.

Any help would be much appreciated Thank you.

puerile22 avatar Oct 06 '22 21:10 puerile22