Skip to content
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: Series construction with mismatched dt64 data vs td64 dtype #38764

Merged
merged 3 commits into from
Dec 29, 2020

Conversation

jbrockmendel
Copy link
Member

  • closes #xxxx
  • tests added / passed
  • passes black pandas
  • passes git diff upstream/master -u -- "*.py" | flake8 --diff
  • whatsnew entry

Fixing this for DataFrame is much harder, so punting for now.

@gfyoung gfyoung added Bug Series Series data structure labels Dec 29, 2020
@jreback jreback added this to the 1.3 milestone Dec 29, 2020
@jreback
Copy link
Contributor

jreback commented Dec 29, 2020

looks fine. this is just a refactor right? doesn't change user facing?

@jbrockmendel
Copy link
Member Author

looks fine. this is just a refactor right? doesn't change user facing?

No, this fixes corner cases failing to raise:

dtype = np.dtype("m8[ns]")
val = np.datetime64(1234, "ns")

>>> pd.Series([val], dtype=dtype)

>>> pd.Series({0: val}, dtype=dtype)

and vice-versa for flipping tdt64/dt64

@jreback
Copy link
Contributor

jreback commented Dec 29, 2020

kk i guess then a whatsnew note

@jreback jreback merged commit 1d19629 into pandas-dev:master Dec 29, 2020
@jbrockmendel jbrockmendel deleted the bug-from_scalar branch December 29, 2020 19:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Series Series data structure
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants