diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 945b043e9..6948c21ee 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -3,7 +3,7 @@ ci: repos: - repo: https://github.com/astral-sh/ruff-pre-commit # Ruff version. - rev: 'v0.7.2' + rev: 'v0.8.1' hooks: # Run the formatter. - id: ruff-format @@ -79,10 +79,6 @@ repos: narwhals/.*__init__.py| narwhals/.*typing\.py ) -- repo: https://github.com/kynan/nbstripout - rev: 0.8.0 - hooks: - - id: nbstripout - repo: https://github.com/adamchainz/blacken-docs rev: "1.19.1" # replace with latest tag on GitHub hooks: diff --git a/narwhals/__init__.py b/narwhals/__init__.py index 7b2b017ba..815c0675f 100644 --- a/narwhals/__init__.py +++ b/narwhals/__init__.py @@ -31,22 +31,22 @@ from narwhals.dtypes import UInt64 from narwhals.dtypes import Unknown from narwhals.expr import Expr -from narwhals.expr import all_ as all +from narwhals.expr import all_ as all # noqa: A004 from narwhals.expr import all_horizontal from narwhals.expr import any_horizontal from narwhals.expr import col from narwhals.expr import concat_str -from narwhals.expr import len_ as len +from narwhals.expr import len_ as len # noqa: A004 from narwhals.expr import lit -from narwhals.expr import max +from narwhals.expr import max # noqa: A004 from narwhals.expr import max_horizontal from narwhals.expr import mean from narwhals.expr import mean_horizontal from narwhals.expr import median -from narwhals.expr import min +from narwhals.expr import min # noqa: A004 from narwhals.expr import min_horizontal from narwhals.expr import nth -from narwhals.expr import sum +from narwhals.expr import sum # noqa: A004 from narwhals.expr import sum_horizontal from narwhals.expr import when from narwhals.functions import concat diff --git a/narwhals/stable/v1/selectors.py b/narwhals/stable/v1/selectors.py index 0d82484e9..1545810e2 100644 --- a/narwhals/stable/v1/selectors.py +++ b/narwhals/stable/v1/selectors.py @@ -1,6 +1,6 @@ from __future__ import annotations -from narwhals.selectors import all +from narwhals.selectors import all # noqa: A004 from narwhals.selectors import boolean from narwhals.selectors import by_dtype from narwhals.selectors import categorical diff --git a/pyproject.toml b/pyproject.toml index e4c59b50a..5b191861b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -54,7 +54,6 @@ lint.select = [ lint.ignore = [ "A001", "ARG002", - "ANN101", "ANN401", "C901", "COM812", diff --git a/tests/selectors_test.py b/tests/selectors_test.py index 8a2194caf..9fba60166 100644 --- a/tests/selectors_test.py +++ b/tests/selectors_test.py @@ -5,7 +5,7 @@ import pytest import narwhals.stable.v1 as nw -from narwhals.stable.v1.selectors import all +from narwhals.stable.v1.selectors import all # noqa: A004 from narwhals.stable.v1.selectors import boolean from narwhals.stable.v1.selectors import by_dtype from narwhals.stable.v1.selectors import categorical diff --git a/tests/utils.py b/tests/utils.py index 95ccda816..fb8b28a92 100644 --- a/tests/utils.py +++ b/tests/utils.py @@ -63,10 +63,9 @@ def assert_equal_data(result: Any, expected: dict[str, Any]) -> None: for key in result.columns: assert key in expected, (key, expected) result = {key: _to_comparable_list(result[key]) for key in expected} - for key in expected: - result_key = result[key] - expected_key = expected[key] - for i, (lhs, rhs) in enumerate(zip_strict(result_key, expected_key)): + for key, expected_value in expected.items(): + result_value = result[key] + for i, (lhs, rhs) in enumerate(zip_strict(result_value, expected_value)): if isinstance(lhs, float) and not math.isnan(lhs): are_equivalent_values = math.isclose(lhs, rhs, rel_tol=0, abs_tol=1e-6) elif isinstance(lhs, float) and math.isnan(lhs) and rhs is not None: