Skip to content

Added test for #5091 (Missing Periods for some DateOffsets)#33195

Closed
gorogoroumaru wants to merge 6 commits into
pandas-dev:masterfrom
gorogoroumaru:issue5091
Closed

Added test for #5091 (Missing Periods for some DateOffsets)#33195
gorogoroumaru wants to merge 6 commits into
pandas-dev:masterfrom
gorogoroumaru:issue5091

Conversation

@gorogoroumaru

@gorogoroumaru gorogoroumaru commented Apr 1, 2020

Copy link
Copy Markdown

Comment thread pandas/tests/series/test_timeseries.py Outdated
# does .resample() set .freq correctly?
assert df.resample("D").asfreq().index.freq == "D"

def test_period_dateoffset_conversion(self):

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you put this test in pandas/tests/indexes/period/test_to_timestamp.py

Comment thread pandas/tests/series/test_timeseries.py Outdated
assert df.resample("D").asfreq().index.freq == "D"

def test_period_dateoffset_conversion(self):
ts = pd.date_range('1/1/2012', periods=4, freq=pd.offsets.BQuarterEnd())

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add the issue number to this test? # GH 5091

Comment thread pandas/tests/series/test_timeseries.py Outdated
per = ts.to_period()
ts_per = per.to_timestamp()

tm.assert_datetime_array_equal(ts, ts_per)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could use use tm.assert_index_equal and rename the variables so it reads tm.assert_index_equal(result, expected)

@mroeschke mroeschke added the Testing pandas testing functions or related to the test suite label Apr 1, 2020
@mroeschke mroeschke added this to the 1.1 milestone Apr 1, 2020
@mroeschke

Copy link
Copy Markdown
Member

Ah my mistake. When reviewing that issue I too hastily concluded that the issue was solved.

Any interest in helping solving the bug? Otherwise, definitely recommend other issues that are tagged good first issue

@gorogoroumaru

Copy link
Copy Markdown
Author

Thank you, I will try another issue.

@mroeschke mroeschke closed this Apr 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Testing pandas testing functions or related to the test suite

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Missing Periods for some DateOffsets

2 participants