KeyError: 'locationFilters' in JobQuery message with Google Cloud Talent Solution API

53 Views Asked by At

I'm using the Google Cloud Talent Solution API to perform job searches with location-based filtering. However, I'm encountering a KeyError related to the 'locationFilters' field in the JobQuery message, which is causing the job search to fail.

I have checked the documentation and release notes of the Google Cloud Talent Solution API, but I couldn't find any information about changes to the usage of the 'locationFilters' field.

I have also updated the 'google-cloud-talent' Python package to the latest version, but the issue persists. Could anyone provide guidance on how to properly filter job searches by location using the current version of the Google Cloud Talent Solution API? Below is the relevant code section Any help or insights would be greatly appreciated. Thank you!

def perform_job_search(resume_data, user_city):
    try:
        # Construct query string from resume data
        query_string = construct_query_string(resume_data)

        job_query = {
            'query': query_string,
            'locationFilters': [
                {
                    'address': user_city
                }
            ]
        }
0

There are 0 best solutions below