@@ -493,7 +493,8 @@ def _values(self):
493493 """
494494 Return the internal repr of this data (defined by Block.interval_values).
495495 This are the values as stored in the Block (ndarray or ExtensionArray
496- depending on the Block class).
496+ depending on the Block class), with datetime64[ns] and timedelta64[ns]
497+ wrapped in ExtensionArrays to match Index._values behavior.
497498
498499 Differs from the public ``.values`` for certain data types, because of
499500 historical backwards compatibility of the public attribute (e.g. period
@@ -502,8 +503,9 @@ def _values(self):
502503 cases).
503504
504505 Differs from ``.array`` in that this still returns the numpy array if
505- the Block is backed by a numpy array, while ``.array`` ensures to always
506- return an ExtensionArray.
506+ the Block is backed by a numpy array (except for datetime64 and
507+ timedelta64 dtypes), while ``.array`` ensures to always return an
508+ ExtensionArray.
507509
508510 Differs from ``._ndarray_values``, as that ensures to always return a
509511 numpy array (it will call ``_ndarray_values`` on the ExtensionArray, if
@@ -515,8 +517,9 @@ def _values(self):
515517 ----------- | ------------- | ------------- | ------------- | --------------- |
516518 Numeric | ndarray | ndarray | PandasArray | ndarray |
517519 Category | Categorical | Categorical | Categorical | ndarray[int] |
518- dt64[ns] | ndarray[M8ns] | ndarray[M8ns] | DatetimeArray | ndarray[M8ns] |
520+ dt64[ns] | ndarray[M8ns] | DatetimeArray | DatetimeArray | ndarray[M8ns] |
519521 dt64[ns tz] | ndarray[M8ns] | DatetimeArray | DatetimeArray | ndarray[M8ns] |
522+ td64[ns] | ndarray[m8ns] | TimedeltaArray| ndarray[m8ns] | ndarray[m8ns] |
520523 Period | ndarray[obj] | PeriodArray | PeriodArray | ndarray[int] |
521524 Nullable | EA | EA | EA | ndarray |
522525
0 commit comments