-
-
Notifications
You must be signed in to change notification settings - Fork 18.7k
BUG: Return KeyError for invalid string key #23540
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BUG: Return KeyError for invalid string key #23540
Conversation
Hello @toobaz! Thanks for submitting the PR.
|
fae8820
to
e44b249
Compare
Codecov Report
@@ Coverage Diff @@
## master #23540 +/- ##
==========================================
+ Coverage 92.25% 92.25% +<.01%
==========================================
Files 161 161
Lines 51207 51212 +5
==========================================
+ Hits 47239 47244 +5
Misses 3968 3968
Continue to review full report at Codecov.
|
lgtm. |
Thanks! |
git diff upstream/master -u -- "*.py" | flake8 --diff
In principle, it is nice to raise different errors if the string is invalid, or if the resulting period is missing. However, we want, and need, methods such as
.loc
to return errors of predictable types.And indeed, this is how
PeriodIndex
, for instance, works:[...]