Repository: narwhals-dev/narwhals

Issue:
[Enh]: Raise error for improper combinations of objects in the from_native function
### Please describe the purpose of the new feature or describe the problem to solve.

See this [snippet](https://github.com/narwhals-dev/narwhals/blob/c904b102bd95dec026ce756cecfda15dabe71f41/narwhals/translate.py#L262-L264)


Discussion:
MarcoGorelli: cool, thanks both! 🙏 

Patch:
diff --git a/narwhals/translate.py b/narwhals/translate.py
index e85caa2e..61653095 100644
--- a/narwhals/translate.py
+++ b/narwhals/translate.py
@@ -258,8 +258,10 @@ def from_native(  # noqa: PLR0915
     from narwhals.utils import parse_version
 
     if series_only:
+        if allow_series is False:
+            msg = "Invalid parameter combination: `series_only=True` and `allow_series=False`"
+            raise ValueError(msg)
         allow_series = True
-    # TODO(Unassigned): raise on invalid combinations
 
     if (pl := get_polars()) is not None and isinstance(native_object, pl.DataFrame):
         if series_only:


Test patch:
diff --git a/tests/translate/from_native_test.py b/tests/translate/from_native_test.py
index b4a25246..5825f592 100644
--- a/tests/translate/from_native_test.py
+++ b/tests/translate/from_native_test.py
@@ -135,6 +135,14 @@ def test_allow_series(series: Any, allow_series: Any, context: Any) -> None:
         assert isinstance(res, nw.Series)
 
 
+def test_invalid_series_combination() -> None:
+    with pytest.raises(
+        ValueError,
+        match="Invalid parameter combination: `series_only=True` and `allow_series=False`",
+    ):
+        nw.from_native(MockSeries(), series_only=True, allow_series=False)  # type: ignore[call-overload]
+
+
 def test_pandas_like_validate() -> None:
     df1 = pd.DataFrame({"a": [1, 2, 3]})
     df2 = pd.DataFrame({"b": [1, 2, 3]})