diff --git a/narwhals/_arrow/namespace.py b/narwhals/_arrow/namespace.py index 266fbc68f..ecdffc2e5 100644 --- a/narwhals/_arrow/namespace.py +++ b/narwhals/_arrow/namespace.py @@ -70,7 +70,7 @@ def _create_expr_from_series(self, series: ArrowSeries) -> ArrowExpr: def _create_series_from_scalar(self, value: Any, series: ArrowSeries) -> ArrowSeries: from narwhals._arrow.series import ArrowSeries - return ArrowSeries.from_iterable( + return ArrowSeries._from_iterable( [value], name=series.name, ) diff --git a/narwhals/_arrow/series.py b/narwhals/_arrow/series.py index dd0791f4c..66a3aa1b6 100644 --- a/narwhals/_arrow/series.py +++ b/narwhals/_arrow/series.py @@ -35,7 +35,7 @@ def _from_series(self, series: Any) -> Self: ) @classmethod - def from_iterable(cls: type[Self], data: Iterable[Any], name: str) -> Self: + def _from_iterable(cls: type[Self], data: Iterable[Any], name: str) -> Self: return cls( native_series_from_iterable( data, name=name, index=None, implementation="arrow" diff --git a/narwhals/_pandas_like/namespace.py b/narwhals/_pandas_like/namespace.py index e90a197a2..5227f22c3 100644 --- a/narwhals/_pandas_like/namespace.py +++ b/narwhals/_pandas_like/namespace.py @@ -70,7 +70,7 @@ def _create_expr_from_callable( # noqa: PLR0913 def _create_series_from_scalar( self, value: Any, series: PandasSeries ) -> PandasSeries: - return PandasSeries.from_iterable( + return PandasSeries._from_iterable( [value], name=series._series.name, index=series._series.index[0:1], @@ -111,7 +111,7 @@ def all(self) -> PandasExpr: def lit(self, value: Any, dtype: dtypes.DType | None) -> PandasExpr: def _lit_pandas_series(df: PandasDataFrame) -> PandasSeries: - pandas_series = PandasSeries.from_iterable( + pandas_series = PandasSeries._from_iterable( data=[value], name="lit", index=df._dataframe.index[0:1], @@ -154,7 +154,7 @@ def min(self, *column_names: str) -> PandasExpr: def len(self) -> PandasExpr: return PandasExpr( lambda df: [ - PandasSeries.from_iterable( + PandasSeries._from_iterable( [len(df._dataframe)], name="len", index=[0], diff --git a/narwhals/_pandas_like/series.py b/narwhals/_pandas_like/series.py index 620fb3b73..001c899aa 100644 --- a/narwhals/_pandas_like/series.py +++ b/narwhals/_pandas_like/series.py @@ -127,7 +127,7 @@ def _from_series(self, series: Any) -> Self: ) @classmethod - def from_iterable( + def _from_iterable( cls: type[Self], data: Iterable[Any], name: str, index: Any, implementation: str ) -> Self: return cls(