Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

qst - why does filter(nw.col('temp').max() > 60) sometimes raise and sometimes not? #1786

Open
MarcoGorelli opened this issue Jan 10, 2025 · 0 comments

Comments

@MarcoGorelli
Copy link
Member

from discord:

import pyarrow as pa
import narwhals as nw

t = pa.Table.from_pydict({
  "date": ["2025-01-01", "2025-02-01", "2025-03-01", "2025-04-01"],
  "temperature": [50, 60, 70, 80],
})

nw_f = nw.from_native(t)
column = "date"

print(
    nw_f
    .filter(
        nw.col("temperature").max() > 60,
    )
)

I think we should validate the length of the predicates in filter, and that this should raise consistently

If Polars allows it, then OK, we can leave that be, but for pandas and pyarrow i think we should raise

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant