Eric Feldman
10/31/2021, 2:57 PMpd.DataFrame
to a task, but it failed when querying GraphQL since pd.DataFrame
isn’t json serializable
~/Library/Caches/pypoetry/virtualenvs/recipe-t7nMXg6Y-py3.8/lib/python3.8/site-packages/prefect/client/client.py in graphql(self, query, raise_on_error, headers, variables, token, retry_on_api_error)
550 server=self.api_server,
551 headers=headers,
--> 552 params=dict(query=parse_graphql(query), variables=json.dumps(variables)),
553 token=token,
554 retry_on_api_error=retry_on_api_error,
I can pass df.dict()
and deserialize it, but I rather notAnna Geller
Eric Feldman
10/31/2021, 3:28 PMflow_run_id = client.create_flow_run(flow_id, parameters={'data': pd.DataFrame({'n': [1,2,3]})})
Kevin Kho
create_flow_run
is an API call under the hood and you can’t pass pd.DataFrames through API calls in general as they rely on JSON for the payload.