These are chat archives for nrinaudo/kantan.csv

9th
Aug 2017
Itamar Ravid
@iravid
Aug 09 2017 06:28
Hey @nrinaudo - any chance you'll release a new version of kantan.csv with the fix for #88? We hit that too :-)
Nicolas Rinaudo
@nrinaudo
Aug 09 2017 06:59
@iravid how urgent is this? I'm in the middle of refactoring some upstream libraries, which could take a while. If you're kind of stuck, I can try and find the time to do a "hotfix" release.
depending on the complexity of the type you're deriving a decoder for though, if you need an urgent fix, as in right now, you could write your own decoder. If the generic module can derive it, it's usually fairly simple to do it yourself
if you're struggling with that, feel free to drop your type here so that I can take a crack
Itamar Ravid
@iravid
Aug 09 2017 07:01
We're actually not using the generic parsers, but just parsing into List[String]. The parser fix is what I'm after :)
Nicolas Rinaudo
@nrinaudo
Aug 09 2017 07:01
wow, seriously?
Itamar Ravid
@iravid
Aug 09 2017 07:01
I'd be happy to help out with the release if that could help, I'd hate to interrupt your work
Yeah.. :)
CSV, man
Nicolas Rinaudo
@nrinaudo
Aug 09 2017 07:02
that's pretty bad. Do you have a minimum reproduction case that you can share?
I'm about to go in a meeting, but if you do, could you please drop it here, so that I can confirm that the fix works for you?
Itamar Ravid
@iravid
Aug 09 2017 07:03
Hmm yeah
One moment
I'll ask my colleague
Nicolas Rinaudo
@nrinaudo
Aug 09 2017 07:03
I'll try and do a hotfix release within the day
(which just started where I am, so that means within the next 12 to 14 hours)
Itamar Ravid
@iravid
Aug 09 2017 07:03
That's great, thanks so much
Nicolas Rinaudo
@nrinaudo
Aug 09 2017 07:04
no worries. I probably use kantan.csv more than anybody else, so any bug fix I write benefits me as well :)
Itamar Ravid
@iravid
Aug 09 2017 07:05
Cool. We think we also found another edge case, so we'll open an issue for that too
Nicolas Rinaudo
@nrinaudo
Aug 09 2017 07:05
:scream:
Itamar Ravid
@iravid
Aug 09 2017 07:06
We're building an API that accepts CSV dumps from various monitoring and CMDB systems
So we get to see a bunch of exotic stuff
:-)
Nicolas Rinaudo
@nrinaudo
Aug 09 2017 07:06
if you get into really exotic stuff, you might want to use one of the battle-tested engines rather than the default one
I wrote the internal parser, it's pretty fast and resilient, and it's dependency free. But if you get into really freaky stuff, you might want to use the jackson one, say
Itamar Ravid
@iravid
Aug 09 2017 07:07
Oh that's interesting, I haven't noticed that the library supports other bakcends
Nicolas Rinaudo
@nrinaudo
Aug 09 2017 07:07
I'm still interested in the bug reports though!
Itamar Ravid
@iravid
Aug 09 2017 07:08
Of course
That's a given :-)
My colleague will post a unit test here soon that demonstrates the issue
Nicolas Rinaudo
@nrinaudo
Aug 09 2017 07:09
there's currently support for jackson and apache commons. Jackson is pretty much the gold standard as far as CSV is concerned, so I'd go with that
(the documentation is in the link I pasted above)
Itamar Ravid
@iravid
Aug 09 2017 07:10
Great. We'll try it out
So what was the reason for writing an internal parser, if you don't mind me asking?
Nicolas Rinaudo
@nrinaudo
Aug 09 2017 07:10
I really need to be off now, but let me know how it works out
Itamar Ravid
@iravid
Aug 09 2017 07:10
Ah sure. Thanks for the help
Nicolas Rinaudo
@nrinaudo
Aug 09 2017 07:11
well, it started from the internal parser. The other engines came later :)
Itamar Ravid
@iravid
Aug 09 2017 07:11
Figured :)
Nicolas Rinaudo
@nrinaudo
Aug 09 2017 07:48
@iravid back from standups. Let me know if there's anything else you need
Itamar Ravid
@iravid
Aug 09 2017 11:06
@nrinaudo: thanks! We're opening the issues now
Nadav Mermer
@m3nadav
Aug 09 2017 14:35
@nrinaudo Hey
As you suggested in #89 and here i am trying to use the jackson engine
i wasn't sure if the jackson implicits import should replace the kantan.csv._ one or not
Nicolas Rinaudo
@nrinaudo
Aug 09 2017 14:43
it should not, no, although that's an interesting idea
but in your case, you should be using:
import kantan.csv._
import kantan.csv.engine.jackson._
Nadav Mermer
@m3nadav
Aug 09 2017 14:44
so it is instead of the import kantan.csv.ops._?
Nicolas Rinaudo
@nrinaudo
Aug 09 2017 14:44
sorry, I wasn't clear. It's in addition to the other imports
@m3nadav let me know if, for some reason, you can't get it to work. It's tested, but you might also be the first kantan.csv user to need a non-default engine
Nadav Mermer
@m3nadav
Aug 09 2017 14:50
Great, i am trying to understand how the new jackson implicits are being used
Nicolas Rinaudo
@nrinaudo
Aug 09 2017 14:50
oh, basically, anywhere you create an instance of CsvReader, make sure you bring in the jackson implicits
the concept is:
  • all methods that turn data into CsvReader rely on an implicit engine.
  • there is a default engine in scope, always: the internal one
  • you can override it by importing the jackson implementatin in scope explicitely
Nadav Mermer
@m3nadav
Aug 09 2017 14:52
Yeah thats clearer, i will try using it and update you soon. Thanks!
Nicolas Rinaudo
@nrinaudo
Aug 09 2017 14:53
no worries. I have few enough users that I can take the time to take care of them :)
Nadav Mermer
@m3nadav
Aug 09 2017 15:01
Worked like a charm, thanks again
Nicolas Rinaudo
@nrinaudo
Aug 09 2017 15:01
you're quite welcome
Nicolas Rinaudo
@nrinaudo
Aug 09 2017 16:04
@m3nadav @iravid I've got a fix for #89, and #88 is already fixed. I'll try to cut a release tonight, although there's no real emergency for you anymore since you're using the jackson engine, right?
Itamar Ravid
@iravid
Aug 09 2017 16:15
@nrinaudo it appears that jackson solved our problems, but thanks so much for fixing the bugs :-)
Nicolas Rinaudo
@nrinaudo
Aug 09 2017 16:16
no, thank you. The fact that you went through the trouble of producing a minimal reproduction case and to file a bug was really helpful and appreciated