Weird bug? deserializing vector properties

8 views
Skip to first unread message

Simon Belak

unread,
Dec 18, 2014, 10:06:03 AM12/18/14
to clojure-...@googlegroups.com
Not completely sure if this is in fact a bug or just undefined behaviour, however vector vertex properties get weirdly mangled:

  (g/transact! (vert/create! { :bar "ha" :baz ["a" "b"]}))

  >>> IllegalArgumentException Cannot de-/serialize object: :bar  com.google.common.base.Preconditions.checkArgument (Preconditions.java:119)

(note it complains about :bar)
on the other hand,

  (g/transact! (vert/create! { :bar "ha" :baz ["a"]}))

works; but if we retrieve its properties, baz is a string, not a vector containing a string:

  (g/transact! (vert/to-map (vert/create! { :bar "ha" :baz ["a"]})))

  >>> {:__id__ 44, :baz "a", :bar "ha"}

The problem seems to be with how clj vectors are serialized, as

  (g/transact! (vert/to-map (vert/create! { :bar "ha" :baz (to-array ["a" "b"])})))

works as intended.

What I'm mostly looking for is understanding what goes wrong. If clj data structures need AttributeSerializer defined? If so, is this something you would be interested in accepting a patch for?

Cheers,
s

Simon Belak

unread,
Dec 19, 2014, 7:44:16 AM12/19/14
to clojure-...@googlegroups.com
Never mind, I was using the old API, it works as it should by using make-property-key with :cardinality.
Reply all
Reply to author
Forward
0 new messages