Skip to content

Is the datatype :instant supported? #457

Description

@alza-bitz

According to the docs here https://techascent.github.io/tech.ml.dataset/supported-datatypes.html :instant is a supported data type.

However with this example code (adapted from the same page) running with version 7.053 I get No matching clause: :instant:

(ns dataset
  (:require [tech.v3.dataset-api :as ds]))

(def data-maps (for [idx (range 10)]
                       {:a idx
                        :b (str (.plusDays (java.time.LocalDateTime/now) idx))}))

data-maps

;; works
(:b (ds/->dataset data-maps))

;; works
(:b (ds/->dataset data-maps {:parser-fn {:b [:local-date "yyyy-MM-dd'T'HH:mm:ss.SSSSSSSSS"]}}))

;; works
(:b (ds/->dataset data-maps {:parser-fn {:b [:local-date-time "yyyy-MM-dd'T'HH:mm:ss.SSSSSSSSS"]}}))

;; not working
(:b (ds/->dataset data-maps {:parser-fn {:b [:instant "yyyy-MM-dd'T'HH:mm:ss.SSSSSSSSS"]}}))
;; Execution error (IllegalArgumentException) at tech.v3.dataset.io.datetime/datetime-formatter-parse-str-fn (datetime.clj:150).
;; No matching clause: :instant

Thanks 🙏

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions