diff --git a/py-polars/polars/sql/context.py b/py-polars/polars/sql/context.py index c48290e547c4..f85e535a1386 100644 --- a/py-polars/polars/sql/context.py +++ b/py-polars/polars/sql/context.py @@ -203,7 +203,6 @@ def __init__( if register_globals: for name, obj in _get_frame_locals( all_compatible=False, - n_objects=None if (register_globals is True) else None, ).items(): if name not in frames and name not in named_frames: named_frames[name] = obj diff --git a/py-polars/tests/unit/io/database/test_read.py b/py-polars/tests/unit/io/database/test_read.py index cb1a10a21c2a..176ba2b3e857 100644 --- a/py-polars/tests/unit/io/database/test_read.py +++ b/py-polars/tests/unit/io/database/test_read.py @@ -738,16 +738,8 @@ def test_read_database_duplicate_column_error(tmp_sqlite_db: Path, query: str) - ], ) def test_read_database_cx_credentials(uri: str) -> None: - if sys.version_info > (3, 9, 4): - # slightly different error on more recent Python versions - with pytest.raises(RuntimeError, match=r"Source.*not supported"): - pl.read_database_uri("SELECT * FROM data", uri=uri, engine="connectorx") - else: - # check that we masked the potential credentials leak; this isn't really - # our responsibility (ideally would be handled by connectorx), but we - # can reasonably mitigate the issue. - with pytest.raises(BaseException, match=r"fakedb://\*\*\*:\*\*\*@\w+"): - pl.read_database_uri("SELECT * FROM data", uri=uri, engine="connectorx") + with pytest.raises(RuntimeError, match=r"Source.*not supported"): + pl.read_database_uri("SELECT * FROM data", uri=uri, engine="connectorx") @pytest.mark.skipif(