Skip to content

Commit 8fa731c

Browse files
committed
fix tests and docs
1 parent 682c0c7 commit 8fa731c

File tree

7 files changed

+11
-11
lines changed

7 files changed

+11
-11
lines changed

pandas/io/json/_table_schema.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ def build_table_schema(
275275
>>> df = pd.DataFrame(
276276
... {'A': [1, 2, 3],
277277
... 'B': ['a', 'b', 'c'],
278-
... 'C': pd.date_range('2016-01-01', freq='d', periods=3),
278+
... 'C': pd.date_range('2016-01-01', freq='D', periods=3),
279279
... }, index=pd.Index(range(3), name='idx'))
280280
>>> build_table_schema(df)
281281
{'fields': \

pandas/tests/indexes/datetimes/test_partial_slicing.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def test_string_index_series_name_converted(self):
3535
def test_stringified_slice_with_tz(self):
3636
# GH#2658
3737
start = "2013-01-07"
38-
idx = date_range(start=start, freq="1d", periods=10, tz="US/Eastern")
38+
idx = date_range(start=start, freq="1D", periods=10, tz="US/Eastern")
3939
df = DataFrame(np.arange(10), index=idx)
4040
df["2013-01-14 23:44:34.437768-05:00":] # no exception here
4141

pandas/tests/resample/test_period_index.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,12 +161,12 @@ def test_basic_downsample(self, simple_period_range_series):
161161
("Y-DEC", "<YearEnd: month=12>"),
162162
("Q-MAR", "<QuarterEnd: startingMonth=3>"),
163163
("M", "<MonthEnd>"),
164-
("w-thu", "<Week: weekday=3>"),
164+
("W-THU", "<Week: weekday=3>"),
165165
],
166166
)
167167
def test_not_subperiod(self, simple_period_range_series, rule, expected_error_msg):
168168
# These are incompatible period rules for resampling
169-
ts = simple_period_range_series("1/1/1990", "6/30/1995", freq="w-wed")
169+
ts = simple_period_range_series("1/1/1990", "6/30/1995", freq="W-WED")
170170
msg = (
171171
"Frequency <Week: weekday=2> cannot be resampled to "
172172
f"{expected_error_msg}, as they are not sub or super periods"

pandas/tests/resample/test_resample_api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -732,7 +732,7 @@ def test_agg_with_datetime_index_list_agg_func(col_name):
732732
),
733733
columns=[col_name],
734734
)
735-
result = df.resample("1d").aggregate(["mean"])
735+
result = df.resample("1D").aggregate(["mean"])
736736
expected = DataFrame(
737737
[47.5, 143.5, 195.5],
738738
index=date_range(start="2017-01-01", freq="D", periods=3, tz="Europe/Berlin"),

pandas/tests/resample/test_time_grouper.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ def test_aggregate_nth():
193193
)
194194
def test_resample_entirely_nat_window(method, method_args, unit):
195195
ser = Series([0] * 2 + [np.nan] * 2, index=date_range("2017", periods=4))
196-
result = methodcaller(method, **method_args)(ser.resample("2d"))
196+
result = methodcaller(method, **method_args)(ser.resample("2D"))
197197

198198
exp_dti = pd.DatetimeIndex(["2017-01-01", "2017-01-03"], dtype="M8[ns]", freq="2D")
199199
expected = Series([0.0, unit], index=exp_dti)
@@ -372,7 +372,7 @@ def test_groupby_resample_interpolate_with_apply_syntax(groupy_test_df):
372372

373373
for df in dfs:
374374
result = df.groupby("volume").apply(
375-
lambda x: x.resample("1d").interpolate(method="linear"),
375+
lambda x: x.resample("1D").interpolate(method="linear"),
376376
include_groups=False,
377377
)
378378

pandas/tests/scalar/timedelta/methods/test_round.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ class TestTimedeltaRound:
3838
("min", "1 days 02:35:00", "-1 days 02:35:00"),
3939
("12min", "1 days 02:36:00", "-1 days 02:36:00"),
4040
("h", "1 days 03:00:00", "-1 days 03:00:00"),
41-
("d", "1 days", "-1 days"),
41+
("D", "1 days", "-1 days"),
4242
],
4343
)
4444
def test_round(self, freq, s1, s2):

pandas/tests/window/test_timeseries_window.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,15 +101,15 @@ def test_on(self, regular):
101101
# column is valid
102102
df = df.copy()
103103
df["C"] = date_range("20130101", periods=len(df))
104-
df.rolling(window="2d", on="C").sum()
104+
df.rolling(window="2D", on="C").sum()
105105

106106
# invalid columns
107107
msg = "window must be an integer"
108108
with pytest.raises(ValueError, match=msg):
109109
df.rolling(window="2d", on="B")
110110

111111
# ok even though on non-selected
112-
df.rolling(window="2d", on="C").B.sum()
112+
df.rolling(window="2D", on="C").B.sum()
113113

114114
def test_monotonic_on(self):
115115
# on/index must be monotonic
@@ -682,7 +682,7 @@ def test_rolling_on_multi_index_level(self):
682682
[date_range("20190101", periods=3), range(2)], names=["date", "seq"]
683683
),
684684
)
685-
result = df.rolling("10d", on=df.index.get_level_values("date")).sum()
685+
result = df.rolling("10D", on=df.index.get_level_values("date")).sum()
686686
expected = DataFrame(
687687
{"column": [0.0, 1.0, 3.0, 6.0, 10.0, 15.0]}, index=df.index
688688
)

0 commit comments

Comments
 (0)