Apache Airflow version
main (development)
What happened
While working on another change I noticed that the example POST from the API docs actually leads to a request Error:
curl -X POST -H "Cookie: session=xxxx" localhost:8080/api/v1/dags/data_warehouse_dag_5by1a2rogu/dagRuns -d '{"dag_run_id":"string2","logical_date":"2019-08-24T14:15:24Z","execution_date":"2019-08-24T14:15:24Z","conf":{},"state":"queued","note":"strings"}' -H 'Content-Type: application/json'
{
"detail": "Property is read-only - 'state'",
"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"
}
I believe that this comes from the DagRunSchema marking this field as dump_only:
|
state = DagStateField(dump_only=True) |
So either -
- The documentation / API spec is incorrect and this field cannot be set in the request
- The marshmallow schema is incorrect and this field is incorrectly marked as
dump_only
I think that its the former, as there's even a test to ensure that this field can't be set in a request - I can look into this and fix it soon.
What you think should happen instead
The API should accept requested which follow examples from the documentation.
How to reproduce
Spin up breeze and POST a create dagrun request which attempts to set the DagRun state.
Operating System
Breeze
Versions of Apache Airflow Providers
No response
Deployment
Other
Deployment details
No response
Anything else
No response
Are you willing to submit PR?
Code of Conduct
Apache Airflow version
main (development)
What happened
While working on another change I noticed that the example POST from the API docs actually leads to a request Error:
I believe that this comes from the DagRunSchema marking this field as dump_only:
airflow/airflow/api_connexion/schemas/dag_run_schema.py
Line 69 in 478fd82
So either -
dump_onlyI think that its the former, as there's even a test to ensure that this field can't be set in a request - I can look into this and fix it soon.
What you think should happen instead
The API should accept requested which follow examples from the documentation.
How to reproduce
Spin up breeze and POST a create dagrun request which attempts to set the DagRun state.
Operating System
Breeze
Versions of Apache Airflow Providers
No response
Deployment
Other
Deployment details
No response
Anything else
No response
Are you willing to submit PR?
Code of Conduct