BatchJobService raises INVALID_PREDICATE_ENUM_VALUE

18 views
Skip to first unread message

Павел Расчетнов

unread,
Dec 12, 2018, 9:30:35 AM12/12/18
to AdWords API and Google Ads API Forum
Hi! I want to get ids of BatchJobs that have status ACTIVE or  AWAITING_FILE. 


def get_active_jobs():
    batch_job_service = client.GetService('BatchJobService', version='v201809')
    
    selector = {
        'fields': ['Id', 'Status'],
        'predicates': {
                'field': 'Status',
                'operator': 'IN',
                'values': ['ACTIVE', 'AWAITING_FILE']
        }
    }
    return batch_job_service.get(selector)

it raises `GoogleAdsServerFault: [SelectorError.INVALID_PREDICATE_ENUM_VALUE @ selector; trigger:'AWAITING_FILE']`
Looks like some status values can't be used in where clause, but I couldn't find any hint in documentation.

Do I have to download all existing jobs and filter them locally?

Dhanya Sundararaju (AdWords API Team)

unread,
Dec 12, 2018, 3:15:05 PM12/12/18
to AdWords API and Google Ads API Forum
Hi there,

The Status field is not filterable as stated in this section of the guide. So, you will need to filter by Id and then check the status of each job.

Regards,
Dhanya, AdWords API Team
Reply all
Reply to author
Forward
0 new messages