Skip to content

Commit f1a0ede

Browse files
committed
Merge branch 'bugfix-arrowdtypes-timezone' of https://github.com/Koookadooo/pandas into bugfix-arrowdtypes-timezone
pulling upstream changes to push local changes
2 parents 599579e + 3f3c383 commit f1a0ede

File tree

4 files changed

+13
-8
lines changed

4 files changed

+13
-8
lines changed

pandas/core/computation/expressions.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,11 @@ def where(cond, left_op, right_op, use_numexpr: bool = True):
257257
Whether to try to use numexpr.
258258
"""
259259
assert _where is not None
260-
return _where(cond, left_op, right_op) if use_numexpr else _where_standard(cond, left_op, right_op)
260+
return (
261+
_where(cond, left_op, right_op)
262+
if use_numexpr
263+
else _where_standard(cond, left_op, right_op)
264+
)
261265

262266

263267
def set_test_mode(v: bool = True) -> None:

pandas/core/computation/pytables.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,9 @@ def stringify(value):
274274
# string quoting
275275
return TermValue(conv_val, stringify(conv_val), "string")
276276
else:
277-
raise TypeError(f"Cannot compare {conv_val} of type {type(conv_val)} to {kind} column")
277+
raise TypeError(
278+
f"Cannot compare {conv_val} of type {type(conv_val)} to {kind} column"
279+
)
278280

279281
def convert_values(self) -> None:
280282
pass

pandas/core/dtypes/dtypes.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2277,9 +2277,8 @@ def numpy_dtype(self) -> np.dtype:
22772277
"""Return an instance of the related numpy dtype."""
22782278
# For string-like arrow dtypes, pa.string().to_pandas_dtype() = object
22792279
# so we handle them explicitly.
2280-
if (
2281-
pa.types.is_string(self.pyarrow_dtype)
2282-
or pa.types.is_large_string(self.pyarrow_dtype)
2280+
if pa.types.is_string(self.pyarrow_dtype) or pa.types.is_large_string(
2281+
self.pyarrow_dtype
22832282
):
22842283
return np.dtype(str)
22852284

pandas/tests/dtypes/test_dtypes.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1103,16 +1103,16 @@ def test_update_dtype_errors(self, bad_dtype):
11031103
with pytest.raises(ValueError, match=msg):
11041104
dtype.update_dtype(bad_dtype)
11051105

1106+
11061107
class TestArrowDtype:
11071108
@pytest.mark.parametrize(
1108-
"tz",
1109-
["UTC", "America/New_York", "Europe/London", "Asia/Tokyo"]
1109+
"tz", ["UTC", "America/New_York", "Europe/London", "Asia/Tokyo"]
11101110
)
11111111
def test_pyarrow_timestamp_tz_preserved(self, tz):
11121112
pytest.importorskip("pyarrow")
11131113
s = Series(
11141114
pd.to_datetime(range(5), unit="h", utc=True).tz_convert(tz),
1115-
dtype=f"timestamp[ns, tz={tz}][pyarrow]"
1115+
dtype=f"timestamp[ns, tz={tz}][pyarrow]",
11161116
)
11171117

11181118
result = s.convert_dtypes(dtype_backend="pyarrow")

0 commit comments

Comments
 (0)