Skip to content

Commit

Permalink
Remove patches post dependency fixes
Browse files Browse the repository at this point in the history
- lifts xfail from `test_monthly_freq`.
- removes patch in `helpers.resample` explained in
4a3e2de#diff-9bd6a7492809b04d13da665b8ae7d2fc75fae79930be1216fa77dc040fd2d3b1R381
  • Loading branch information
maread99 committed Sep 22, 2024
1 parent 12ba274 commit a15b65c
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 15 deletions.
10 changes: 0 additions & 10 deletions src/market_prices/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -378,16 +378,6 @@ def resample(

resampler = resample_me.resample(rule, closed="left", label="left", origin=origin)
resampled = resampler.agg(agg_f)

# NOTE START... required for at least pandas 2.1.0.
# See https://github.com/pandas-dev/pandas/issues/55064
offset = pdutils.pdfreq_to_offset(rule) if isinstance(rule, str) else rule
first_index = data.index[0] if nominal_start is None else nominal_start
cut_off = first_index - offset
if resampled.index[0] <= cut_off:
resampled = resampled[resampled.index > cut_off]
# required for at least pandas 2.1.0. ...END

resampled.columns = columns_
resampled = volume_to_na(resampled)
return resampled
5 changes: 0 additions & 5 deletions tests/test_pt.py
Original file line number Diff line number Diff line change
Expand Up @@ -2140,11 +2140,6 @@ def test_cbday_freq(self, daily_pt_ss, xnys):
df.pt.downsample("3d", xnys),
)

# TODO Remove xfail when pandas >2.2 released
# NB pd bug manifests in test, not package (manifests where takes a slice to
# evaluate 'subset').
# pandas issue ref is https://github.com/pandas-dev/pandas/issues/58604
@pytest.mark.xfail(reason="Known pd issue with py3.12, should resolve with pd>2.2")
def test_monthly_freq(self, daily_pt, xnys, x247, one_day, symbols):
"""Verify "MS" and "QS" frequencies."""
df = daily_pt
Expand Down

0 comments on commit a15b65c

Please sign in to comment.