Skip to content

Commit

Permalink
fix: dtype type
Browse files Browse the repository at this point in the history
  • Loading branch information
scarf005 committed Nov 14, 2024
1 parent adf2c51 commit 01bf949
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions polars/lazy/expr/string.ts
Original file line number Diff line number Diff line change
Expand Up @@ -427,13 +427,11 @@ export const ExprStringFunctions = (_expr: any): StringNamespace => {
dtype: DataType.Date | DataType.Datetime | typeof DataType.Datetime,
format?: string,
) {
if (!(dtype instanceof DataType)) {
dtype = dtype();
}
if (dtype.equals(DataType.Date)) {
const dt = dtype instanceof DataType ? dtype : dtype();
if (dt.equals(DataType.Date)) {
return wrap("strToDate", format, false, false, false);
}
if (dtype.equals(DataType.Datetime("ms"))) {
if (dt.equals(DataType.Datetime("ms"))) {
return wrap(
"strToDatetime",
format,
Expand Down

0 comments on commit 01bf949

Please sign in to comment.