Trevor Kramer
07/27/2021, 5:41 PMUnexpected error: TypeError('Object of type SUCCESS is not JSON serializable')
Traceback (most recent call last):
File "/root/.local/lib/python3.8/site-packages/prefect/engine/runner.py", line 48, in inner
new_state = method(self, state, *args, **kwargs)
File "/root/.local/lib/python3.8/site-packages/prefect/engine/task_runner.py", line 911, in get_task_run_state
result = self.result.write(value, **formatting_kwargs)
File "/root/.local/lib/python3.8/site-packages/prefect/engine/results/prefect_result.py", line 62, in write
new.location = self.serializer.serialize(new.value).decode("utf-8")
File "/root/.local/lib/python3.8/site-packages/prefect/engine/serializers.py", line 110, in serialize
return json.dumps(value).encode()
File "/usr/local/lib/python3.8/json/__init__.py", line 231, in dumps
return _default_encoder.encode(obj)
File "/usr/local/lib/python3.8/json/encoder.py", line 199, in encode
chunks = self.iterencode(o, _one_shot=True)
File "/usr/local/lib/python3.8/json/encoder.py", line 257, in iterencode
return _iterencode(o, 0)
File "/usr/local/lib/python3.8/json/encoder.py", line 179, in default
raise TypeError(f'Object of type {o.__class__.__name__} '
TypeError: Object of type SUCCESS is not JSON serializable
Kevin Kho
Client.create_flow_run
is still supported. what Prefect version are you on?Trevor Kramer
07/27/2021, 5:45 PMTrevor Kramer
07/27/2021, 5:46 PMflow_run_id = client.create_flow_run(
flow_id,
run_name=prefect.context.get("flow_run_name"),
parameters={
"input": yi,
"stack": stack,
"pruned_locations": pruned_locations,
"image": image,
"commit": commit,
},
)
while True:
time.sleep(10)
flow_run_state = client.get_flow_run_info(flow_run_id).state
if flow_run_state.is_finished():
raise signal_from_state(flow_run_state)(
f"{flow_run_id} finished in state {flow_run_state}"
)
Trevor Kramer
07/27/2021, 5:49 PMKevin Kho
Trevor Kramer
07/27/2021, 5:49 PMKevin Kho
raise
signal into the Prefect Result work before?Kevin Kho
Trevor Kramer
07/27/2021, 9:14 PM