Repository: narwhals-dev/narwhals

Issue:
err: replace msg = "Please set `allow_series=True`" with msg = "Please set `allow_series=True` or `series_only=True`"

Discussion:

Patch:
diff --git a/narwhals/translate.py b/narwhals/translate.py
index d439890c..075f9b3a 100644
--- a/narwhals/translate.py
+++ b/narwhals/translate.py
@@ -429,7 +429,7 @@ def _from_native_impl(  # noqa: PLR0915
     elif hasattr(native_object, "__narwhals_series__"):
         if not allow_series:
             if strict:
-                msg = "Please set `allow_series=True`"
+                msg = "Please set `allow_series=True` or `series_only=True`"
                 raise TypeError(msg)
             return native_object
         return Series(
@@ -477,7 +477,7 @@ def _from_native_impl(  # noqa: PLR0915
         pl = get_polars()
         if not allow_series:
             if strict:
-                msg = "Please set `allow_series=True`"
+                msg = "Please set `allow_series=True` or `series_only=True`"
                 raise TypeError(msg)
             return native_object
         return Series(
@@ -509,7 +509,7 @@ def _from_native_impl(  # noqa: PLR0915
     elif is_pandas_series(native_object):
         if not allow_series:
             if strict:
-                msg = "Please set `allow_series=True`"
+                msg = "Please set `allow_series=True` or `series_only=True`"
                 raise TypeError(msg)
             return native_object
         pd = get_pandas()
@@ -544,7 +544,7 @@ def _from_native_impl(  # noqa: PLR0915
         mpd = get_modin()
         if not allow_series:
             if strict:
-                msg = "Please set `allow_series=True`"
+                msg = "Please set `allow_series=True` or `series_only=True`"
                 raise TypeError(msg)
             return native_object
         return Series(
@@ -578,7 +578,7 @@ def _from_native_impl(  # noqa: PLR0915
         cudf = get_cudf()
         if not allow_series:
             if strict:
-                msg = "Please set `allow_series=True`"
+                msg = "Please set `allow_series=True` or `series_only=True`"
                 raise TypeError(msg)
             return native_object
         return Series(
@@ -611,7 +611,7 @@ def _from_native_impl(  # noqa: PLR0915
         pa = get_pyarrow()
         if not allow_series:
             if strict:
-                msg = "Please set `allow_series=True`"
+                msg = "Please set `allow_series=True` or `series_only=True`"
                 raise TypeError(msg)
             return native_object
         return Series(


Test patch:
diff --git a/tests/translate/from_native_test.py b/tests/translate/from_native_test.py
index 53a35087..e1fc4a59 100644
--- a/tests/translate/from_native_test.py
+++ b/tests/translate/from_native_test.py
@@ -134,7 +134,12 @@ def test_series_only(obj: Any, context: Any) -> None:
     ("allow_series", "context"),
     [
         (True, does_not_raise()),
-        (False, pytest.raises(TypeError, match="Please set `allow_series=True`")),
+        (
+            False,
+            pytest.raises(
+                TypeError, match="Please set `allow_series=True` or `series_only=True`"
+            ),
+        ),
     ],
 )
 def test_allow_series(series: Any, allow_series: Any, context: Any) -> None: