Skip to content

Commit fb1ccd9

Browse files
committed
Bump azure-kusto-data>=4.1.0
1 parent 2ae1c10 commit fb1ccd9

File tree

4 files changed

+16
-14
lines changed

4 files changed

+16
-14
lines changed

airflow/providers/microsoft/azure/hooks/adx.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@
2828
import warnings
2929
from typing import Any
3030

31+
from azure.kusto.data import ClientRequestProperties, KustoClient, KustoConnectionStringBuilder
3132
from azure.kusto.data.exceptions import KustoServiceError
32-
from azure.kusto.data.request import ClientRequestProperties, KustoClient, KustoConnectionStringBuilder
3333
from azure.kusto.data.response import KustoResponseDataSetV2
3434

3535
from airflow.exceptions import AirflowException, AirflowProviderDeprecationWarning

airflow/providers/microsoft/azure/provider.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,11 +78,11 @@ dependencies:
7878
- azure-synapse-spark
7979
- adal>=1.2.7
8080
- azure-storage-file-datalake>=12.9.1
81+
- azure-kusto-data>=4.1.0
8182
# TODO: upgrade to newer versions of all the below libraries.
8283
# See issue https://github.com/apache/airflow/issues/30199
8384
- azure-mgmt-containerinstance>=1.5.0,<2.0
8485
- azure-mgmt-datafactory>=1.0.0,<2.0
85-
- azure-kusto-data>=0.0.43,<0.1
8686

8787
integrations:
8888
- integration-name: Microsoft Azure Batch

generated/provider_dependencies.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -560,7 +560,7 @@
560560
"azure-datalake-store>=0.0.45",
561561
"azure-identity>=1.3.1",
562562
"azure-keyvault-secrets>=4.1.0",
563-
"azure-kusto-data>=0.0.43,<0.1",
563+
"azure-kusto-data>=4.1.0",
564564
"azure-mgmt-containerinstance>=1.5.0,<2.0",
565565
"azure-mgmt-datafactory>=1.0.0,<2.0",
566566
"azure-mgmt-datalake-store>=0.5.0",

tests/providers/microsoft/azure/hooks/test_adx.py

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
from unittest.mock import patch
2424

2525
import pytest
26-
from azure.kusto.data.request import ClientRequestProperties, KustoClient, KustoConnectionStringBuilder
26+
from azure.kusto.data import ClientRequestProperties, KustoClient, KustoConnectionStringBuilder
2727
from pytest import param
2828

2929
from airflow.exceptions import AirflowException
@@ -225,21 +225,23 @@ def test_get_ui_field_behaviour_placeholders(self):
225225
param("a://usr:pw@host?tenant=my-tenant&auth_method=AAD_APP", id="no-prefix"),
226226
],
227227
)
228-
@patch("airflow.providers.microsoft.azure.hooks.adx.KustoConnectionStringBuilder")
229-
def test_backcompat_prefix_works(self, mock_client, uri):
230-
mock_with = mock_client.with_aad_application_key_authentication
228+
def test_backcompat_prefix_works(self, uri):
231229
with patch.dict(os.environ, AIRFLOW_CONN_MY_CONN=uri):
232-
AzureDataExplorerHook(azure_data_explorer_conn_id="my_conn") # get_conn is called in init
233-
mock_with.assert_called_once_with("host", "usr", "pw", "my-tenant")
230+
hook = AzureDataExplorerHook(azure_data_explorer_conn_id="my_conn") # get_conn is called in init
231+
assert hook.connection._kcsb.data_source == "host"
232+
assert hook.connection._kcsb.application_client_id == "usr"
233+
assert hook.connection._kcsb.application_key == "pw"
234+
assert hook.connection._kcsb.authority_id == "my-tenant"
234235

235-
@patch("airflow.providers.microsoft.azure.hooks.adx.KustoConnectionStringBuilder")
236-
def test_backcompat_prefix_both_causes_warning(self, mock_client):
237-
mock_with = mock_client.with_aad_application_key_authentication
236+
def test_backcompat_prefix_both_causes_warning(self):
238237
with patch.dict(
239238
in_dict=os.environ,
240239
AIRFLOW_CONN_MY_CONN="a://usr:pw@host?tenant=my-tenant&auth_method=AAD_APP"
241240
"&extra__azure_data_explorer__auth_method=AAD_APP",
242241
):
243242
with pytest.warns(Warning, match="Using value for `auth_method`"):
244-
AzureDataExplorerHook(azure_data_explorer_conn_id="my_conn") # get_conn is called in init
245-
mock_with.assert_called_once_with("host", "usr", "pw", "my-tenant")
243+
hook = AzureDataExplorerHook(azure_data_explorer_conn_id="my_conn")
244+
assert hook.connection._kcsb.data_source == "host"
245+
assert hook.connection._kcsb.application_client_id == "usr"
246+
assert hook.connection._kcsb.application_key == "pw"
247+
assert hook.connection._kcsb.authority_id == "my-tenant"

0 commit comments

Comments
 (0)