-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
BUG: instantiation using a dict with a period scalar #35966
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
Conversation
Hello @justinessert! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found: There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻 Comment last updated at 2020-09-06 22:33:19 UTC |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can u update tests i think in pandas/tests/test/test_dtypes.py (thathit infer_scalar_from_dtype for the new behavior) it's possible we were not testing a period before
@jreback there's one that I updated in test_infer_dtype_from_period, is that what you mean or are you after something else? |
@jreback What are you looking to be tested outside of test_infer_dtype_from_period? |
yep saw that, your change is good |
thanks @justinessert very nice |
@jreback Thanks for all your helpful and timely replies, it's much appreciated! |
black pandas
git diff upstream/master -u -- "*.py" | flake8 --diff
Fixing bug discussed in issue 35965 where
pd.DataFrame({'a': pd.Period('2020-01')})
createda
as an object column instead of aperiod[m]
column.Changing the functionality of
infer_dtype_from_scalar
isn't necessarily required here, but the fact thatinfer_dtype_from_scalar
would return theperiod.ordinal
value seems inconsistent with the behavior for other dtypes in this function. Additionally, that functionality was only used in a single place within the code (interval.py
), which I fixed accordingly.