Allow custom callbacks for invalid row/cell #618
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This implements #522. It allows providing two different callbacks:
invalidrow
: a callback that takes a singleInteger
representingthe row number where an invalid state was detected (not enough columns
parsed or more columns than expected were detected)
invalidcell
: a callback called when an error occurs parsing auser-provided type (Int, Float64, Bool, Date, DateTime, or Time); the
callback should take 5 arguments: 1) the type attempted while parsing,
code
return code value that encodes events/states that occurred while
parsing, 4) the row the invalid cell was on, and 5) the column the
invalid cell was on.
Providing an
invalidrow
orinvalidcell
function forcessilencewarnings=true
for invalid rows or cells, respectively, i.e. nowarning will be printed if an error callback function is provided.
If
strict=true
is provided,invalidcell
will not be invoked.This PR includes a simple test, but no docs yet.