Skip to content

Commit 441d6d3

Browse files
authored
Update dtypes.py
removed if statements
1 parent 73da90c commit 441d6d3

File tree

1 file changed

+0
-12
lines changed

1 file changed

+0
-12
lines changed

pandas/core/dtypes/dtypes.py

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2277,18 +2277,6 @@ def name(self) -> str: # type: ignore[override]
22772277
@cache_readonly
22782278
def numpy_dtype(self) -> np.dtype:
22792279
"""Return an instance of the related numpy dtype"""
2280-
if pa.types.is_timestamp(self.pyarrow_dtype):
2281-
# pa.timestamp(unit).to_pandas_dtype() returns ns units
2282-
# regardless of the pyarrow timestamp units.
2283-
# This can be removed if/when pyarrow addresses it:
2284-
# https://github.com/apache/arrow/issues/34462
2285-
return np.dtype(f"datetime64[{self.pyarrow_dtype.unit}]")
2286-
if pa.types.is_duration(self.pyarrow_dtype):
2287-
# pa.duration(unit).to_pandas_dtype() returns ns units
2288-
# regardless of the pyarrow duration units
2289-
# This can be removed if/when pyarrow addresses it:
2290-
# https://github.com/apache/arrow/issues/34462
2291-
return np.dtype(f"timedelta64[{self.pyarrow_dtype.unit}]")
22922280
if pa.types.is_string(self.pyarrow_dtype) or pa.types.is_large_string(
22932281
self.pyarrow_dtype
22942282
):

0 commit comments

Comments
 (0)