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

Migrate public get dags to fastapi #42196

Merged
merged 3 commits into from
Sep 13, 2024

Conversation

pierrejeambrun
Copy link
Member

Related to: #42159

This is the first step to get the endpoint we need. This add the get_dags endpoint in the public part of the fastapi API. This is iso functional in terms of feature as to what we have on the current public api. Only difference is that permissions are not yet handled we would need #42019.

Also I removed for now the field param allowing for partial response of only subfields. This is a bit harder to handle and changes dynamically the response model of the endpoint. Also this does not improve much because the full object is already loaded by the ORM, we just save some serialization and response size. (endpoint is paginated anyway). We can work on that if we need it.

A follow up PR will come to add new features to that endpoint as requested in the related issue to fulfill UI requirements.

@pierrejeambrun pierrejeambrun self-assigned this Sep 12, 2024
@pierrejeambrun pierrejeambrun added the AIP-84 Modern Rest API label Sep 12, 2024
@bugraoz93
Copy link
Collaborator

bugraoz93 commented Sep 12, 2024

I like using the Annotated for receiving session as a parameter. Thanks for including the generic way of using the session!

@bbovenzi
Copy link
Contributor

Looks like Test OpenAPI client CI is trying to fetch endpoints that we haven't built yet?

@ephraimbuddy
Copy link
Contributor

Looks like Test OpenAPI client CI is trying to fetch endpoints that we haven't built yet?

Rebasing will fix that. We did a revert that caused that. I just merged the final revert.

@bbovenzi bbovenzi force-pushed the migrate-dag-list-to-fastapi branch from 2ba1d85 to 3be2249 Compare September 12, 2024 22:37
@pierrejeambrun pierrejeambrun force-pushed the migrate-dag-list-to-fastapi branch from 3be2249 to cdfa566 Compare September 13, 2024 07:21
@pierrejeambrun
Copy link
Member Author

CI should be green now, it took some time but there was issues with lowest_dependency tests, because we need this fix from pydantic that is in 2.6.0.

@pierrejeambrun
Copy link
Member Author

Unrelated mypy failure on providers, merging

@pierrejeambrun pierrejeambrun merged commit 7d5f2ba into apache:main Sep 13, 2024
104 of 106 checks passed
@pierrejeambrun pierrejeambrun deleted the migrate-dag-list-to-fastapi branch September 13, 2024 15:04
@pierrejeambrun pierrejeambrun added the airflow3.0:breaking Candidates for Airflow 3.0 that contain breaking changes label Sep 27, 2024
@pierrejeambrun
Copy link
Member Author

pierrejeambrun commented Sep 27, 2024

Added the breaking label, because the fields query param is not supported anymore. (for now). That means that the user will get a 'full' payload, even if he specifies some fields to get only a partial response. Theoretically receiving 'more' than expected is not breaking but maybe they have 'hard validation' with 'unknown = RAISES' that can break client side. And also this is an important enough functional change so we might want to bring that to the users attention.

Might remove later if we implement it.

@rawwar

This comment was marked as resolved.

joaopamaral pushed a commit to joaopamaral/airflow that referenced this pull request Oct 21, 2024
* Migrate public get dags to fastapi

* Fix CI

* Fix CI lowest dependency resolution
potiuk added a commit to potiuk/airflow that referenced this pull request Nov 22, 2024
The `eval-type-backport` is a tool to replace some of the controversial
new type hints added with `from future imoport __annotations__`
to "classic" type hint (| and list - into `Union` and `List`).

This helps to battle some of the issues where Pydantic has troubles
when they are used for classes that Pydantic uses.

The library was initially added in apache#42196 but it was added for all
Python versions - this change limits it only to Python < 3.10
potiuk added a commit that referenced this pull request Nov 23, 2024
The `eval-type-backport` is a tool to replace some of the controversial
new type hints added with `from future imoport __annotations__`
to "classic" type hint (| and list - into `Union` and `List`).

This helps to battle some of the issues where Pydantic has troubles
when they are used for classes that Pydantic uses.

The library was initially added in #42196 but it was added for all
Python versions - this change limits it only to Python < 3.10
potiuk added a commit to potiuk/airflow that referenced this pull request Nov 23, 2024
…e#44294)

The `eval-type-backport` is a tool to replace some of the controversial
new type hints added with `from future imoport __annotations__`
to "classic" type hint (| and list - into `Union` and `List`).

This helps to battle some of the issues where Pydantic has troubles
when they are used for classes that Pydantic uses.

The library was initially added in apache#42196 but it was added for all
Python versions - this change limits it only to Python < 3.10
(cherry picked from commit 2948338)

Co-authored-by: Jarek Potiuk <jarek@potiuk.com>
jscheffl pushed a commit that referenced this pull request Nov 24, 2024
… (#44315)

The `eval-type-backport` is a tool to replace some of the controversial
new type hints added with `from future imoport __annotations__`
to "classic" type hint (| and list - into `Union` and `List`).

This helps to battle some of the issues where Pydantic has troubles
when they are used for classes that Pydantic uses.

The library was initially added in #42196 but it was added for all
Python versions - this change limits it only to Python < 3.10
(cherry picked from commit 2948338)
utkarsharma2 pushed a commit that referenced this pull request Dec 4, 2024
… (#44315)

The `eval-type-backport` is a tool to replace some of the controversial
new type hints added with `from future imoport __annotations__`
to "classic" type hint (| and list - into `Union` and `List`).

This helps to battle some of the issues where Pydantic has troubles
when they are used for classes that Pydantic uses.

The library was initially added in #42196 but it was added for all
Python versions - this change limits it only to Python < 3.10
(cherry picked from commit 2948338)
utkarsharma2 pushed a commit that referenced this pull request Dec 9, 2024
… (#44315)

The `eval-type-backport` is a tool to replace some of the controversial
new type hints added with `from future imoport __annotations__`
to "classic" type hint (| and list - into `Union` and `List`).

This helps to battle some of the issues where Pydantic has troubles
when they are used for classes that Pydantic uses.

The library was initially added in #42196 but it was added for all
Python versions - this change limits it only to Python < 3.10
(cherry picked from commit 2948338)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
AIP-84 Modern Rest API airflow3.0:breaking Candidates for Airflow 3.0 that contain breaking changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants