specter

Latest version: 1.1.3
richiardiandrea 2021-04-22T00:32:31.016600Z

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?

richiardiandrea 2021-04-22T00:45:00.018300Z

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?

2021-04-22T14:50:46.018900Z

@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

richiardiandrea 2021-04-22T15:17:58.019100Z

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

2021-04-22T17:06:52.020600Z

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

richiardiandrea 2021-04-23T23:33:23.020800Z

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

richiardiandrea 2021-04-23T23:37:38.021Z

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

richiardiandrea 2021-04-23T23:38:54.021300Z

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

richiardiandrea 2021-04-23T23:41:27.021500Z

forked your repo and will test it that way

2021-04-23T23:42:20.021700Z

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

2021-04-23T23:42:40.021900Z

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

richiardiandrea 2021-04-23T23:49:02.022100Z

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

richiardiandrea 2021-04-23T23:52:36.022300Z

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

richiardiandrea 2021-04-24T00:00:52.022500Z

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