diff --git a/narwhals/dataframe.py b/narwhals/dataframe.py index f95c83d2e..3de3cc6e4 100644 --- a/narwhals/dataframe.py +++ b/narwhals/dataframe.py @@ -60,9 +60,7 @@ def _extract_native(self, arg: Any) -> Any: return arg._series if isinstance(arg, Expr): return arg._call(self.__narwhals_namespace__()) - if (pl := get_polars()) is not None and isinstance( - arg, (pl.Series, pl.DataFrame, pl.LazyFrame, type(pl.col(""))) - ): + if get_polars() is not None and "polars" in str(type(arg)): msg = ( f"Expected Narwhals object, got: {type(arg)}.\n\n" "Perhaps you:\n"