This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-09-24
Channels
- # announcements (7)
- # babashka (5)
- # babashka-sci-dev (20)
- # beginners (125)
- # biff (98)
- # catalyst (1)
- # clerk (37)
- # clj-kondo (6)
- # clojure (49)
- # clojure-dev (18)
- # clojure-europe (6)
- # clojure-uk (2)
- # data-science (17)
- # deps-new (20)
- # emacs (11)
- # helix (5)
- # hyperfiddle (34)
- # malli (3)
- # missionary (4)
- # reitit (4)
- # sci (15)
- # solo-full-stack (7)
- # sql (5)
- # testing (2)
Getting this error pretty often when working with Clerk + TableCloth:
Unhandled java.lang.NullPointerException
Cannot invoke "java.util.Map$Entry.getValue()" because "<local6>" is null
Curious whether anyone else has seen it before?I haven’t but not using TableCloth heavily. Can you share your tablecloth viewer? In previous implementations I’ve seen all Clerk did was convert it to a seq of seqs so not much going on.
I’m converting it to maps using tc/rows
and then passing it to either clerk/table
or clerk/vl
.
so something along these lines?
(ns tablecloth-viewer
(:require [tablecloth.api :as tc]
[nextjournal.clerk :as clerk]))
(comment
(clojure.repl.deps/add-lib 'scicloj/tablecloth {:mvn/version "4.04"}))
(def tablecloth-table-viewer
{:pred tc/dataset?
:transform-fn (clerk/update-val (fn [dataset]
(clerk/table {:head (into [] (tc/column-names dataset))
:rows (into [] (tc/rows dataset))})))})
(clerk/add-viewers! [tablecloth-table-viewer])
(def dataset
(tc/dataset "" {:key-fn keyword}))
I’d recommend using seqs of seqs as in my example as there’s no normalization work for clerk to do and the order of the cols is kept
if nextjournal.clerk.viewer/normalize-table-data
shows up in the stacktrace what I wrote above might be worth a try
unfortunately I don’t know anything about to underlying ham-fisted.ImmutList
datascructure to know what’s going on
Hi. I'm not sure whether this is related, but in the past, some tech.ml.dataset/Clerk incompatibilities were caused by tech.ml.dataset's overriding of https://github.com/taoensso/nippy serializations (which were used in Clerk's cache). We recorded one such behaviour https://github.com/scicloj/visual-tools-experiments/tree/main/clerk-cache-tmd-columns-tc-1 (but I think it has been fixed later). I'm mentioning it here since this kind of situation might be difficult to debug without knowing of such relationship (and is tricky to reproduce because it may depend on the cache state).
thanks @U066L8B18. The stacktrace makes me believe it’s unrelated to Clerk’s caching however as it happens when Clerk is doing a editscript diff to figure out the diff to send to the browser to update the display.