DATE() SQL function always returns Date type, even with DateTime strftime format string
Closed this issue · 1 comments
jqnatividad commented
Checks
-
I have checked that this issue has not already been reported.
-
I have confirmed this bug exists on the latest version of the Polars CLI.
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') from read_csv('foods.csv')"
┌────────────┐
│ literal │
│ --- │
│ date │
╞════════════╡
│ 2021-03-15 │
└────────────┘
Issue description
It always returns a Date, not a DateTime...
Expected behavior
returns DateTime when the format string specifies it and the incoming date has the datetime components.
Installed version
0.8.0
jqnatividad commented
Created an issue instead on polars repo, as further testing shows this is not really a problem with polars-cli
pola-rs/polars#17093