chore: upgrade SQLAlchemy to 1.4 (#19890)

* chore: upgrade SQLAlchemy

* Convert integration test to unit test

* Fix SQLite

* Update method names/docstrings

* Skip test

* Fix SQLite
This commit is contained in:
Beto Dealmeida
2022-07-18 15:21:38 -07:00
committed by GitHub
parent 90600d1883
commit e60083b45b
32 changed files with 656 additions and 255 deletions

View File

@@ -22,7 +22,7 @@ from pytest import raises
def test_odbc_impersonation(app_context: AppContext) -> None:
"""
Test ``modify_url_for_impersonation`` method when driver == odbc.
Test ``get_url_for_impersonation`` method when driver == odbc.
The method adds the parameter ``DelegationUID`` to the query string.
"""
@@ -32,13 +32,13 @@ def test_odbc_impersonation(app_context: AppContext) -> None:
url = URL("drill+odbc")
username = "DoAsUser"
DrillEngineSpec.modify_url_for_impersonation(url, True, username)
url = DrillEngineSpec.get_url_for_impersonation(url, True, username)
assert url.query["DelegationUID"] == username
def test_jdbc_impersonation(app_context: AppContext) -> None:
"""
Test ``modify_url_for_impersonation`` method when driver == jdbc.
Test ``get_url_for_impersonation`` method when driver == jdbc.
The method adds the parameter ``impersonation_target`` to the query string.
"""
@@ -48,13 +48,13 @@ def test_jdbc_impersonation(app_context: AppContext) -> None:
url = URL("drill+jdbc")
username = "DoAsUser"
DrillEngineSpec.modify_url_for_impersonation(url, True, username)
url = DrillEngineSpec.get_url_for_impersonation(url, True, username)
assert url.query["impersonation_target"] == username
def test_sadrill_impersonation(app_context: AppContext) -> None:
"""
Test ``modify_url_for_impersonation`` method when driver == sadrill.
Test ``get_url_for_impersonation`` method when driver == sadrill.
The method adds the parameter ``impersonation_target`` to the query string.
"""
@@ -64,13 +64,13 @@ def test_sadrill_impersonation(app_context: AppContext) -> None:
url = URL("drill+sadrill")
username = "DoAsUser"
DrillEngineSpec.modify_url_for_impersonation(url, True, username)
url = DrillEngineSpec.get_url_for_impersonation(url, True, username)
assert url.query["impersonation_target"] == username
def test_invalid_impersonation(app_context: AppContext) -> None:
"""
Test ``modify_url_for_impersonation`` method when driver == foobar.
Test ``get_url_for_impersonation`` method when driver == foobar.
The method raises an exception because impersonation is not supported
for drill+foobar.
@@ -84,4 +84,4 @@ def test_invalid_impersonation(app_context: AppContext) -> None:
username = "DoAsUser"
with raises(SupersetDBAPIProgrammingError):
DrillEngineSpec.modify_url_for_impersonation(url, True, username)
DrillEngineSpec.get_url_for_impersonation(url, True, username)