[X] I have checked that this issue has not already been reported.
[X] I have confirmed this bug exists on the latest version of Polars.
Reproducible example
import polars as pl
import datetime
import random
def random_date(start, end):
"""Generate a random datetime between `start` and `end`"""
return start + datetime.timedelta(
# Get a random amount of seconds between `start` and `end`
seconds=random.randint(0, int((end - start).total_seconds())),
)
df = pl.DataFrame({
"id":list(range(0,1000))*1500,
"start_date": [random_date(datetime.datetime(2015,1,1), datetime.datetime(2020,1,1),) for i in range(1500000)]
}).with_columns(end_date = pl.col('start_date') + pl.duration(hours=random.randint(24,240)))
parts = df.sample(1700).select(
'id',
pl.concat_list(pl.col('start_date','end_date')).list.mean().alias('date').cast(pl.Datetime)
)
df.lazy().join_where(parts.lazy(), (pl.col('id') == pl.col('id')) &
(pl.col('start_date') <= pl.col('date') ) &
(pl.col('end_date') >= pl.col('date'))).collect(streaming=True)
InvalidOperationError: only 1 binary comparison allowed as join condition
Log output
No response
Issue description
When you provide the predicate as a single predicate with &'s it's throwing an invalidOperation.
Expected behavior
Allow a single Expr that contains multiple binary comparisons
Checks
Reproducible example
Log output
No response
Issue description
When you provide the predicate as a single predicate with &'s it's throwing an invalidOperation.
Expected behavior
Allow a single Expr that contains multiple binary comparisons
Installed versions