Skip to content

Commit

Permalink
spark fix
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcoGorelli committed Jan 23, 2025
1 parent b88bcb4 commit b27bab0
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions narwhals/_spark_like/dataframe.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,15 +85,17 @@ def collect(self: Self) -> PandasLikeDataFrame:
version=self._version,
)

def simple_select(
self: Self,
*exprs: str,
) -> Self:
return self._from_native_frame(self._native_frame.select(*exprs))

def select(
self: Self,
*exprs: SparkLikeExpr,
**named_exprs: SparkLikeExpr,
) -> Self:
if exprs and all(isinstance(x, str) for x in exprs) and not named_exprs:
# This is a simple select
return self._from_native_frame(self._native_frame.select(*exprs))

new_columns = parse_exprs_and_named_exprs(self, *exprs, **named_exprs)

if not new_columns:
Expand Down

0 comments on commit b27bab0

Please sign in to comment.