Fix infer_schema_length: nil option #600
Merged
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.
Currently, setting
infer_schema_length: nil
when creating aDataFrame
from CSV has no effect, because there is a redundant fallback to the default value of 1000 rows if themax_rows
option is not set (or set tonil
).Effectively, it is not possible to use all rows for schema inference without setting
infer_schema_length
(ormax_rows
) to a large enough "guess". I believe this does not match the documented behavior:This PR removes the fallback to the default.
I'm not sure if the changes here are actually preferable to changing the docs, as scanning all rows will be slow for larger files (as stated), but ran into an issue myself with the following situation:
infer_schema_length
/max_rows
value felt wrong)N
k lines contain0
, later lines contain float values. (an issue with the source of the files, but fixing that is not possible)