Skip to content

Commit

Permalink
[pre-commit.ci] pre-commit autoupdate (#1487)
Browse files Browse the repository at this point in the history

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Marco Gorelli <[email protected]>
  • Loading branch information
pre-commit-ci[bot] and MarcoGorelli authored Dec 2, 2024
1 parent 37638d2 commit a5c3e45
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 17 deletions.
6 changes: 1 addition & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down
10 changes: 5 additions & 5 deletions narwhals/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion narwhals/stable/v1/selectors.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ lint.select = [
lint.ignore = [
"A001",
"ARG002",
"ANN101",
"ANN401",
"C901",
"COM812",
Expand Down
2 changes: 1 addition & 1 deletion tests/selectors_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 3 additions & 4 deletions tests/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit a5c3e45

Please sign in to comment.