Skip to content

Commit c8aa74a

Browse files
authored
Source conf from airflow.sdk.configuration.conf for apache providers (#59966)
* Migrate apache provider to use airflow.sdk.configuration.conf * Add 'use next version' comment for common-compat dependency
1 parent be40099 commit c8aa74a

File tree

15 files changed

+19
-19
lines changed

15 files changed

+19
-19
lines changed

providers/apache/beam/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ requires-python = ">=3.10,!=3.13"
5858
# After you modify the dependencies, and rebuild your Breeze CI image with ``breeze ci-image build``
5959
dependencies = [
6060
"apache-airflow>=2.11.0",
61-
"apache-airflow-providers-common-compat>=1.10.1",
61+
"apache-airflow-providers-common-compat>=1.10.1", # use next version
6262
'apache-beam>=2.60.0; python_version < "3.13"',
6363
"pyarrow>=16.1.0; python_version < '3.13'",
6464
"numpy>=1.22.4; python_version<'3.11'",

providers/apache/beam/src/airflow/providers/apache/beam/operators/beam.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,10 @@
3030
from functools import partial
3131
from typing import TYPE_CHECKING, Any
3232

33-
from airflow.configuration import conf
3433
from airflow.exceptions import AirflowOptionalProviderFeatureException
3534
from airflow.providers.apache.beam.hooks.beam import BeamHook, BeamRunnerType
3635
from airflow.providers.apache.beam.triggers.beam import BeamJavaPipelineTrigger, BeamPythonPipelineTrigger
37-
from airflow.providers.common.compat.sdk import AirflowException, BaseOperator
36+
from airflow.providers.common.compat.sdk import AirflowException, BaseOperator, conf
3837
from airflow.providers_manager import ProvidersManager
3938
from airflow.utils.helpers import convert_camel_to_snake, exactly_one
4039
from airflow.version import version

providers/apache/hdfs/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ requires-python = ">=3.10"
5959
# After you modify the dependencies, and rebuild your Breeze CI image with ``breeze ci-image build``
6060
dependencies = [
6161
"apache-airflow>=2.11.0",
62-
"apache-airflow-providers-common-compat>=1.10.1",
62+
"apache-airflow-providers-common-compat>=1.10.1", # use next version
6363
'hdfs[avro,dataframe,kerberos]>=2.5.4;python_version<"3.12"',
6464
'hdfs[avro,dataframe,kerberos]>=2.7.3;python_version>="3.12"',
6565
'pandas>=2.1.2; python_version <"3.13"',

providers/apache/hdfs/src/airflow/providers/apache/hdfs/hooks/webhdfs.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,7 @@
2424
import requests
2525
from hdfs import HdfsError, InsecureClient
2626

27-
from airflow.configuration import conf
28-
from airflow.providers.common.compat.sdk import AirflowException, BaseHook
27+
from airflow.providers.common.compat.sdk import AirflowException, BaseHook, conf
2928

3029
log = logging.getLogger(__name__)
3130

providers/apache/hdfs/src/airflow/providers/apache/hdfs/log/hdfs_task_handler.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@
2727

2828
import attrs
2929

30-
from airflow.configuration import conf
3130
from airflow.providers.apache.hdfs.hooks.webhdfs import WebHDFSHook
31+
from airflow.providers.common.compat.sdk import conf
3232
from airflow.utils.log.file_task_handler import FileTaskHandler
3333
from airflow.utils.log.logging_mixin import LoggingMixin
3434

providers/apache/hive/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ requires-python = ">=3.10"
5959
# After you modify the dependencies, and rebuild your Breeze CI image with ``breeze ci-image build``
6060
dependencies = [
6161
"apache-airflow>=2.11.0",
62-
"apache-airflow-providers-common-compat>=1.10.1",
62+
"apache-airflow-providers-common-compat>=1.10.1", # use next version
6363
"apache-airflow-providers-common-sql>=1.26.0",
6464
"hmsclient>=0.1.0",
6565
'pandas>=2.1.2; python_version <"3.13"',

providers/apache/hive/src/airflow/providers/apache/hive/hooks/hive.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,12 @@
3232
from sqlalchemy.engine import URL
3333
from typing_extensions import overload
3434

35-
from airflow.configuration import conf
3635
from airflow.exceptions import AirflowProviderDeprecationWarning
3736
from airflow.providers.common.compat.sdk import (
3837
AIRFLOW_VAR_NAME_FORMAT_MAPPING,
3938
AirflowException,
4039
BaseHook,
40+
conf,
4141
)
4242
from airflow.providers.common.sql.hooks.sql import DbApiHook
4343
from airflow.security import utils

providers/apache/hive/src/airflow/providers/apache/hive/operators/hive.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@
2323
from functools import cached_property
2424
from typing import TYPE_CHECKING, Any
2525

26-
from airflow.configuration import conf
2726
from airflow.providers.apache.hive.hooks.hive import HiveCliHook
2827
from airflow.providers.common.compat.sdk import (
2928
AIRFLOW_VAR_NAME_FORMAT_MAPPING,
3029
BaseOperator,
30+
conf,
3131
context_to_airflow_vars,
3232
)
3333

providers/apache/hive/tests/unit/apache/hive/operators/test_hive.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@
2222

2323
import pytest
2424

25-
from airflow.configuration import conf
2625
from airflow.models import DagRun, TaskInstance
2726
from airflow.providers.apache.hive.operators.hive import HiveOperator
27+
from airflow.providers.common.compat.sdk import conf
2828
from airflow.utils import timezone
2929

3030
from unit.apache.hive import DEFAULT_DATE, MockSubProcess, TestHiveEnvironment

providers/apache/livy/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ requires-python = ">=3.10"
6060
dependencies = [
6161
"apache-airflow>=2.11.0",
6262
"apache-airflow-providers-http>=5.1.0",
63-
"apache-airflow-providers-common-compat>=1.10.1",
63+
"apache-airflow-providers-common-compat>=1.10.1", # use next version
6464
"aiohttp>=3.9.2",
6565
"asgiref>=2.3.0",
6666
]

0 commit comments

Comments
 (0)