airflow icon indicating copy to clipboard operation
airflow copied to clipboard

AIP-84 Migrate public endpoints from api_connexion to the new rest api

Open pierrejeambrun opened this issue 1 year ago β€’ 21 comments

Body

https://github.com/apache/airflow/issues/42366 is taking care of migrating private endpoints.

This issue focus on migrating all the public ones. Ideally they shouldn't change too much and be feature rich compare to airflow 2.x.

An exemple PR can be found here https://github.com/apache/airflow/pull/42196

Tasks (total ~ 81 endpoints)

Backfill (6 endpoints)

Config (2 endpoints) @rawwar

  • https://github.com/apache/airflow/issues/42745 @rawwar

Connection @bugraoz93 (6 endpoints)

  • api_connexion/endpoints/connection_endpoint.py delete_connection https://github.com/apache/airflow/issues/42559 @bugraoz93
  • api_connexion/endpoints/connection_endpoint.py get_connection https://github.com/apache/airflow/issues/42590 @rawwar
  • api_connexion/endpoints/connection_endpoint.py get_connections https://github.com/apache/airflow/issues/42591 @bugraoz93
  • api_connexion/endpoints/connection_endpoint.py patch_connection https://github.com/apache/airflow/issues/42592 @bugraoz93
  • api_connexion/endpoints/connection_endpoint.py post_connection https://github.com/apache/airflow/issues/42593 @bugraoz93
  • api_connexion/endpoints/connection_endpoint.py test_connection https://github.com/apache/airflow/issues/42594 @bugraoz93

DAG (5 endpoints)

  • api_connexion/endpoints/dag_endpoint.py get_dag_details https://github.com/apache/airflow/issues/42453 @omkar-foss
  • api_connexion/endpoints/dag_endpoint.py patch_dag https://github.com/apache/airflow/issues/42468 @pierrejeambrun
  • api_connexion/endpoints/dag_endpoint.py patch_dags https://github.com/apache/airflow/issues/42544 @pierrejeambrun
  • api_connexion/endpoints/dag_endpoint.py get_dag https://github.com/apache/airflow/issues/42652 @omkar-foss
  • api_connexion/endpoints/dag_endpoint.py delete_dag https://github.com/apache/airflow/issues/42650 @omkar-foss

Dag Parsing (1 endpoint)

Dag Runs @rawwar (9 endpoints)

  • All dag run endpointsapi_connexion/endpoints/dag_run_endpoint.py https://github.com/apache/airflow/issues/42701 @rawwar

Dag Source (1 endpoint)

  • https://github.com/apache/airflow/issues/42876 @omkar-foss

Dag Stats (1 endpoint)

  • https://github.com/apache/airflow/issues/42877 @omkar-foss

Dag Warnings (1 endpoint) @rawwar

  • https://github.com/apache/airflow/issues/42748 @rawwar

Dataset / Assets (10 endpoints)

Event Logs (2 endpoints)

Extra Link (1 endpoint)

Monitor (2 endpoints)

  • https://github.com/apache/airflow/issues/42937 @bbovenzi
  • https://github.com/apache/airflow/issues/42879 @omkar-foss

Import Error (2 endpoints)

Log (1 endpoint)

Plugin (1 endpoint)

  • https://github.com/apache/airflow/pull/43125 @pierrejeambrun

Pool (5 endpoints) @pierrejeambrun

Provider (1 endpoint)

  • https://github.com/apache/airflow/pull/43159 @pierrejeambrun

Task (2 endpoints) @omkar-foss

  • https://github.com/apache/airflow/issues/42874 @omkar-foss
  • https://github.com/apache/airflow/issues/42875 @omkar-foss

Task Instance (15 endpoints)

Variables (5 endpoints)

  • https://github.com/apache/airflow/pull/42798 @pierrejeambrun
  • https://github.com/apache/airflow/pull/42834 @pierrejeambrun
  • https://github.com/apache/airflow/pull/42929 @pierrejeambrun
  • https://github.com/apache/airflow/pull/42948 @pierrejeambrun
  • https://github.com/apache/airflow/pull/43083 @pierrejeambrun

XCom (2 endpoints)

  • https://github.com/apache/airflow/issues/42978 @michaeljs-c
  • https://github.com/apache/airflow/issues/42980 @michaeljs-c

Committer

  • [X] I acknowledge that I am a maintainer/committer of the Apache Airflow project.

pierrejeambrun avatar Sep 20 '24 12:09 pierrejeambrun

Trimming down views.py is very tempting πŸ˜„

May I pick this up? If yes, please assign this issue to me. Thanks!

omkar-foss avatar Sep 23 '24 06:09 omkar-foss

Hello @omkar-foss,

views.py are mostly 'rendered' front end that will get replaced by the new UI react, in views.py you also find private/UI REST route, most of them are with the /object/ prefix, such as def grid_data. If you want to work on those UI dedicated endpoints you can that would be part of https://github.com/apache/airflow/issues/42366.

This issue focuses on the public endpoints, those are located under the api_connexion folder.

In anycase, just mention the endpoint you are working on, so people do not do the same ones, and I will update the description to track that :). I think we should do one at the time.

pierrejeambrun avatar Sep 23 '24 08:09 pierrejeambrun

Hi @pierrejeambrun, thank you for explaining it to me, much appreciate it.

I'll start migrating the public endpoints, beginning with migration of the DAG Details API (get_dag_details) in api_connexion/endpoints/dag_endpoint.py.

Since this is a meta issue (missed that previously!), I'll create the issue/PR corresponding to the endpoint(s) that I'll be working on and link to this issue (like usual).

P.S: views.py will have to wait :)

omkar-foss avatar Sep 23 '24 12:09 omkar-foss

Thanks for creating the ticket @pierrejeambrun! Let me take connection endpoints

bugraoz93 avatar Sep 28 '24 19:09 bugraoz93

Great, thanks @bugraoz93

pierrejeambrun avatar Sep 30 '24 07:09 pierrejeambrun

Thanks for assigning! Let me save you from regular updates :) I created issues for all the endpoints in connections.

bugraoz93 avatar Sep 30 '24 17:09 bugraoz93

Great, thanks @bugraoz93. I just updated the meta issue with those new additions. Let me know if you plan to work on all of them so I can assign you, or just some of them so I can label the others with good first issue and let other contributors grab them :)

pierrejeambrun avatar Oct 01 '24 08:10 pierrejeambrun

I am planning to work on all of them @pierrejeambrun. if you can assign them to me, that would be great! Thanks :)

bugraoz93 avatar Oct 01 '24 15:10 bugraoz93

Hey folks! After https://github.com/apache/airflow/pull/42631 (open for review), I can pick up these two next in order:

  1. get_dag - https://github.com/apache/airflow/issues/42652
  2. delete_dag - https://github.com/apache/airflow/issues/42650

With these 2 done, I suppose we should have the dags.py migration complete. When you find some time, please update this meta and assign these to me, thank you! πŸ˜ƒ

omkar-foss avatar Oct 02 '24 07:10 omkar-foss

@omkar-foss Assigned. Thanks for picking these issues up!

bbovenzi avatar Oct 02 '24 08:10 bbovenzi

I am working on the following

  1. get_connection - #42674
  2. get_connections - #42677

rawwar avatar Oct 02 '24 20:10 rawwar

Hey folks, just a heads-up on Pydantic aliases - try not to use AliasGenerator as it breaks Airflow lowest direct dependency resolution tests with a TypeError because lower versions of Pydantic wouldn't be having this patch. The TypeError looks like alias_generator ... must return str, not ... (for more info see this issue).

Can use either AliasChoices or AliasPath as those work fine. I faced this issue in https://github.com/apache/airflow/pull/42631 and spent a while on it, so just thought should let you all know!

omkar-foss avatar Oct 02 '24 23:10 omkar-foss

Hey folks, just a heads-up on Pydantic aliases - try not to use AliasGenerator as it breaks Airflow lowest direct

We can also update the minimum version of Pydantic to the version that is fixed. This is the feature of the "lowest direct" tests that they detect such minimum requirements are not met. So maybe you can figure out which is the minimum version and we set it @omkar-foss ?

potiuk avatar Oct 03 '24 00:10 potiuk

This is the feature of the "lowest direct" tests that they detect such minimum requirements are not met.

It's a very cool feature! Helping to find issues we normally wouldn't find during regular unit or integration tests.

We can also update the minimum version of Pydantic to the version that is fixed. So maybe you can figure out which is the minimum version and we set it

That would be great, the minimum Pydantic version that is fixed is v2.6.4, this commit for quick reference.

omkar-foss avatar Oct 03 '24 06:10 omkar-foss

That would be great, the minimum Pydantic version that is fixed is v2.6.4, this commit for quick reference.

Added min version for Pydantic in https://github.com/apache/airflow/pull/42694

potiuk avatar Oct 03 '24 06:10 potiuk

@rawwar

I am working on the following

get_connection - https://github.com/apache/airflow/pull/42674 get_connections - AIP-84 Migrate the public endpoint Get Connections to FastAPI #42677`

Thanks for your contribution and help on AIP-84, as mentioned above, I think @bugraoz93 is already working on connections endpoints, or is planning to do so. Feel free to choose any other endpoints that looks cool to you, under api_connexions/endpoints. Besides dag_endpoint and connection_endpoint eveything is up for a grab, just let me know and I will assign you :)

pierrejeambrun avatar Oct 03 '24 09:10 pierrejeambrun

Assigning myself to variables

pierrejeambrun avatar Oct 07 '24 14:10 pierrejeambrun

I've created new issues for sections Dag Source (1 endpoint), Dag Stats (1 endpoint), Task (2 endpoints) and Version (1 endpoint). List as below:

  1. https://github.com/apache/airflow/issues/42876
  2. https://github.com/apache/airflow/issues/42877
  3. https://github.com/apache/airflow/issues/42874
  4. https://github.com/apache/airflow/issues/42875
  5. https://github.com/apache/airflow/issues/42879

Please assign these to me, I'll pick these up one by one in the next few days, right after https://github.com/apache/airflow/issues/42650. Cheers.

omkar-foss avatar Oct 09 '24 20:10 omkar-foss

@omkar-foss assigned and meta issue updated, thanks :)

pierrejeambrun avatar Oct 10 '24 08:10 pierrejeambrun

Hi @pierrejeambrun I've added issues for XCom, please assign to me πŸ™‚ thanks

michaeljs-c avatar Oct 13 '24 15:10 michaeljs-c

Hi @pierrejeambrun I've added issues for XCom, please assign to me πŸ™‚ thanks

Done, and meta task is updated.

Thanks for taking those ones @michaeljs-c!

pierrejeambrun avatar Oct 14 '24 07:10 pierrejeambrun

Hi @pierrejeambrun, I can take on the migrations for Event Logs:

  1. Get Event Log
  2. Get Event Logs

However, none of the current issue form templates fit a task issue (the Task and Meta template tags the issue with kind:meta instead of kind:feature). Could you please create the issue and assign it to me? Thanks!

jason810496 avatar Oct 23 '24 06:10 jason810496

Hi @pierrejeambrun, I can handle the migrations for Import Error

  1. get_import_error
  2. get_import_errors

I’m still encountering the issue where I can’t create the correct issue type. Could you please create it and assign it to me? Thanks!

jason810496 avatar Nov 01 '24 09:11 jason810496

I've unassigned myself for the config endpoint issue. If no one takes it, I'll pick it up once I finish DagRun and DagWarning endpoints. Issue: https://github.com/apache/airflow/issues/42745 <- If anyone wants to take this, please let me know and I can assign it to you.

rawwar avatar Nov 02 '24 15:11 rawwar

@pierrejeambrun I am working on get taskinstance try endpoint

ghost avatar Nov 04 '24 09:11 ghost

Hi @pierrejeambrun, could you please assign these TI-related endpoints to me in above issue description:

GET:

  • https://github.com/apache/airflow/issues/43748
  • https://github.com/apache/airflow/issues/43749
  • https://github.com/apache/airflow/issues/43750
  • https://github.com/apache/airflow/issues/43756

POST:

  • https://github.com/apache/airflow/issues/43751

PUT:

  • https://github.com/apache/airflow/issues/43753
  • https://github.com/apache/airflow/issues/43754
  • https://github.com/apache/airflow/issues/43755
  • https://github.com/apache/airflow/issues/43752

omkar-foss avatar Nov 06 '24 14:11 omkar-foss

Hey omkar, as you can see in I'm already assigned to the TaskInstances endpoint.

Thanks for creating the issue, we can split the work on that matter, i'll assign some of them to you maybe all the PUT/POST as I am already working on GET.

pierrejeambrun avatar Nov 06 '24 14:11 pierrejeambrun

You're assigned, issue updated, let me know if that shounds good for you :).

pierrejeambrun avatar Nov 06 '24 14:11 pierrejeambrun

You're assigned, issue updated, let me know if that shounds good for you :).

Yes sure, that works. Thank you :)

omkar-foss avatar Nov 08 '24 04:11 omkar-foss

@prabhusneha I see you're assigned to Logs. What is the status of getting the logs for a task instance? That would be a useful one to get in the UI soon!

bbovenzi avatar Nov 20 '24 22:11 bbovenzi