Skip to content

Commit 4388e98

Browse files
vincbeckromsharon98
authored andcommitted
Delete experimental API (apache#41434)
1 parent c3aa6c1 commit 4388e98

File tree

72 files changed

+99
-4380
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

72 files changed

+99
-4380
lines changed

.github/boring-cyborg.yml

-3
Original file line numberDiff line numberDiff line change
@@ -549,12 +549,9 @@ labelPRBasedOnFilePath:
549549
area:API:
550550
- airflow/api/**/*
551551
- airflow/api_connexion/**/*
552-
- airflow/www/api/**/*
553552
- clients/**/*
554-
- docs/apache-airflow/deprecated-rest-api-ref.rst
555553
- docs/apache-airflow/stable-rest-api-ref.rst
556554
- tests/api_connexion/**/*
557-
- tests/www/api/**/*
558555

559556
area:dev-tools:
560557
- scripts/**/*

INSTALL

+3-3
Original file line numberDiff line numberDiff line change
@@ -256,9 +256,9 @@ Those extras are available as regular core airflow extras - they install optiona
256256

257257
# START CORE EXTRAS HERE
258258

259-
aiobotocore, apache-atlas, apache-webhdfs, async, cgroups, cloudpickle, deprecated-api, github-
260-
enterprise, google-auth, graphviz, kerberos, ldap, leveldb, otel, pandas, password, pydantic,
261-
rabbitmq, s3fs, saml, sentry, statsd, uv, virtualenv
259+
aiobotocore, apache-atlas, apache-webhdfs, async, cgroups, cloudpickle, github-enterprise, google-
260+
auth, graphviz, kerberos, ldap, leveldb, otel, pandas, password, pydantic, rabbitmq, s3fs, saml,
261+
sentry, statsd, uv, virtualenv
262262

263263
# END CORE EXTRAS HERE
264264

RELEASE_NOTES.rst

-2
Original file line numberDiff line numberDiff line change
@@ -3963,8 +3963,6 @@ Details in the `SQLAlchemy Changelog <https://docs.sqlalchemy.org/en/14/changelo
39633963

39643964
Previously, only one backend was used to authorize use of the REST API. In 2.3 this was changed to support multiple backends, separated by comma. Each will be tried in turn until a successful response is returned.
39653965

3966-
This setting is also used for the deprecated experimental API, which only uses the first option even if multiple are given.
3967-
39683966
``airflow.models.base.Operator`` is removed (#21505)
39693967
""""""""""""""""""""""""""""""""""""""""""""""""""""
39703968

airflow/api/client/__init__.py

+2-10
Original file line numberDiff line numberDiff line change
@@ -19,27 +19,19 @@
1919

2020
from __future__ import annotations
2121

22-
from importlib import import_module
23-
from typing import TYPE_CHECKING
24-
2522
from airflow import api
26-
from airflow.configuration import conf
27-
28-
if TYPE_CHECKING:
29-
from airflow.api.client.api_client import Client
23+
from airflow.api.client.local_client import Client
3024

3125

3226
def get_current_api_client() -> Client:
3327
"""Return current API Client based on current Airflow configuration."""
34-
api_module = import_module(conf.get_mandatory_value("cli", "api_client"))
3528
auth_backends = api.load_auth()
3629
session = None
3730
for backend in auth_backends:
3831
session_factory = getattr(backend, "create_client_session", None)
3932
if session_factory:
4033
session = session_factory()
41-
api_client = api_module.Client(
42-
api_base_url=conf.get("cli", "endpoint_url"),
34+
api_client = Client(
4335
auth=getattr(backend, "CLIENT_AUTH", None),
4436
session=session,
4537
)

airflow/api/client/api_client.py

-94
This file was deleted.

airflow/api/client/json_client.py

-164
This file was deleted.

airflow/api/client/local_client.py

+8-7
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,21 @@
1919

2020
from __future__ import annotations
2121

22-
from airflow.api.client import api_client
22+
import httpx
23+
2324
from airflow.api.common import delete_dag, trigger_dag
24-
from airflow.api.common.experimental.get_lineage import get_lineage as get_lineage_api
2525
from airflow.exceptions import AirflowBadRequest, PoolNotFound
2626
from airflow.models.pool import Pool
2727

2828

29-
class Client(api_client.Client):
29+
class Client:
3030
"""Local API client implementation."""
3131

32+
def __init__(self, auth=None, session: httpx.Client | None = None):
33+
self._session: httpx.Client = session or httpx.Client()
34+
if auth:
35+
self._session.auth = auth
36+
3237
def trigger_dag(
3338
self, dag_id, run_id=None, conf=None, execution_date=None, replace_microseconds=True
3439
) -> dict | None:
@@ -87,7 +92,3 @@ def create_pool(self, name, slots, description, include_deferred):
8792
def delete_pool(self, name):
8893
pool = Pool.delete_pool(name=name)
8994
return pool.pool, pool.slots, pool.description
90-
91-
def get_lineage(self, dag_id, execution_date):
92-
lineage = get_lineage_api(dag_id=dag_id, execution_date=execution_date)
93-
return lineage

0 commit comments

Comments
 (0)