DATE() SQL function always returns Date type, even with DateTime strftime format string #17093
Closed
2 tasks done
Labels
A-sql
Area: Polars SQL functionality
bug
Something isn't working
needs triage
Awaiting prioritization by a maintainer
rust
Related to Rust Polars
Checks
Reproducible example
$ polars --version polars-cli 0.8.0 $ polars -c "select DATE('03-15-2021 10:30:20 AM EST', '%m-%d-%Y %I:%M:%S %p %Z') as col1, cast(DATE('2021-03-15 10:30:20', '%Y-%m-%d %H:%M:%S') as datetime) as col2 from read_csv('foods.csv')" ┌────────────┬─────────────────────┐ │ col1 ┆ col2 │ │ --- ┆ --- │ │ date ┆ datetime[μs] │ ╞════════════╪═════════════════════╡ │ 2021-03-15 ┆ 2021-03-15 00:00:00 │ └────────────┴─────────────────────┘%
Log output
No response
Issue description
It always returns a Date, not a DateTime, even if the parameters call for a datetime
Expected behavior
returns DateTime when the format string specifies it and the incoming date has the datetime components.
Installed versions
"asof_join",
"avro",
"binary_encoding",
"coalesce",
"cse",
"cross_join",
"dtype-full",
"extract_jsonpath",
"ipc",
"json",
"lazy",
"object",
"parquet",
"performant",
"semi_anti_join",
"serde-lazy",
"sql",
"streaming",
"timezones",
The text was updated successfully, but these errors were encountered: