Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions airflow/providers/apache/impala/provider.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,8 @@ hooks:
connection-types:
- hook-class-name: airflow.providers.apache.impala.hooks.impala.ImpalaHook
connection-type: impala

additional-extras:
- name: kerberos
dependencies:
- kerberos>=1.3.0
25 changes: 25 additions & 0 deletions tests/providers/apache/impala/hooks/test_impala.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,31 @@ def test_get_conn(mock_connect):
)


@patch("airflow.providers.apache.impala.hooks.impala.connect", autospec=True)
def test_get_conn_kerberos(mock_connect):
hook = ImpalaHook()
hook.get_connection = MagicMock(
return_value=Connection(
login="login",
password="password",
host="host",
port=21050,
schema="test",
extra={"auth_mechanism": "GSSAPI", "use_ssl": True},
)
)
hook.get_conn()
mock_connect.assert_called_once_with(
host="host",
port=21050,
user="login",
password="password",
database="test",
use_ssl=True,
auth_mechanism="GSSAPI",
)


@patch("airflow.providers.common.sql.hooks.sql.DbApiHook.insert_rows")
def test_insert_rows(mock_insert_rows, impala_hook_fixture):
table = "table"
Expand Down