diff --git a/UPDATING.md b/UPDATING.md index 3d42f2b3d4e..527c32f846b 100644 --- a/UPDATING.md +++ b/UPDATING.md @@ -114,7 +114,6 @@ DISTRIBUTED_COORDINATION_CONFIG = { ``` See `superset/config.py` for complete configuration options. - ### WebSocket config for GAQ with Docker [35896](https://github.com/apache/superset/pull/35896) and [37624](https://github.com/apache/superset/pull/37624) updated documentation on how to run and configure Superset with Docker. Specifically for the WebSocket configuration, a new `docker/superset-websocket/config.example.json` was added to the repo, so that users could copy it to create a `docker/superset-websocket/config.json` file. The existing `docker/superset-websocket/config.json` was removed and git-ignored, so if you're using GAQ / WebSocket make sure to: diff --git a/superset/engines/manager.py b/superset/engines/manager.py index ed6700d4884..1beb41929af 100644 --- a/superset/engines/manager.py +++ b/superset/engines/manager.py @@ -320,7 +320,8 @@ class EngineManager: uri = make_url_safe(database.sqlalchemy_uri_decrypted) extra = database.get_extra(source) - kwargs = extra.get("engine_params", {}) + # Make a copy to avoid mutating the original extra dict + kwargs = dict(extra.get("engine_params", {})) # get pool class if self.mode == EngineModes.NEW or "poolclass" not in kwargs: @@ -336,7 +337,7 @@ class EngineManager: kwargs["poolclass"] = pools.get(extra["poolclass"], pool.QueuePool) # update URI for specific catalog/schema - connect_args = extra.setdefault("connect_args", {}) + connect_args = dict(extra.get("connect_args", {})) uri, connect_args = database.db_engine_spec.adjust_engine_params( uri, connect_args, diff --git a/tests/unit_tests/engines/manager_test.py b/tests/unit_tests/engines/manager_test.py index 871624f2a42..dc5248d663a 100644 --- a/tests/unit_tests/engines/manager_test.py +++ b/tests/unit_tests/engines/manager_test.py @@ -22,7 +22,6 @@ from collections.abc import Iterator from unittest.mock import MagicMock, patch import pytest -from sqlalchemy.pool import NullPool from superset.engines.manager import _LockManager, EngineManager, EngineModes @@ -51,7 +50,7 @@ class TestLockManager: manager = _LockManager() # Create locks - lock1 = manager.get_lock("key1") + _ = manager.get_lock("key1") # noqa: F841 lock2 = manager.get_lock("key2") # Cleanup with only key1 active @@ -111,7 +110,7 @@ class TestEngineManager: """Create a mock database.""" database = MagicMock() database.sqlalchemy_uri_decrypted = "postgresql://user:pass@localhost/test" - database.get_extra.return_value = {"engine_params": {"poolclass": NullPool}} + database.get_extra.return_value = {"engine_params": {}} database.get_effective_user.return_value = "test_user" database.impersonate_user = False database.update_params_from_encrypted_extra = MagicMock() @@ -231,7 +230,7 @@ class TestEngineManager: ssh_tunnel.server_address = "ssh.example.com" ssh_tunnel.server_port = 22 ssh_tunnel.username = "ssh_user" - ssh_tunnel.password = "ssh_pass" + ssh_tunnel.password = "ssh_pass" # noqa: S105 ssh_tunnel.private_key = None ssh_tunnel.private_key_password = None @@ -266,7 +265,7 @@ class TestEngineManager: ssh_tunnel.server_address = "ssh.example.com" ssh_tunnel.server_port = 22 ssh_tunnel.username = "ssh_user" - ssh_tunnel.password = "ssh_pass" + ssh_tunnel.password = "ssh_pass" # noqa: S105 ssh_tunnel.private_key = None ssh_tunnel.private_key_password = None diff --git a/tests/unit_tests/sql/execution/conftest.py b/tests/unit_tests/sql/execution/conftest.py index 630f6884529..fba41e6e376 100644 --- a/tests/unit_tests/sql/execution/conftest.py +++ b/tests/unit_tests/sql/execution/conftest.py @@ -202,7 +202,6 @@ def setup_mock_raw_connection( def _raw_connection( catalog: str | None = None, schema: str | None = None, - nullpool: bool = True, source: Any | None = None, ): yield mock_connection