Skip to content

Commit

Permalink
Add kerberos dependency to Impala Provider (#32304)
Browse files Browse the repository at this point in the history
  • Loading branch information
Joffreybvn committed Jul 4, 2023
1 parent c2b9fcc commit bc3b2d1
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
5 changes: 5 additions & 0 deletions airflow/providers/apache/impala/provider.yaml
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
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

0 comments on commit bc3b2d1

Please sign in to comment.