You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It is currently possible to create an invalid CSVWriter.Configuration by supplying nil as a field- or row-delimiter. nil means "infer the delimiter from the CSV data", which only makes sense for the CSVReader. This error is reported at runtime.
Describe the solution you'd like
I'd suggest having separate Delimiter.Pair types for CSVReader.Configuration and CSVWriter.Configuration so that we can prevent invalid configuration at compile-time. The Delimiter.Pair for the writer's configuration would simply not have an API for specifying inference.
Describe alternatives you've considered
Alternatively we can keep it as it is currently, and raise a run-time error when inference is requested from the CSVWriter. This does spare us from having two very similar Delimiter.Pair types.
Additional context
If we add a more explicit API for delimiter inference, as suggested in #44, I think this might become even more important, as the auto-completion will otherwise include .infer and multiple overloads of .infer(options:) in its suggestions, which would be quite confusing in the context of the CSVWriter.
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem?
It is currently possible to create an invalid
CSVWriter.Configuration
by supplyingnil
as a field- or row-delimiter.nil
means "infer the delimiter from the CSV data", which only makes sense for theCSVReader
. This error is reported at runtime.Describe the solution you'd like
I'd suggest having separate
Delimiter.Pair
types forCSVReader.Configuration
andCSVWriter.Configuration
so that we can prevent invalid configuration at compile-time. TheDelimiter.Pair
for the writer's configuration would simply not have an API for specifying inference.Describe alternatives you've considered
Alternatively we can keep it as it is currently, and raise a run-time error when inference is requested from the
CSVWriter
. This does spare us from having two very similarDelimiter.Pair
types.Additional context
If we add a more explicit API for delimiter inference, as suggested in #44, I think this might become even more important, as the auto-completion will otherwise include
.infer
and multiple overloads of.infer(options:)
in its suggestions, which would be quite confusing in the context of theCSVWriter
.The text was updated successfully, but these errors were encountered: