-
Notifications
You must be signed in to change notification settings - Fork 16.8k
POST /taskInstances/list with wildcards returns unhelpful error #26424
Copy link
Copy link
Closed
Labels
affected_version:2.3Issues Reported for 2.3Issues Reported for 2.3area:APIAirflow's REST/HTTP APIAirflow's REST/HTTP APIarea:coregood first issuekind:bugThis is a clearly a bugThis is a clearly a bug
Description
Apache Airflow version
2.3.4
What happened
https://airflow.apache.org/docs/apache-airflow/stable/stable-rest-api-ref.html#operation/get_task_instances_batch
fails with an error with wildcards while
https://airflow.apache.org/docs/apache-airflow/stable/stable-rest-api-ref.html#operation/get_task_instances
succeeds with wildcards
Error:
400
"None is not of type 'object'"
What you think should happen instead
No response
How to reproduce
astro dev initastro dev starttest1.pyandpython test1.py
import requests
host = "http://localhost:8080/api/v1"
kwargs = {
'auth': ('admin', 'admin'),
'headers': {'content-type': 'application/json'}
}
r = requests.post(f'{host}/dags/~/dagRuns/~/taskInstances/list', **kwargs, timeout=10)
print(r.url, r.text)
output
http://localhost:8080/api/v1/dags/~/dagRuns/~/taskInstances/list
{
"detail": "None is not of type 'object'",
"status": 400,
"title": "Bad Request",
"type": "http://apache-airflow-docs.s3-website.eu-central-1.amazonaws.com/docs/apache-airflow/latest/stable-rest-api-ref.html#section/Errors/BadRequest"
}
test2.pyandpython test2.py
import requests
host = "http://localhost:8080/api/v1"
kwargs = {
'auth': ('admin', 'admin'),
'headers': {'content-type': 'application/json'}
}
r = requests.get(f'{host}/dags/~/dagRuns/~/taskInstances', **kwargs, timeout=10) # change here
print(r.url, r.text)
<correct output>
Operating System
Debian
Versions of Apache Airflow Providers
No response
Deployment
Astronomer
Deployment details
No response
Anything else
No response
Are you willing to submit PR?
- Yes I am willing to submit a PR!
Code of Conduct
- I agree to follow this project's Code of Conduct
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
affected_version:2.3Issues Reported for 2.3Issues Reported for 2.3area:APIAirflow's REST/HTTP APIAirflow's REST/HTTP APIarea:coregood first issuekind:bugThis is a clearly a bugThis is a clearly a bug