Skip to content

Commit 1e962df

Browse files
committed
chore: Remove deprecated nw.from_native(..., strict=True)
Spotted during an upstream integration test - narwhals-dev/narwhals#2110 (comment) IIRC, I added `strict` before it was [deprecated](https://narwhals-dev.github.io/narwhals/backcompat/#breaking-changes-carried-out-so-far) to help match an `@overload`. Since then, the `@overload` definitions in `narwhals` have improved - meaning the default **doesn't** need to be passed in for us to get it typing correctly # Related - #3693 - narwhals-dev/narwhals#2110
1 parent a196172 commit 1e962df

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

altair/utils/schemapi.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -494,7 +494,7 @@ def _subclasses(cls: type[Any]) -> Iterator[type[Any]]:
494494

495495
def _from_array_like(obj: Iterable[Any], /) -> list[Any]:
496496
try:
497-
ser = nw.from_native(obj, strict=True, series_only=True)
497+
ser = nw.from_native(obj, series_only=True)
498498
return ser.to_list()
499499
except TypeError:
500500
return list(obj)

tests/test_transformed_data.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ def test_primitive_chart_examples(filename, rows, cols, to_reconstruct):
9292
chart = alt.Chart.from_dict(chart.to_dict())
9393
df = chart.transformed_data()
9494
assert df is not None
95-
nw_df = nw.from_native(df, eager_only=True, strict=True)
95+
nw_df = nw.from_native(df, eager_only=True)
9696

9797
assert len(nw_df) == rows
9898
assert set(cols).issubset(set(nw_df.columns))
@@ -157,7 +157,7 @@ def test_compound_chart_examples(filename, all_rows, all_cols, to_reconstruct):
157157
# is that for some charts, the original chart contained duplicated datasets
158158
# which disappear when reconstructing the chart.
159159

160-
nw_dfs = (nw.from_native(d, eager_only=True, strict=True) for d in dfs)
160+
nw_dfs = (nw.from_native(d, eager_only=True) for d in dfs)
161161
assert len(dfs) == len(all_rows)
162162
for df, rows, cols in zip(nw_dfs, all_rows, all_cols):
163163
assert len(df) == rows
@@ -185,7 +185,7 @@ def test_transformed_data_exclude(to_reconstruct):
185185
assert isinstance(chart, alt.LayerChart)
186186
datasets = chart.transformed_data(exclude=["some_annotation"])
187187

188-
_datasets = [nw.from_native(d, eager_only=True, strict=True) for d in datasets]
188+
_datasets = [nw.from_native(d, eager_only=True) for d in datasets]
189189
assert len(datasets) == len(_datasets)
190190
assert len(_datasets) == 2
191191
assert len(_datasets[0]) == 52

tools/schemapi/schemapi.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -492,7 +492,7 @@ def _subclasses(cls: type[Any]) -> Iterator[type[Any]]:
492492

493493
def _from_array_like(obj: Iterable[Any], /) -> list[Any]:
494494
try:
495-
ser = nw.from_native(obj, strict=True, series_only=True)
495+
ser = nw.from_native(obj, series_only=True)
496496
return ser.to_list()
497497
except TypeError:
498498
return list(obj)

0 commit comments

Comments
 (0)