Skip to content

Commit

Permalink
Setting use_beeline by default for hive cli connection (#38763)
Browse files Browse the repository at this point in the history
Co-authored-by: Elad Kalif <45845474+eladkal@users.noreply.github.com>
Co-authored-by: Jarek Potiuk <jarek@potiuk.com>
  • Loading branch information
3 people committed Apr 9, 2024
1 parent 8822692 commit 6e0ac39
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 1 deletion.
10 changes: 10 additions & 0 deletions airflow/providers/apache/hive/CHANGELOG.rst
Expand Up @@ -27,6 +27,16 @@
Changelog
---------

8.0.0
.....


Breaking changes
~~~~~~~~~~~~~~~~

Changed the default value of ``use_beeline`` in hive cli connection to True.
Beeline will be always enabled by default in this connection type.

7.0.1
.....

Expand Down
2 changes: 1 addition & 1 deletion airflow/providers/apache/hive/hooks/hive.py
Expand Up @@ -126,7 +126,7 @@ def get_connection_form_widgets(cls) -> dict[str, Any]:
from wtforms import BooleanField, StringField

return {
"use_beeline": BooleanField(lazy_gettext("Use Beeline"), default=False),
"use_beeline": BooleanField(lazy_gettext("Use Beeline"), default=True),
"proxy_user": StringField(lazy_gettext("Proxy User"), widget=BS3TextFieldWidget(), default=""),
"principal": StringField(
lazy_gettext("Principal"), widget=BS3TextFieldWidget(), default="hive/_HOST@EXAMPLE.COM"
Expand Down
1 change: 1 addition & 0 deletions airflow/providers/apache/hive/provider.yaml
Expand Up @@ -25,6 +25,7 @@ state: ready
source-date-epoch: 1709554960
# note that those versions are maintained by release manager - do not update them manually
versions:
- 8.0.0
- 7.0.1
- 7.0.0
- 6.4.2
Expand Down
12 changes: 12 additions & 0 deletions tests/providers/apache/hive/hooks/test_hive.py
Expand Up @@ -870,6 +870,18 @@ class TestHiveCli:
def setup_method(self):
self.nondefault_schema = "nondefault"

def test_default_values(self):
hook = MockHiveCliHook()

assert hook.use_beeline
assert hook.auth is None
assert hook.sub_process is None
assert hook.mapred_queue == "airflow"
assert hook.mapred_queue_priority is None
assert hook.mapred_job_name is None
assert hook.proxy_user is None
assert not hook.high_availability

@pytest.mark.parametrize(
"extra_dejson, correct_proxy_user, proxy_user",
[
Expand Down

0 comments on commit 6e0ac39

Please sign in to comment.