Skip to content

Commit fa3ea34

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 1f1a857 commit fa3ea34

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

narwhals/_pandas_like/namespace.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -362,9 +362,7 @@ def func(df: PandasLikeDataFrame) -> list[PandasLikeSeries]:
362362
f"found value of type {type(v).__name__}: {v}\n\n"
363363
f"Hint: ensure all values in each column have the same dtype."
364364
)
365-
raise TypeError(
366-
msg
367-
)
365+
raise TypeError(msg)
368366
df_arrow = df.convert_dtypes(dtype_backend="pyarrow")
369367
arrays = [df_arrow[col].array._pa_array for col in df.columns]
370368
struct_array = pc.make_struct(*arrays, field_names=df.columns)

tests/expr_and_series/struct_test.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
data = {"a": [1, 2, 3], "b": ["dogs", "cats", None], "c": ["play", "swim", "walk"]}
1111

12+
1213
def test_struct(constructor: Constructor, *, request: pytest.FixtureRequest) -> None:
1314
if "polars" in str(constructor) and POLARS_VERSION < (1, 0, 0):
1415
request.applymarker(pytest.mark.xfail)
@@ -24,8 +25,8 @@ def test_struct(constructor: Constructor, *, request: pytest.FixtureRequest) ->
2425
"struct": [
2526
{"a": 1, "b": "dogs", "c": "play"},
2627
{"a": 2, "b": "cats", "c": "swim"},
27-
{"a": 3, "b": None, "c": "walk"},
28+
{"a": 3, "b": None, "c": "walk"},
2829
]
2930
}
3031

31-
assert_equal_data(result, expected)
32+
assert_equal_data(result, expected)

0 commit comments

Comments
 (0)