pandas: Index constructor doesn't validate kwargs
In [4]: pd.Index([1, 2], abc=1)
Out[4]: Int64Index([1, 2], dtype='int64')
This should raise, since abc
isn’t a valid keyword.
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 21 (15 by maintainers)
Alrighty, sorry for bringing that other discussion in here.
For now @bartkim0426 can you implement https://github.com/pandas-dev/pandas/issues/26974#issuecomment-522561054?
The idea would be for
pd.Index([], dtype='category', not_a_kwargs="foo")
to raise. I think you don’t pass**kwargs
through to all the index subclasses, there might be a case where we don’t raise on that. Make sense?