Skip to content

Commit 057675c

Browse files
committed
Signal an error if heuresticate-types failes to parse a timestamp
1 parent 1fcb012 commit 057675c

1 file changed

Lines changed: 2 additions & 7 deletions

File tree

src/properties.lisp

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,9 @@ Often when reading in a data set, the types will be inconsistent in a variable.
1414
(sym (find-symbol (symbol-name key) (find-package name))))
1515
(setf (get sym :type) col-type)
1616
;; If a column is :temporal, replace strings in it with timestamps.
17-
;; If local-time fails to parse a value then leave it as is.
17+
;; If local-time fails to parse a value then signal an error without corrupting the dataframe.
1818
(when (eql col-type :temporal)
19-
(map-into data
20-
#'(lambda (val)
21-
(or (when (stringp val)
22-
(local-time:parse-timestring val :fail-on-error nil))
23-
val))
24-
data))))
19+
(setf (column df key) (map 'vector #'local-time:parse-timestring data)))))
2520
(keys df))))
2621

2722
(defun set-properties (df property prop-values)

0 commit comments

Comments
 (0)