Skip to content

ci: bump ruff==0.15.0#3449

Merged
MarcoGorelli merged 10 commits intomainfrom
bump-ruff-0.15.0
Feb 6, 2026
Merged

ci: bump ruff==0.15.0#3449
MarcoGorelli merged 10 commits intomainfrom
bump-ruff-0.15.0

Conversation

@dangotbanned
Copy link
Member

@dangotbanned dangotbanned commented Feb 4, 2026

Description

See fancy blog post for changes https://astral.sh/blog/ruff-v0.15.0

How does that impact us?
See (chore(ruff): Ignore new issues) and (style(ruff): Run new style guide)

Related issues

@dangotbanned
Copy link
Member Author

Note

Unrelated TPCH failure, see #3450

@dangotbanned dangotbanned added the ci label Feb 4, 2026
@dangotbanned dangotbanned marked this pull request as ready for review February 4, 2026 12:52
assert dtype == nw.List(nw.List(nw.Int64))
assert dtype == nw.List
assert dtype != nw.List(nw.List(nw.Float32))
assert dtype in {nw.List(nw.List(nw.Int64))}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are we sure about changing this? wouldn't we still want to test that assert dtype in {nw.List(nw.List(nw.Int64))} passes?

like this it feels like we're testing implementation details, it may be better to just noqa it?

Copy link
Member Author

@dangotbanned dangotbanned Feb 4, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about a function (with whatever in it), that has a name more fitting to the test?

E.g.

-    assert dtype in {nw.List(nw.List(nw.Int64))}
+    assert_hash_equals(dtype, nw.List(nw.List(nw.Int64)))

I actually applied the auto-fix first, before realizing it changed the thing we test.

That seems like a pretty easy mistake to make and I might not have caught it without knowing the implementation detail 😅

Edit:
How easy it is to make that mistake?

Well I managed to do it in the same commit by only getting the first one right 🤦‍♂️

narwhals/tests/v1_test.py

Lines 534 to 537 in b144f1e

assert hash(dtype) == hash(nw_v1.Datetime)
assert isinstance(dtype, nw_v1.Datetime)
dtype = df.lazy().schema["c"]
assert dtype == nw_v1.Duration

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure!

Copy link
Member Author

@dangotbanned dangotbanned Feb 4, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hopefully this'll do 🙂 (6d5e3d5)

>       assert_equal_hash(dtype, nw.Enum(["a", "b", "c"]))
E       AssertionError: inputs do not compare equal by `__hash__`
E       [left]: Enum(categories=['a', 'b'])
E       [right]: Enum(categories=['a', 'b', 'c'])

tests/dtypes/dtypes_test.py:548: AssertionError

Based on what's in narwhals.tests

Copy link
Member

@MarcoGorelli MarcoGorelli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks @dangotbanned !

def _with_binary(
self, call: Callable[[dx.Series, Any], dx.Series], other: Any
) -> Self:
return self._with_callable(lambda expr, other: call(expr, other), other=other)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😄 nice

@MarcoGorelli MarcoGorelli merged commit 092c1c3 into main Feb 6, 2026
34 of 36 checks passed
@MarcoGorelli MarcoGorelli deleted the bump-ruff-0.15.0 branch February 6, 2026 16:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants