Skip to content

Commit

Permalink
chore: Fix new ruff lints (#21040)
Browse files Browse the repository at this point in the history
  • Loading branch information
lukemanley authored Feb 2, 2025
1 parent 1678638 commit db712e4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 11 deletions.
1 change: 0 additions & 1 deletion py-polars/polars/sql/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 2 additions & 10 deletions py-polars/tests/unit/io/database/test_read.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit db712e4

Please sign in to comment.