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
Check for user-given type when encountering extra columns during parsing (#1023)
* Pull out initial type-setting logic into function
* Refactor function for initialising cols with types
* Re-use type-setting logic when new column found
* Split fallback case into specific methods
* Add some internal docs/comments
* Test `types isa Function` case
* fixup! Re-use type-setting logic when new column found
* Test `types isa AbstractDict` case
* Log message if we expect parsing to fail
- We expect parsing to fail in the case edge case where
we unexpectedly find an extra column and its type was
set via the `types` keyword to be some type `T`
which is a type we don't know how to parse
(i.e. `T` is not a standard/supported type nor a custom type
which we have already compiled a specialised parse method for).
- In such a case, log an error-level message noting to
inform the user we are in this case and parsing is not expected
to work.
- In future we could considering trying to support this situation.
* fixup! Test `types isa AbstractDict` case
* fixup! Log message if we expect parsing to fail
(0< k <= ncols) ||throw(ArgumentError("invalid column number provided in `$argname` keyword argument: $k. Column number must be 0 < i <= $ncols as detected in the data. To ignore invalid columns numbers in `$argname`, pass `validate=false`"))
@@ -88,11 +88,75 @@ function checkinvalidcolumns(dict, argname, ncols, names)
88
88
isvalid ||throw(ArgumentError("invalid column name provided in `$argname` keyword argument: $k. Valid column names detected in the data are: $names. To ignore invalid columns names in `$argname`, pass `validate=false`"))
@noinlinenonconcretetypes(types) =throw(ArgumentError("Non-concrete types passed in `types` keyword argument, please provide concrete types for columns: $types"))
95
104
105
+
# Create all the `Column`s and keep track of any non-standard eltypes for which we will
106
+
# later need generate specialized parsing methods.
0 commit comments