Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setting use_beeline by default for hive cli connection #38763

Merged
merged 11 commits into from
Apr 9, 2024
10 changes: 10 additions & 0 deletions airflow/providers/apache/hive/CHANGELOG.rst
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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