Cory Grinstead
11/19/2024, 9:34 PMdate_df = daft.from_pydict({"date_str":["2020-01-01","2020-01-02","2020-01-03"]})
date_df = date_df.with_column("date", col("date_str").str.to_date("%Y-%m-%d"))
# we probably want the user to use an explicit date object, or a casted string
date_df.filter(col("date") == datetime.date(2020, 1, 1)).explain()
date_df.filter(col("date") == daft.lit("2020-01-01").str.to_date("%Y-%m-%d")).explain()
but in sql, implicit coercions are almost always allowed.
where date = '2020-01-01'; -- implicit
where date = cast('2020-01-01' as date); --explicit
Was hoping others might have some ideas on how we can solve this.Cory Grinstead
11/19/2024, 9:37 PMLogicalPlanBuilder with some additional context, such as allow_implicit_coercionsCory Grinstead
11/19/2024, 9:42 PMDaftExecutionConfig I think a DaftPlanningConfig would also make a lot of sense.Cory Grinstead
11/19/2024, 9:43 PMjay
11/19/2024, 10:08 PMCory Grinstead
11/19/2024, 10:15 PMstr == date comparisons as well?Cory Grinstead
11/19/2024, 10:44 PMstr == date implicit coercion.
https://github.com/Eventual-Inc/Daft/pull/3337
I do think we should revisit at some point to have a config flag for allowing/disabling implicit coercions all together.Kevin Wang
11/19/2024, 10:46 PMCory Grinstead
11/19/2024, 11:00 PM