Fork me on GitHub
#specter
<
2021-04-22
>
richiardiandrea00:04:31

Hi there, I reported this problem some time ago but I am now in need of a workaround because it keeps happening:

UnsupportedOperationException Can't create empty: duct.database.sql.Boundary
	duct.database.sql.Boundary (sql.clj:4)
	clojure.core/empty (core.clj:5247)
	clojure.core/empty (core.clj:5241)
	com.rpl.specter.navs/eval3673/fn--3674 (navs.cljc:363)
	com.rpl.specter.navs/eval3607/fn--3608/G--3596--3615 (navs.cljc:222)
	com.rpl.specter/reify--4346 (specter.cljc:707)
	com.rpl.specter.impl/combine-two-navs/reify--2611 (impl.cljc:200)
I was basically thinking of converting all the records before passing the payload to the specter functions...maybe as a specter transformation...is anybody doing this already? Is it a good idea?

richiardiandrea00:04:00

or I need some starting point on fix https://github.com/redplanetlabs/specter/issues/303 I gave a quick read to the navigator implementations - I guess I would need a map-vals-transform implementation for my records? Can this be done in user land?

Jeff Evans14:04:46

@richiardiandrea, here’s a starting point: https://github.com/redplanetlabs/specter/pull/306 would need to think more about weird corner cases and also investigate the CLJS side

richiardiandrea15:04:58

cool I can try this out right away πŸ˜„

Jeff Evans17:04:52

it occurs to me that supporting key transformation might make sense, like if you need to rename some keys within the same record. seems a bit odd to me, but maybe reasonable

richiardiandrea23:04:23

yeah the problem is that I use specter in my logging code path so knowing the records all libraries are using (plus ours - quite a code base and I am new to it) might not be possible

richiardiandrea23:04:38

I will be trying your branch with gitlib coordinate, please let me know if you are planning a rebase ok? πŸ˜„

richiardiandrea23:04:54

oh, cannot do that because there is no deps.edn 😞

richiardiandrea23:04:27

forked your repo and will test it that way

Jeff Evans23:04:20

Nathan reviews PRs very infrequently and I don't really plan on doing anything until that happens anyway

Jeff Evans23:04:40

But I'd imagine you could do this protocol extension in your own namespace too

richiardiandrea23:04:02

oh ok that would be the best option, but I also want to improve the lib and at least test that your solution works πŸ˜‰

richiardiandrea23:04:36

Well...ok I don't think using gitlibs works...there is some java in there and I don't know if the new tooling deals with that

richiardiandrea00:04:52

built a jar and I can tell you it works like a charm πŸŽ‰