Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unroll-column throws an exception when dataset has one column #284

Closed
genmeblog opened this issue Feb 4, 2022 · 0 comments
Closed

unroll-column throws an exception when dataset has one column #284

genmeblog opened this issue Feb 4, 2022 · 0 comments

Comments

@genmeblog
Copy link

(def data (tech.v3.dataset/->dataset {:a [[1 2 3] [4 5] [6 7 8]]}))

data
;; => _unnamed [3 1]:
;;    |      :a |
;;    |---------|
;;    | [1 2 3] |
;;    |   [4 5] |
;;    | [6 7 8] |

(tech.v3.dataset/unroll-column data :a)
;; exception

(def data2 (tech.v3.dataset/add-or-update-column data :b [-1 -2 -3]))

data2
;; => _unnamed [3 2]:
;;    |      :a | :b |
;;    |---------|---:|
;;    | [1 2 3] | -1 |
;;    |   [4 5] | -2 |
;;    | [6 7 8] | -3 |

(tech.v3.dataset/unroll-column data2 :a)
;; => _unnamed [8 2]:
;;    | :b | :a |
;;    |---:|---:|
;;    | -1 |  1 |
;;    | -1 |  2 |
;;    | -1 |  3 |
;;    | -2 |  4 |
;;    | -2 |  5 |
;;    | -3 |  6 |
;;    | -3 |  7 |
;;    | -3 |  8 |

Exception is:

1. Unhandled java.lang.IllegalArgumentException
   No implementation of method: :select of protocol:
   #'tech.v3.protocols.column/PColumn found for class: nil

          core_deftype.clj:  583  clojure.core/-cache-protocol-fn
          core_deftype.clj:  575  clojure.core/-cache-protocol-fn
                column.clj:   12  tech.v3.protocols.column/eval19236/fn/G
                column.clj:  117  tech.v3.dataset.column/select
                column.clj:  110  tech.v3.dataset.column/select
                  base.clj:  385  tech.v3.dataset.base/select-rows
                  base.clj:  380  tech.v3.dataset.base/select-rows
           dataset_api.clj: 1082  tech.v3.dataset-api/unroll-column
           dataset_api.clj:  996  tech.v3.dataset-api/unroll-column
           dataset_api.clj: 1025  tech.v3.dataset-api/unroll-column
           dataset_api.clj:  996  tech.v3.dataset-api/unroll-column
               dataset.clj: 1301  tech.v3.dataset/unroll-column
               dataset.clj: 1272  tech.v3.dataset/unroll-column
                      REPL:  110  tablecloth.playground/eval34794
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant