This is an automated email from the ASF dual-hosted git repository. johnbodley pushed a commit to branch john-bodley-patch-2 in repository https://gitbox.apache.org/repos/asf/superset.git
commit e84e13472bfef33d6763e98a9795e232deac0dbc Author: John Bodley <[email protected]> AuthorDate: Mon Oct 2 11:46:33 2023 -0700 fix: Address Mypy issue which is causing CI to fail --- tests/unit_tests/db_engine_specs/test_clickhouse.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/unit_tests/db_engine_specs/test_clickhouse.py b/tests/unit_tests/db_engine_specs/test_clickhouse.py index 6dfeddaf37..7fec9e07fc 100644 --- a/tests/unit_tests/db_engine_specs/test_clickhouse.py +++ b/tests/unit_tests/db_engine_specs/test_clickhouse.py @@ -20,6 +20,8 @@ from typing import Any, Optional from unittest.mock import Mock import pytest +from urllib3.connection import HTTPConnection +from urllib3.exceptions import NewConnectionError from sqlalchemy.types import ( Boolean, Date, @@ -56,14 +58,12 @@ def test_convert_dttm( def test_execute_connection_error() -> None: - from urllib3.exceptions import NewConnectionError - from superset.db_engine_specs.clickhouse import ClickHouseEngineSpec from superset.db_engine_specs.exceptions import SupersetDBAPIDatabaseError cursor = Mock() cursor.execute.side_effect = NewConnectionError( - "Dummypool", "Exception with sensitive data" + HTTPConnection("localhost"), "Exception with sensitive data" ) with pytest.raises(SupersetDBAPIDatabaseError) as ex: ClickHouseEngineSpec.execute(cursor, "SELECT col1 from table1")
