|
29 | 29 |
|
30 | 30 | import numpy as np
|
31 | 31 |
|
32 |
| -from pandas._libs import Timestamp, lib |
| 32 | +from pandas._libs import lib |
33 | 33 | from pandas._typing import FrameOrSeries
|
34 | 34 | from pandas.util._decorators import Appender, Substitution, doc
|
35 | 35 |
|
@@ -388,7 +388,7 @@ def _wrap_aggregated_output(
|
388 | 388 | result = self._wrap_series_output(
|
389 | 389 | output=output, index=self.grouper.result_index
|
390 | 390 | )
|
391 |
| - return self._reindex_output(result)._convert(datetime=True) |
| 391 | + return self._reindex_output(result) |
392 | 392 |
|
393 | 393 | def _wrap_transformed_output(
|
394 | 394 | self, output: Mapping[base.OutputKey, Union[Series, np.ndarray]]
|
@@ -1346,14 +1346,10 @@ def first_not_none(values):
|
1346 | 1346 |
|
1347 | 1347 | # values are not series or array-like but scalars
|
1348 | 1348 | else:
|
1349 |
| - # only coerce dates if we find at least 1 datetime |
1350 |
| - should_coerce = any(isinstance(x, Timestamp) for x in values) |
1351 | 1349 | # self._selection_name not passed through to Series as the
|
1352 | 1350 | # result should not take the name of original selection
|
1353 | 1351 | # of columns
|
1354 |
| - return Series(values, index=key_index)._convert( |
1355 |
| - datetime=True, coerce=should_coerce |
1356 |
| - ) |
| 1352 | + return Series(values, index=key_index) |
1357 | 1353 |
|
1358 | 1354 | else:
|
1359 | 1355 | # Handle cases like BinGrouper
|
@@ -1703,7 +1699,7 @@ def _wrap_aggregated_output(
|
1703 | 1699 | if self.axis == 1:
|
1704 | 1700 | result = result.T
|
1705 | 1701 |
|
1706 |
| - return self._reindex_output(result)._convert(datetime=True) |
| 1702 | + return self._reindex_output(result) |
1707 | 1703 |
|
1708 | 1704 | def _wrap_transformed_output(
|
1709 | 1705 | self, output: Mapping[base.OutputKey, Union[Series, np.ndarray]]
|
|
0 commit comments