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

ENH: IntegerArray.astype(dt64) #32538

Merged
merged 10 commits into from
Mar 14, 2020

Conversation

jbrockmendel
Copy link
Member

Let's us de-kludge to_datetime code, getting rid of another _ndarray_values usage.

@jbrockmendel
Copy link
Member Author

jbrockmendel commented Mar 8, 2020

By my count, after today's slew of values_from_object/internal_get_values PRs, we'll have

  • 9 _ndarray_values usages
  • 3 values_from_object usages
  • 10 _internal_get_values usages
  • 1 Block.to_dense

(not counting usages in tests, docstrings, or in the each other's implementations)

@jreback jreback added Dtype Conversions Unexpected or buggy dtype conversions ExtensionArray Extending pandas with custom dtypes or arrays. labels Mar 11, 2020
@@ -633,6 +633,15 @@ def test_astype_specific_casting(self, dtype):
expected = pd.Series([1, 2, 3, None], dtype=dtype)
tm.assert_series_equal(result, expected)

def test_astype_dt64(self):
Copy link
Contributor

Choose a reason for hiding this comment

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

do we have tests with None, np.nan here as well?

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 guess those would go in the test for pd.array inference in tests.arrays.test_array, where I see a test for [1, None]

@jreback jreback added this to the 1.1 milestone Mar 14, 2020
@jreback jreback merged commit 011f411 into pandas-dev:master Mar 14, 2020
@jreback
Copy link
Contributor

jreback commented Mar 14, 2020

thanks.

can you add a release note in a followon. (I guess this is a bug fix)

SeeminSyed pushed a commit to CSCD01-team01/pandas that referenced this pull request Mar 22, 2020
@jbrockmendel jbrockmendel deleted the to_datetime-no-mask branch April 5, 2020 17:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Dtype Conversions Unexpected or buggy dtype conversions ExtensionArray Extending pandas with custom dtypes or arrays.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

IntegerArray.astype("datetime64[ns]") fails with NAs
2 participants