Skip to content

Commit

Permalink
chore: make from_iterable private (#399)
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcoGorelli authored Jul 4, 2024
1 parent 7f8657d commit 14b2a7b
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion narwhals/_arrow/namespace.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
)
Expand Down
2 changes: 1 addition & 1 deletion narwhals/_arrow/series.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
6 changes: 3 additions & 3 deletions narwhals/_pandas_like/namespace.py
Original file line number Diff line number Diff line change
Expand Up @@ -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],
Expand Down Expand Up @@ -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],
Expand Down Expand Up @@ -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],
Expand Down
2 changes: 1 addition & 1 deletion narwhals/_pandas_like/series.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 14b2a7b

Please sign in to comment.