Skip to content

Commit c597ba7

Browse files
committed
refactor: rename get_columns -> get_column_names
Less ambiguous, thinking `iter_columns` will be a better name to reserve for https://docs.pola.rs/api/python/stable/reference/dataframe/api/polars.DataFrame.iter_columns.html
1 parent 028098e commit c597ba7

File tree

11 files changed

+21
-21
lines changed

11 files changed

+21
-21
lines changed

narwhals/_arrow/namespace.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
from narwhals._expression_parsing import combine_evaluate_output_names
2727
from narwhals.typing import CompliantNamespace
2828
from narwhals.utils import Implementation
29-
from narwhals.utils import get_columns
29+
from narwhals.utils import get_column_names
3030
from narwhals.utils import import_dtypes_module
3131
from narwhals.utils import is_compliant_expr
3232

@@ -160,7 +160,7 @@ def all(self: Self) -> ArrowExpr:
160160
],
161161
depth=0,
162162
function_name="all",
163-
evaluate_output_names=get_columns,
163+
evaluate_output_names=get_column_names,
164164
alias_output_names=None,
165165
backend_version=self._backend_version,
166166
version=self._version,

narwhals/_arrow/selectors.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
from narwhals._arrow.expr import ArrowExpr
1111
from narwhals.utils import _parse_time_unit_and_time_zone
1212
from narwhals.utils import dtype_matches_time_unit_and_time_zone
13-
from narwhals.utils import get_columns
13+
from narwhals.utils import get_column_names
1414
from narwhals.utils import import_dtypes_module
1515

1616
if TYPE_CHECKING:
@@ -83,7 +83,7 @@ def all(self: Self) -> ArrowSelector:
8383
def func(df: ArrowDataFrame) -> list[ArrowSeries]:
8484
return [df[col] for col in df.columns]
8585

86-
return selector(self, func, get_columns)
86+
return selector(self, func, get_column_names)
8787

8888
def datetime(
8989
self: Self,

narwhals/_dask/namespace.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
from narwhals._expression_parsing import combine_alias_output_names
2525
from narwhals._expression_parsing import combine_evaluate_output_names
2626
from narwhals.typing import CompliantNamespace
27-
from narwhals.utils import get_columns
27+
from narwhals.utils import get_column_names
2828
from narwhals.utils import is_compliant_expr
2929

3030
if TYPE_CHECKING:
@@ -58,7 +58,7 @@ def func(df: DaskLazyFrame) -> list[dx.Series]:
5858
func,
5959
depth=0,
6060
function_name="all",
61-
evaluate_output_names=get_columns,
61+
evaluate_output_names=get_column_names,
6262
alias_output_names=None,
6363
backend_version=self._backend_version,
6464
version=self._version,

narwhals/_dask/selectors.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
from narwhals._dask.expr import DaskExpr
1111
from narwhals.utils import _parse_time_unit_and_time_zone
1212
from narwhals.utils import dtype_matches_time_unit_and_time_zone
13-
from narwhals.utils import get_columns
13+
from narwhals.utils import get_column_names
1414
from narwhals.utils import import_dtypes_module
1515

1616
if TYPE_CHECKING:
@@ -96,7 +96,7 @@ def all(self: Self) -> DaskSelector:
9696
def func(df: DaskLazyFrame) -> list[dx.Series]:
9797
return [df._native_frame[col] for col in df.columns]
9898

99-
return selector(self, func, get_columns)
99+
return selector(self, func, get_column_names)
100100

101101
def datetime(
102102
self: Self,

narwhals/_duckdb/namespace.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
from narwhals._expression_parsing import combine_alias_output_names
2525
from narwhals._expression_parsing import combine_evaluate_output_names
2626
from narwhals.typing import CompliantNamespace
27-
from narwhals.utils import get_columns
27+
from narwhals.utils import get_column_names
2828

2929
if TYPE_CHECKING:
3030
import duckdb
@@ -53,7 +53,7 @@ def _all(df: DuckDBLazyFrame) -> list[duckdb.Expression]:
5353
return DuckDBExpr(
5454
call=_all,
5555
function_name="all",
56-
evaluate_output_names=get_columns,
56+
evaluate_output_names=get_column_names,
5757
alias_output_names=None,
5858
backend_version=self._backend_version,
5959
version=self._version,

narwhals/_duckdb/selectors.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
from narwhals._duckdb.expr import DuckDBExpr
1313
from narwhals.utils import _parse_time_unit_and_time_zone
1414
from narwhals.utils import dtype_matches_time_unit_and_time_zone
15-
from narwhals.utils import get_columns
15+
from narwhals.utils import get_column_names
1616
from narwhals.utils import import_dtypes_module
1717

1818
if TYPE_CHECKING:
@@ -89,7 +89,7 @@ def all(self: Self) -> DuckDBSelector:
8989
def func(df: DuckDBLazyFrame) -> list[duckdb.Expression]:
9090
return [ColumnExpression(col) for col in df.columns]
9191

92-
return selector(self, func, get_columns)
92+
return selector(self, func, get_column_names)
9393

9494
def datetime(
9595
self: Self,

narwhals/_pandas_like/namespace.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
from narwhals._pandas_like.utils import horizontal_concat
2323
from narwhals._pandas_like.utils import vertical_concat
2424
from narwhals.typing import CompliantNamespace
25-
from narwhals.utils import get_columns
25+
from narwhals.utils import get_column_names
2626
from narwhals.utils import import_dtypes_module
2727
from narwhals.utils import is_compliant_expr
2828

@@ -135,7 +135,7 @@ def all(self: Self) -> PandasLikeExpr:
135135
],
136136
depth=0,
137137
function_name="all",
138-
evaluate_output_names=get_columns,
138+
evaluate_output_names=get_column_names,
139139
alias_output_names=None,
140140
implementation=self._implementation,
141141
backend_version=self._backend_version,

narwhals/_pandas_like/selectors.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
from narwhals._pandas_like.expr import PandasLikeExpr
1111
from narwhals.utils import _parse_time_unit_and_time_zone
1212
from narwhals.utils import dtype_matches_time_unit_and_time_zone
13-
from narwhals.utils import get_columns
13+
from narwhals.utils import get_column_names
1414
from narwhals.utils import import_dtypes_module
1515

1616
if TYPE_CHECKING:
@@ -84,7 +84,7 @@ def all(self: Self) -> PandasSelector:
8484
def func(df: PandasLikeDataFrame) -> list[PandasLikeSeries]:
8585
return [df[col] for col in df.columns]
8686

87-
return selector(self, func, get_columns)
87+
return selector(self, func, get_column_names)
8888

8989
def datetime(
9090
self: Self,

narwhals/_spark_like/namespace.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
from narwhals._spark_like.utils import maybe_evaluate_expr
1818
from narwhals._spark_like.utils import narwhals_to_native_dtype
1919
from narwhals.typing import CompliantNamespace
20-
from narwhals.utils import get_columns
20+
from narwhals.utils import get_column_names
2121

2222
if TYPE_CHECKING:
2323
from pyspark.sql import Column
@@ -52,7 +52,7 @@ def _all(df: SparkLikeLazyFrame) -> list[Column]:
5252
return SparkLikeExpr(
5353
call=_all,
5454
function_name="all",
55-
evaluate_output_names=get_columns,
55+
evaluate_output_names=get_column_names,
5656
alias_output_names=None,
5757
backend_version=self._backend_version,
5858
version=self._version,

narwhals/_spark_like/selectors.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
from narwhals._spark_like.expr import SparkLikeExpr
1111
from narwhals.utils import _parse_time_unit_and_time_zone
1212
from narwhals.utils import dtype_matches_time_unit_and_time_zone
13-
from narwhals.utils import get_columns
13+
from narwhals.utils import get_column_names
1414
from narwhals.utils import import_dtypes_module
1515

1616
if TYPE_CHECKING:
@@ -84,7 +84,7 @@ def all(self: Self) -> SparkLikeSelector:
8484
def func(df: SparkLikeLazyFrame) -> list[Column]:
8585
return [df._F.col(col) for col in df.columns]
8686

87-
return selector(self, func, get_columns)
87+
return selector(self, func, get_column_names)
8888

8989
def datetime(
9090
self: Self,

narwhals/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1305,7 +1305,7 @@ def dtype_matches_time_unit_and_time_zone(
13051305
)
13061306

13071307

1308-
def get_columns(df: NativeFrame) -> Sequence[str]:
1308+
def get_column_names(df: NativeFrame) -> Sequence[str]:
13091309
return df.columns
13101310

13111311

0 commit comments

Comments
 (0)