|
6 | 6 |
|
7 | 7 | from collections import abc, defaultdict |
8 | 8 | import contextlib |
9 | | -from datetime import datetime, timedelta |
10 | 9 | from functools import partial |
11 | 10 | import inspect |
12 | 11 | from typing import Any, Collection, Iterable, Iterator, List, Union, cast |
13 | 12 | import warnings |
14 | 13 |
|
15 | 14 | import numpy as np |
16 | 15 |
|
17 | | -from pandas._libs import lib, tslibs |
| 16 | +from pandas._libs import lib |
18 | 17 | from pandas._typing import AnyArrayLike, Scalar, T |
19 | 18 | from pandas.compat.numpy import np_version_under1p18 |
20 | 19 |
|
@@ -78,21 +77,6 @@ def consensus_name_attr(objs): |
78 | 77 | return name |
79 | 78 |
|
80 | 79 |
|
81 | | -def maybe_box_datetimelike(value, dtype=None): |
82 | | - # turn a datetime like into a Timestamp/timedelta as needed |
83 | | - if dtype == object: |
84 | | - # If we dont have datetime64/timedelta64 dtype, we dont want to |
85 | | - # box datetimelike scalars |
86 | | - return value |
87 | | - |
88 | | - if isinstance(value, (np.datetime64, datetime)): |
89 | | - value = tslibs.Timestamp(value) |
90 | | - elif isinstance(value, (np.timedelta64, timedelta)): |
91 | | - value = tslibs.Timedelta(value) |
92 | | - |
93 | | - return value |
94 | | - |
95 | | - |
96 | 80 | def is_bool_indexer(key: Any) -> bool: |
97 | 81 | """ |
98 | 82 | Check whether `key` is a valid boolean indexer. |
@@ -347,23 +331,6 @@ def apply_if_callable(maybe_callable, obj, **kwargs): |
347 | 331 | return maybe_callable |
348 | 332 |
|
349 | 333 |
|
350 | | -def dict_compat(d): |
351 | | - """ |
352 | | - Helper function to convert datetimelike-keyed dicts |
353 | | - to Timestamp-keyed dict. |
354 | | -
|
355 | | - Parameters |
356 | | - ---------- |
357 | | - d: dict like object |
358 | | -
|
359 | | - Returns |
360 | | - ------- |
361 | | - dict |
362 | | -
|
363 | | - """ |
364 | | - return {maybe_box_datetimelike(key): value for key, value in d.items()} |
365 | | - |
366 | | - |
367 | 334 | def standardize_mapping(into): |
368 | 335 | """ |
369 | 336 | Helper function to standardize a supplied mapping. |
|
0 commit comments