Skip to content

Commit

Permalink
fix: Always collect Iterator[IntoExpr] in utils.flatten
Browse files Browse the repository at this point in the history
  • Loading branch information
dangotbanned committed Feb 4, 2025
1 parent 4a2ca52 commit 50b56de
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions narwhals/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -387,11 +387,7 @@ def remove_suffix(text: str, suffix: str) -> str: # pragma: no cover


def flatten(args: Any) -> list[Any]:
if not args:
return []
if len(args) == 1 and _is_iterable(args[0]):
return args[0] # type: ignore[no-any-return]
return args # type: ignore[no-any-return]
return list(args[0] if (len(args) == 1 and _is_iterable(args[0])) else args)


def tupleify(arg: Any) -> Any:
Expand Down

0 comments on commit 50b56de

Please sign in to comment.