Comments (2)
I looked into this and I'm afraid Magnolia isn't a good fit (at least for CSV encoding/decoding). The reason is that it expects the same type class to be available for every member of a product (read: case class) it derives an instance for and doesn't allow to require instances of a different type class instead. So while we could implement Magnolia derivation for CellDecoder
/CellEncoder
for coproduces of objects and unary products, I don't see a (good) way to implement derivation for rows (RowDecoder
/RowEncoder
and CsvRowDecoder
/CsvRowEncoder
) as Magnolia would require every cell to have an instance of the derived type class instead of the actual necessary CellDecoder
/CellEncoder
. Due to this difference to other file formats like JSON, which are recursive and by that fitting Magnolia's expectations way better, CSV with Magnolia seems to be a won't do.
I do like the aim for faster and easier to debug derivation though! Options I currently see are scalaz-deriving
(unfortunately comes with a Scalaz dependency), custom macros (doable, but not so easy to get the details right) or waiting for dotty's generic derivation (which we might get "for free" using shapeless 3).
from fs2-data.
I will close this ticket for now, since it doesn't look like it's doable. If you disagree, let me know, we can discuss and reopen it.
from fs2-data.
Related Issues (20)
- Add support for some regexes
- Setup MiMa for ensuring binary compatibility HOT 5
- Custom java.time formats HOT 4
- Add 1.0 scalafix migrations to Scala Steward
- CellDecoder performance HOT 3
- Make it possible to add a CSV column to a row HOT 1
- csv.lowlevel.headers pipe does not preserve line numbers HOT 3
- Support for non-UTF `encoding` in xml parser HOT 12
- Benchmark for XML parser HOT 1
- `fs2.data.xml.XmlException: character 'ΚΏ' cannot start a NCName` HOT 6
- Add Streaming XQuery subset implementation
- Add Streaming jq Subset
- Scala Native HOT 1
- Add cookbooks
- CBOR doesn't round trip bignums
- Wrong line number when CSV contains empty lines HOT 1
- Find an alternative to stork search engine HOT 1
- XML roundtrip failing on & HOT 3
- tokens duplicates text if stream has chunks that end with escape character HOT 1
- Add support for a "formatted rendering" XML sink
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fs2-data.