Add support for optional name validation of single-index #326
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 PR adds optional name validation for single-index.
DataFrameSchema
:Created on 2020-11-19 by the reprexpy package
The new behavior is to disable name validation when the name is set to
None
. We discussed adding a new argumentcheck_name
toIndex
in #323 but I think this solution is more elegant. @cosmicBboy Let me know if you see any drawbacks to this approach.Moreover, the PR does add a
check_name
parameters toField
. That closes #323check_name
(bool): Whether to check the name of the column/index during validation.None
is the default behavior, which translates toTrue
for columns and multi-index, and toFalse
for a single index.Created on 2020-11-19 by the reprexpy package
As discussed here, columns must always be named.
Multi-index suffers from the same "bug" as described in 1. but it's much harder to fix because
pa.MultiIndex
is implemented as a subclass ofpa.DataFrameSchema
. I think it should be the topic of another issue.Created on 2020-11-19 by the reprexpy package