William Jamir
02/28/2024, 11:39 AMasync with prefect.get_client() as client:
flow_runs = await client.read_flow_runs(
flow_run_filter=FlowRunFilter(
name=FlowRunFilterName(any_=["MY_RUN"]),
),
sort=FlowRunSort.START_TIME_DESC,
)
Which sends this request with this json content
METHOD: POST
JSON = {
deployments: None,
flow_runs: {
name: {
any_: ["MY_RUN"]
}
},
flows: None,
limit: None,
offset: 0,
sort: FlowRunSort.START_TIME_DESC,
task_runs: None,
work_pool_queues: None,
work_pools: None
}
But I got the following stacktrace
PrefectHTTPStatusError: Client error '422 Unprocessable Entity' for url '<https://my_local_prefect_instance.com/api/flow_runs/filter>'
Response: {'exception_message': 'Invalid request received.', 'exception_detail': [{'loc': ['path', 'id'], 'msg': 'value is not a valid uuid', 'type': 'type_error.uuid'}], 'request_body': None}
Do you know what could be happening here? How can I debug this issue? Any recommendation, settings to activate or some path to chase?Marvin
02/28/2024, 11:39 AMI using prefect client to read_flow_runs like this:
async with prefect.get_client() as client:
flow_runs = await client.read_flow_runs(
flow_run_filter=FlowRunFilter(
name=FlowRunFilterName(any_=["MY_RUN"]),
),
sort=FlowRunSort.START_TIME_DESC,
)
Which sends this request with this json content
METHOD: POST
JSON = {
deployments: None,
flow_runs: {
name: {
any_: ["MY_RUN"]
}
},
flows: None,
limit: None,
offset: 0,
sort: FlowRunSort.START_TIME_DESC,
task_runs: None,
work_pool_queues: None,
work_pools: None
}
But I got the following stacktrace
```PrefectHTTPStatusError: Client error '422 Unprocessable Entity' for url 'https://my_local_prefect_instance.com/api/flow_runs/filter'
Response: {'exception_message': 'Invalid request received.', 'exception_detail': [{'loc': ['path', 'id'], 'msg': 'value is not a valid uuid', 'type': 'type_error.uuid'}], 'request_body': None}
For more information check: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/422
File "incrementality/clients/incrementality_prefect_client.py", line 23, in get_flow_run_messages
flow_runs = await client.read_flowMarvin
02/28/2024, 11:40 AMI using prefect client to read_flow_runs like this:
async with prefect.get_client() as client:
flow_runs = await client.read_flow_runs(
flow_run_filter=FlowRunFilter(
name=FlowRunFilterName(any_=["MY_RUN"]),
),
sort=FlowRunSort.START_TIME_DESC,
)
Which sends this request with this json content
METHOD: POST
JSON = {
deployments: None,
flow_runs: {
name: {
any_: ["MY_RUN"]
}
},
flows: None,
limit: None,
offset: 0,
sort: FlowRunSort.START_TIME_DESC,
task_runs: None,
work_pool_queues: None,
work_pools: None
}
But I got the following stacktrace
```PrefectHTTPStatusError: Client error '422 Unprocessable Entity' for url 'https://my_local_prefect_instance.com/api/flow_runs/filter'
Response: {'exception_message': 'Invalid request received.', 'exception_detail': [{'loc': ['path', 'id'], 'msg': 'value is not a valid uuid', 'type': 'type_error.uuid'}], 'request_body': None}
For more information check: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/422
File "prefect_client.py", line 23, in get_flow_run_messages
flow_runs = await client.read_flow_runs(
File "prefectMarvin
02/28/2024, 11:41 AMFlowRunFilterName
, you might need to use FlowRunFilterId
if you're trying to filter by specific IDs.
4. Update your Prefect client to the latest version. There might be updates or fixes that address the issue you're facing.
5. Enable logging for the Prefect client to get more detailed information on the request and response. This could provide insight into what part of the request is being rejected by the server.
6. Review open and closed issues on the Prefect GitHub repository to see if others have encountered similar problems and to check for any related bug reports or fixes.
7. If none of the above steps help, consider reaching out to the Prefect community or Prefect support for further assistance.
Remember that I'm here to assist you. If existence is meaningless, at least let's make sure our API calls are error-free.