fix: make auth for hive optional (#10172)

* fix: make auth for hive optional

This will make allow the admin to setup a root connection which can be impersonated.

* style: black lint conform

* style: clean up unnecessary condition expansion
This commit is contained in:
Hendrik Schultze 2020-06-29 06:40:24 +02:00 committed by GitHub
parent 9bdfa055ac
commit 6a8f441d54
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 7 deletions

View File

@ -437,14 +437,9 @@ class HiveEngineSpec(PrestoEngineSpec):
url = make_url(uri)
backend_name = url.get_backend_name()
# Must be Hive connection, enable impersonation, and set param
# Must be Hive connection, enable impersonation, and set optional param
# auth=LDAP|KERBEROS
if (
backend_name == "hive"
and "auth" in url.query.keys()
and impersonate_user is True
and username is not None
):
if backend_name == "hive" and impersonate_user and username is not None:
configuration["hive.server2.proxy.user"] = username
return configuration