Eddie Atkinson
09/09/2021, 5:57 AMStartFlowRun
support passing parameters as lists of dictionaries in Python? I am currently getting the following error when I try to do that:
prefect.exceptions.ClientError: 400 Client Error: Bad Request for url: <https://api.prefect.io/>
This is likely caused by a poorly formatted GraphQL query or mutation but the response could not be parsed for more details
I tried performing the same operation via the interactive graphql api and I needed to escape the {
and "
to get the query to work. Looking at the source it seems as though this doesn’t happen and might be the cause of my problem.Eddie Atkinson
09/09/2021, 6:55 AMKevin Kho
Eddie Atkinson
09/10/2021, 12:31 AMKevin Kho
Kevin Kho
from prefect import task, Flow, Parameter
import prefect
@task
def abc(x):
logger = prefect.context.get("logger")
<http://logger.info|logger.info>(x)
return x
with Flow(name="betfair_flow") as flow:
x = Parameter("x")
abc(x)
flow.register("dsdc")
from prefect.tasks.prefect import StartFlowRun
import json
test = [{'id': 123, 'data': 'qwerty', 'indices': [1,10]}, {'id': 345, 'data': 'mnbvc', 'indices': [2,11]}]
StartFlowRun(project_name="dsdc", flow_name="betfair_flow").run(parameters={"x": json.dumps(test)})
Eddie Atkinson
09/13/2021, 4:36 AMKarolína Bzdušek
09/14/2021, 1:47 PMKevin Kho