Is there a new thing in prefect 2.0 where you can'...
# prefect-community
s
Is there a new thing in prefect 2.0 where you can't return Google BigQuery Clients within a task? I know you can in Prefect 1.0 I've tried different task runners for 2.0 and they all fail
Copy code
@task
def get_client(gcloud_auth):
    try:
        service_account_info = json.loads(gcloud_auth)
    except:
        service_account_info = json.loads(eval(gcloud_auth), strict=False)
    creds = service_account.Credentials.from_service_account_info(
                service_account_info
            )
    client = bigquery.Client(credentials=creds)
    return client
Copy code
PicklingError: Pickling client objects is explicitly not supported.
Clients have non-trivial state that is local and unpickleable.
a
Hey @Sam Garvis! Results from tasks in Prefect 2.0 need to be pickleable. The GCP clients generally aren’t pickleable, which is why you’re seeing this error. Also, we have some integrations with BigQuery in our prefect-gcp collection that might be able to help you with what you’re trying to accomplish.
🎉 1