Skip to content

Commit ed29904

Browse files
authored
chore: use is_scalar_like in apply_n_ary_operation (#2242)
* chore: use is_scalar_like in apply_n_ary_operation * updadte readme
1 parent 275c5b6 commit ed29904

File tree

3 files changed

+9
-8
lines changed

3 files changed

+9
-8
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414

1515
Extremely lightweight and extensible compatibility layer between dataframe libraries!
1616

17-
- **Full API support**: cuDF, Modin, pandas, Polars, PyArrow
18-
- **Lazy-only support**: Dask. Work in progress: DuckDB, Ibis, PySpark.
17+
- **Full API support**: cuDF, Modin, pandas, Polars, PyArrow.
18+
- **Lazy-only support**: Dask, SQLFrame, PySpark. Work in progress: DuckDB, Ibis.
1919

2020
Seamlessly support all, without depending on any!
2121

docs/index.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@
55
[![PyPI version](https://badge.fury.io/py/narwhals.svg)](https://badge.fury.io/py/narwhals)
66
[![Downloads](https://static.pepy.tech/badge/narwhals/month)](https://pepy.tech/project/narwhals)
77
[![Trusted publishing](https://img.shields.io/badge/Trusted_publishing-Provides_attestations-bright_green)](https://peps.python.org/pep-0740/)
8+
[![PYPI - Types](https://img.shields.io/pypi/types/narwhals)](https://pypi.org/project/narwhals)
89

910
Extremely lightweight and extensible compatibility layer between dataframe libraries!
1011

11-
- **Full API support**: cuDF, Modin, pandas, Polars, PyArrow
12-
- **Lazy-only support**: Dask
13-
- **Interchange-level support**: DuckDB, Ibis, Vaex, anything which implements the DataFrame Interchange Protocol
12+
- **Full API support**: cuDF, Modin, pandas, Polars, PyArrow.
13+
- **Lazy-only support**: Dask, SQLFrame, PySpark. Work in progress: DuckDB, Ibis.
1414

1515
Seamlessly support all, without depending on any!
1616

narwhals/_expression_parsing.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,9 @@ def __init_subclass__(cls, /, *args: Any, **kwds: Any) -> Never: # pragma: no c
195195
msg = f"Cannot subclass {cls.__name__!r}"
196196
raise TypeError(msg)
197197

198+
def __repr__(self) -> str:
199+
return f"ExprMetadata(kind: {self._kind}, n_open_windows: {self._n_open_windows})"
200+
198201
@property
199202
def kind(self) -> ExprKind:
200203
return self._kind
@@ -320,9 +323,7 @@ def apply_n_ary_operation(
320323
broadcast = any(kind.preserves_length() for kind in kinds)
321324
compliant_exprs = (
322325
compliant_expr.broadcast(kind)
323-
if broadcast
324-
and (kind is ExprKind.LITERAL or kind is ExprKind.AGGREGATION)
325-
and is_compliant_expr(compliant_expr)
326+
if broadcast and is_compliant_expr(compliant_expr) and is_scalar_like(kind)
326327
else compliant_expr
327328
for compliant_expr, kind in zip(compliant_exprs, kinds)
328329
)

0 commit comments

Comments
 (0)