Skip to content

Commit 134a39b

Browse files
committed
fix possible date type mismatch in datascan
1 parent 657e0e6 commit 134a39b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

pointblank/datascan.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -288,8 +288,8 @@ def get_tabular_report(self, *, show_sample_data: bool = False) -> GT:
288288

289289
formatted_data = formatted_data.with_columns(
290290
nw.when(nw.col("coltype").str.contains(r"\bDate\b", literal=False))
291-
.then(nw.col(c).str.replace_all("-", "<br>"))
292-
.otherwise(c)
291+
.then(nw.col(c).cast(nw.String).str.replace_all("-", "<br>"))
292+
.otherwise(nw.col(c).cast(nw.String))
293293
for c in date_stats
294294
)
295295

@@ -300,8 +300,8 @@ def get_tabular_report(self, *, show_sample_data: bool = False) -> GT:
300300
datetime_idx = [c for c in present_stat_cols if c in ("min", "max")]
301301
formatted_data = formatted_data.with_columns(
302302
nw.when(nw.col("coltype").str.contains(r"\bDatetime\b", literal=False))
303-
.then(nw.col(c).str.replace_all("-", "<br>"))
304-
.otherwise(c)
303+
.then(nw.col(c).cast(nw.String).str.replace_all("-", "<br>"))
304+
.otherwise(nw.col(c).cast(nw.String))
305305
for c in datetime_idx
306306
)
307307

0 commit comments

Comments
 (0)