Skip to content

A reactive notebook for Python — run reproducible experiments, query with SQL, execute as a script, deploy as an app, and version with git. Stored as pure Python. All in a modern, AI-native editor.

chore: minor updates for narwhals 1.26 (#3740)

Marco Edward Gorellief01effedd7a
diff --git a/tests/_plugins/ui/_impl/tables/snapshots/narwhals.field_types.json b/tests/_plugins/ui/_impl/tables/snapshots/narwhals.field_types.json
index 18214c5655..2b1bbb5b9d 100644
--- a/tests/_plugins/ui/_impl/tables/snapshots/narwhals.field_types.json
+++ b/tests/_plugins/ui/_impl/tables/snapshots/narwhals.field_types.json
@@ -7,7 +7,7 @@
["date", ["date", "Date"]],
["struct", ["unknown", "Struct({'a': Int64, 'b': Int64})"]],
["list", ["unknown", "List(Int64)"]],
- ["array", ["unknown", "Array(Int64, 1)"]],
+ ["array", ["unknown", "Array(Int64, shape=(1,))"]],
["nulls", ["string", "String"]],
["category", ["string", "Categorical"]],
["set", ["unknown", "Object"]],
diff --git a/tests/_plugins/ui/_impl/tables/test_narwhals.py b/tests/_plugins/ui/_impl/tables/test_narwhals.py
index 7ba60ef229..178edeaab3 100644
--- a/tests/_plugins/ui/_impl/tables/test_narwhals.py
+++ b/tests/_plugins/ui/_impl/tables/test_narwhals.py
@@ -6,6 +6,7 @@ import unittest
from math import isnan
from typing import Any
+import narwhals.stable.v1 as nw
import pytest
from marimo._data.models import ColumnSummary
@@ -113,10 +114,9 @@ class TestNarwhalsTableManagerFactory(unittest.TestCase):
def test_to_csv(self) -> None:
assert isinstance(self.manager.to_csv(), bytes)
- import polars as pl
complex_data = self.get_complex_data()
- with pytest.raises(pl.exceptions.ComputeError):
+ with pytest.raises(nw.exceptions.NarwhalsError):
# Polars doesn't support writing nested lists to csv
complex_data.to_csv()
@@ -129,7 +129,7 @@ class TestNarwhalsTableManagerFactory(unittest.TestCase):
schema={"a": pl.Array(pl.Int64, 5)},
)
manager = NarwhalsTableManager.from_dataframe(df)
- with pytest.raises(pl.exceptions.ComputeError):
+ with pytest.raises(nw.exceptions.NarwhalsError):
# Polars doesn't support writing nested lists to csv
manager.to_csv()