Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Airflow 2 to 3 Rest API Changes #43378

Open
1 task done
pierrejeambrun opened this issue Oct 25, 2024 · 4 comments
Open
1 task done

Airflow 2 to 3 Rest API Changes #43378

pierrejeambrun opened this issue Oct 25, 2024 · 4 comments
Assignees
Labels
airflow3.0:candidate Potential candidates for Airflow 3.0 area:API Airflow's REST/HTTP API kind:documentation kind:feature Feature Requests kind:meta High-level information important to the community

Comments

@pierrejeambrun
Copy link
Member

pierrejeambrun commented Oct 25, 2024

Rest API Breaking Change

The goal is to make an exhaustive list of of the breaking / noticeable changes for the Rest API moving from airflow 2 to airflow 3.

Some of those changes are inherent to FastAPI and hard to circumvent, some others are here just for code clarity or simplicity and can be 'fixed'. That being said I think that we should take the opportunity of Airflow 3 to clean/adjust the code allowing ourselves a few breaking changes when necessary.

  • Th API now returns 422 instead of 400 in cases for validation/deserialization errors (body, query/path parameters).

  • When listing a resource for instance on GET /dags, fields parameter is not supported anymore to obtain a partial response. Full objects will be returned by the endpoint.

  • Passing list query parameter switched from form, non exploded to form, exploded, i.e before ?my_list=item1,item2 now ?my_list=item1&my_list=item2

  • execution_date deprecated and is now removed. Any payload or query parameters mentioning this field has been removed.

  • datetime format are RFC3339-compliant in FastAPI, more permissive than ISO8601. meaning that the API returns zulu datetime for responses, more info here. Both Z and 00+xx are supported for payload and params. Workaround here Unable to parse Zulu datetimes using standard library pydantic/pydantic#6028 (comment). This is due to pydantic v2 default behavior

  • Patch on DagRun and TaskInstance are more generic and allow in addition to update the ressource state to update the note content. Therefore the two legacy dedicated endpoints to update DagRun note and TaskInstance note have been removed. Same for the set task instance state, it is now handled by the broader PATCH on task intances.

  • assets/queuedEvent endpoints have moved to assets/queuedEvents for consistency.

  • dag_parsing endpoint now returns a 409 when the DagPriorityParsingRequest already exists. (It was returning 201 before).

Committer

  • I acknowledge that I am a maintainer/committer of the Apache Airflow project.
@pierrejeambrun pierrejeambrun added kind:meta High-level information important to the community kind:feature Feature Requests airflow3.0:candidate Potential candidates for Airflow 3.0 labels Oct 25, 2024
@dosubot dosubot bot added area:API Airflow's REST/HTTP API kind:documentation labels Oct 25, 2024
@pierrejeambrun pierrejeambrun self-assigned this Oct 25, 2024
@bbovenzi bbovenzi self-assigned this Oct 29, 2024
@pierrejeambrun
Copy link
Member Author

Waiting for the newsfragment format to be settle to create associated significant newsfragments.

@rawwar
Copy link
Collaborator

rawwar commented Nov 29, 2024

@pierrejeambrun , regarding

When listing a resource for instance on GET /dags, fields parameter is not supported anymore to obtain a partial response. Full objects will be returned by the endpoint.

We can use model_serializer to decide what fields to return. Would this be ok?

@omkar-foss
Copy link
Collaborator

omkar-foss commented Nov 29, 2024

I suppose FastAPI throws 422 instead of 400 in cases where there are missing required parameters (or validation errors) in the request header or body.

@pierrejeambrun please see if this needs to be listed as a breaking change, thought to highlight it, just in case! :)

@pierrejeambrun
Copy link
Member Author

pierrejeambrun commented Nov 29, 2024

I suppose FastAPI throws 422 instead of 400 in cases where there are missing required parameters (or validation errors) in the request header or body.
@pierrejeambrun please see if this needs to be listed as a breaking change, thought to highlight it, just in case! :)

Good idea, done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
airflow3.0:candidate Potential candidates for Airflow 3.0 area:API Airflow's REST/HTTP API kind:documentation kind:feature Feature Requests kind:meta High-level information important to the community
Projects
None yet
Development

No branches or pull requests

4 participants