Skip to content

Commit ad960a3

Browse files
committed
Add note to docs
1 parent 0c9490e commit ad960a3

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

site/documentation/csv/generic.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Module: [![Maven Central](https://img.shields.io/maven-central/v/org.gnieh/fs2-d
44

55
The `fs2-data-csv-generic` module provides automatic (Scala 2-only) and semi-automatic derivation for `RowDecoder` and `CsvRowDecoder`.
66

7-
It makes it easier to support custom row types but is based on [shapeless][shapeless], which can have a significant impact on compilation time on Scala 2. On Scala 3, it relies on mix of hand-written derivation on top of `scala.deriving.Mirror` and the more light-weight [shapeless-3][shapeless-3], so that compile times shouldn't be problematic as on Scala 2. Note that auto derivation is currently not yet supported on Scala, same goes for using default constructor arguments of `case class`es (for background see [dotty#11667][dotty#11667]).
7+
It makes it easier to support custom row types but is based on [shapeless][shapeless], which can have a significant impact on compilation time on Scala 2. On Scala 3, it relies on mix of hand-written derivation on top of `scala.deriving.Mirror` and the more light-weight [shapeless-3][shapeless-3], so that compile times shouldn't be problematic as on Scala 2. Note that auto derivation is currently not yet supported on Scala 3, same goes for using default constructor arguments of `case class`es (for background see [dotty#11667][dotty#11667]).
88

99
To demonstrate how it works, let's work again with the CSV data from the [core][csv-doc] module documentation.
1010

@@ -123,6 +123,8 @@ val decoded = stream.through(decodeUsingHeaders[MyRowDefault]())
123123
decoded.compile.toList
124124
```
125125

126+
It's important to note that by the limitations of the CSV file format, there's no clear notion of when default values would apply. `fs2-data-csv-generic` treats values as missing if there's no column with the expected name or if the value is empty. This implies that cells with an empty value won't be parsed of there's a default present, even if the corresponding `CellDecoder` instance could handle empty input, like `CellDecoder[String]`. If you need to handle empty inputs explicitly, refrain from defining a (non-empty) default or define the `CsvRowDecoder` instance manually.
127+
126128
[csv-doc]: /documentation/csv/index.md
127129
[shapeless]: https://github.com/milessabin/shapeless
128130
[shapeless-3]: https://github.com/typelevel/shapeless-3

0 commit comments

Comments
 (0)