Skip to content

Commit 98e3afd

Browse files
committed
Fix doctest, typo
1 parent a892517 commit 98e3afd

File tree

8 files changed

+12
-8
lines changed

8 files changed

+12
-8
lines changed

pandas/conftest.py

+2
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,8 @@ def pytest_collection_modifyitems(items, config) -> None:
134134
("is_datetime64tz_dtype", "is_datetime64tz_dtype is deprecated"),
135135
("is_categorical_dtype", "is_categorical_dtype is deprecated"),
136136
("is_sparse", "is_sparse is deprecated"),
137+
("DatetimeArray.time", "with pyarrow time dtype"),
138+
("DatetimeIndex.time", "with pyarrow time dtype"),
137139
# Docstring divides by zero to show behavior difference
138140
("missing.mask_zero_div_zero", "divide by zero encountered"),
139141
(

pandas/core/arrays/datetimes.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1354,7 +1354,7 @@ def time(self) -> npt.NDArray[np.object_] | ArrowExtensionArray:
13541354
if opt is None:
13551355
warnings.warn(
13561356
f"The behavior of {type(self).__name__}.time is deprecated. "
1357-
"In a future version, this will an array with pyarrow time "
1357+
"In a future version, this will return an array with pyarrow time "
13581358
"dtype instead of object dtype. To opt in to the future behavior, "
13591359
"set `pd.set_option('future.infer_time', True)`.",
13601360
FutureWarning,

pandas/tests/arrays/test_datetimes.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ def test_time_date(self, dta_dti, meth):
156156
dta, dti = dta_dti
157157

158158
warn = None
159-
msg = "In a future version, this will an array with pyarrow time dtype"
159+
msg = "In a future version, this will return an array with pyarrow time dtype"
160160
if meth == "time":
161161
warn = FutureWarning
162162

pandas/tests/generic/test_finalize.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -684,7 +684,7 @@ def test_datetime_property(attr):
684684
s.attrs = {"a": 1}
685685

686686
warn = None
687-
msg = "In a future version, this will an array with pyarrow time dtype"
687+
msg = "In a future version, this will return an array with pyarrow time dtype"
688688
if attr == "time":
689689
warn = FutureWarning
690690
with tm.assert_produces_warning(warn, match=msg):

pandas/tests/indexes/datetimes/test_scalar_compat.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
class TestDatetimeIndexOps:
2525
def test_dti_time(self):
2626
rng = date_range("1/1/2000", freq="12min", periods=10)
27-
msg = "In a future version, this will an array with pyarrow time dtype"
27+
msg = "In a future version, this will return an array with pyarrow time dtype"
2828
with tm.assert_produces_warning(FutureWarning, match=msg):
2929
result = pd.Index(rng).time
3030
expected = [t.time() for t in rng]

pandas/tests/indexes/datetimes/test_timezones.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -854,7 +854,7 @@ def test_time_accessor(self, dtype):
854854

855855
index = DatetimeIndex(["2018-06-04 10:20:30", pd.NaT], dtype=dtype)
856856

857-
msg = "In a future version, this will an array with pyarrow time dtype"
857+
msg = "In a future version, this will return an array with pyarrow time dtype"
858858
with tm.assert_produces_warning(FutureWarning, match=msg):
859859
result = index.time
860860

pandas/tests/io/parser/test_parse_dates.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -479,7 +479,7 @@ def test_date_col_as_index_col(all_parsers):
479479
if parser.engine == "pyarrow":
480480
# https://github.com/pandas-dev/pandas/issues/44231
481481
# pyarrow 6.0 starts to infer time type
482-
msg = "In a future version, this will an array with pyarrow time dtype"
482+
msg = "In a future version, this will return an array with pyarrow time dtype"
483483
with tm.assert_produces_warning(FutureWarning, match=msg):
484484
expected["X2"] = pd.to_datetime("1970-01-01" + expected["X2"]).dt.time
485485

pandas/tests/series/accessors/test_dt_accessor.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,9 @@ def get_expected(ser, prop):
9191
return Series(result, index=ser.index, name=ser.name, dtype=result.dtype)
9292

9393
if name == "time":
94-
msg = "In a future version, this will an array with pyarrow time dtype"
94+
msg = (
95+
"In a future version, this will return an array with pyarrow time dtype"
96+
)
9597
with tm.assert_produces_warning(FutureWarning, match=msg):
9698
left = getattr(ser.dt, name)
9799
right = get_expected(ser, name)
@@ -680,7 +682,7 @@ def test_valid_dt_with_missing_values(self):
680682
)
681683
tm.assert_series_equal(result, expected)
682684

683-
msg = "In a future version, this will an array with pyarrow time"
685+
msg = "In a future version, this will return an array with pyarrow time"
684686
with tm.assert_produces_warning(FutureWarning, match=msg):
685687
result = ser.dt.time
686688
expected = Series([time(0), time(0), np.nan, time(0), time(0)], dtype="object")

0 commit comments

Comments
 (0)