https://prefect.io logo
Title
h

Himanshu

10/12/2022, 1:28 PM
Hi i am trying to register prefect flow with a schedule using django API and am getting error {'_schema': 'Invalid data type: None'}. Does anyone have any solution?
k

Kalise Richmond

10/12/2022, 3:46 PM
Hi Himanshu, could you provide some more details or code snipped for how you are registering the flow or the stack trace for the error?
h

Himanshu

10/13/2022, 10:28 AM
I am using this code to register my flow:
def register_flow(flow, project_name, flow_name=None, flow_params=None, schedule=None):
new_flow = flow.copy()  # Create a flow copy
new_flow.run_config = UniversalRun(labels=["DESKTOP-ABCD"])
if flow_name:
new_flow.name = flow_name
new_flow.schedule = schedule
client = Client(api_key=config("PREFECT_API_KEY"))
flow_id = client.register(new_flow, project_name=project_name, build=False)
return flow_id
I am getting this error:
But when I used
new_flow.register(project_name)
in place of `client.register()` it did not give this error.
k

Kalise Richmond

10/13/2022, 5:48 PM
Hi Himanshu, have you tried to set the build=True for the
client.register()
h

Himanshu

10/14/2022, 10:30 AM
Yes i have tried that
I got this error message at that time: "This flow has no storage to build"