Everyone is experiecing an issue with this batch job service. and we are 
waiting for Google to confirm this!

Le mercredi 11 mai 2022 à 12:06:23 UTC+2, Kubber a écrit :

> I'm trying to remove CampaignCriterionOperation using BatchJobService.
>
> It used to work quite quick until last Thursday, but now it's very slow it 
> can take 30 minutes before it's done, and the amount of data is the very 
> same. 
> I see the same issue on uploading CampaignCriteria. 
>
> How long should it take to delete let's say 20000 criteria?
>  
> I'm using code more less like this: 
>
>
> batch_job_service = client.get_service("BatchJobService")
> batch_job_operation = client.get_type("BatchJobOperation")
>
> batch_job = client.get_type("BatchJob")
> client.copy_from(batch_job_operation.create, batch_job)                
> response = batch_job_service.mutate_batch_job(
>                     customer_id=customer_id, operation=batch_job_operation
>                 )
> resource_name = response.result.resource_name
>
> operations = []
> for cbm in chunk:
>     campaign_criterion_operation = 
> client.get_type("CampaignCriterionOperation")
>     campaign_id = cbm.split(',')[0]
>     criterion_id = cbm.split(',')[1]
>     campaign_criterion_operation.remove = 
> f"customers/{customer_id}/campaignCriteria/{campaign_id}~{criterion_id}"
>     mutate_operation = client.get_type("MutateOperation")
>     client.copy_from(getattr(mutate_operation, 
> "campaign_criterion_operation"), campaign_criterion_operation)
>     operations.append(mutate_operation)
>
> batch_job_service.add_batch_job_operations(
>     resource_name=resource_name,
>     mutate_operations=operations,
> )
> response = batch_job_service.run_batch_job(resource_name=resource_name)
>                 
>
> for i in range(1, 20):
>     time.sleep(10*i)
>     if response.done():
>        ...
>
> Cheers,
> Jakub
>

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog:
https://googleadsdeveloper.blogspot.com/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API and Google Ads API Forum" group.
To post to this group, send email to adwords-api@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Google Ads API and AdWords API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to adwords-api+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/572e493b-66e1-4b96-9169-cc4c3e5eb81en%40googlegroups.com.

Reply via email to