Skip to content

BUG: DTA/TDA constructors with mismatched values/dtype resolutions #55658

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

Merged
merged 2 commits into from
Oct 24, 2023

Conversation

jbrockmendel
Copy link
Member

  • closes #xxxx (Replace xxxx with the GitHub issue number)
  • Tests added and passed if fixing a bug or adding a new feature
  • All code checks passed.
  • Added type annotations to new arguments/methods/functions.
  • Added an entry in the latest doc/source/whatsnew/vX.X.X.rst file if fixing a bug or adding a new feature.

@mroeschke mroeschke added the Constructors Series/DataFrame/Index/pd.array Constructors label Oct 24, 2023
# "type[DatetimeArray]", variable has type "type[PeriodArray]")
cls = dtype.construct_array_type() # type: ignore[assignment]
dt64_values = arr.view(f"M8[{dtype.unit}]")
return cls(dt64_values, dtype=dtype)
elif dtype == "M8[ns]":
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do just the ns cases need special casing?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i also have a branch to extend this check to other supported dt64/td64 dtypes, just trying to keep this branch targeted

@mroeschke mroeschke added this to the 2.2 milestone Oct 24, 2023
@mroeschke mroeschke merged commit e48df1c into pandas-dev:main Oct 24, 2023
@mroeschke
Copy link
Member

Thanks @jbrockmendel

@jbrockmendel jbrockmendel deleted the bug-dtl-init branch October 24, 2023 20:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Constructors Series/DataFrame/Index/pd.array Constructors
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants