mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-10-07 06:46:35 +00:00
Fix: connector for hive has double dash (#7953)
This commit is contained in:
parent
7deebe8a2c
commit
cd43f1fdcf
@ -340,9 +340,6 @@ def _(connection: HiveConnection):
|
|||||||
)
|
)
|
||||||
|
|
||||||
if options:
|
if options:
|
||||||
if not connection.databaseSchema:
|
|
||||||
url += "/"
|
|
||||||
url += "/"
|
|
||||||
params = "&".join(
|
params = "&".join(
|
||||||
f"{key}={quote_plus(value)}" for (key, value) in options.items() if value
|
f"{key}={quote_plus(value)}" for (key, value) in options.items() if value
|
||||||
)
|
)
|
||||||
|
@ -143,6 +143,23 @@ class SouceConnectionTest(TestCase):
|
|||||||
)
|
)
|
||||||
assert expected_result == get_connection_url(hive_conn_obj)
|
assert expected_result == get_connection_url(hive_conn_obj)
|
||||||
|
|
||||||
|
def test_hive_url_conn_options_with_db(self):
|
||||||
|
expected_result = "hive://localhost:10000/test_db?Key=Value"
|
||||||
|
hive_conn_obj = HiveConnection(
|
||||||
|
hostPort="localhost:10000",
|
||||||
|
databaseSchema="test_db",
|
||||||
|
connectionOptions={"Key": "Value"},
|
||||||
|
)
|
||||||
|
assert expected_result == get_connection_url(hive_conn_obj)
|
||||||
|
|
||||||
|
def test_hive_url_conn_options_without_db(self):
|
||||||
|
expected_result = "hive://localhost:10000?Key=Value"
|
||||||
|
hive_conn_obj = HiveConnection(
|
||||||
|
hostPort="localhost:10000",
|
||||||
|
connectionOptions={"Key": "Value"},
|
||||||
|
)
|
||||||
|
assert expected_result == get_connection_url(hive_conn_obj)
|
||||||
|
|
||||||
def test_hive_url_with_kerberos_auth(self):
|
def test_hive_url_with_kerberos_auth(self):
|
||||||
expected_result = "hive://localhost:10000"
|
expected_result = "hive://localhost:10000"
|
||||||
hive_conn_obj = HiveConnection(
|
hive_conn_obj = HiveConnection(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user