Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Periods don't sort correctly #2781

Closed
dhirschfeld opened this issue Jan 31, 2013 · 5 comments · Fixed by #2987
Closed

Periods don't sort correctly #2781

dhirschfeld opened this issue Jan 31, 2013 · 5 comments · Fixed by #2987
Labels
Bug Datetime Datetime data dtype
Milestone

Comments

@dhirschfeld
Copy link
Contributor

Unless I'm mistaken I think the following unit-test should pass:

def test_period_sorting():
    periods = [pd.Period('2008-04', 'M'),
               pd.Period('2008-02', 'M'),
               pd.Period('2008-01', 'M'),
               pd.Period('2008-05', 'M'),
               pd.Period('2008-06', 'M'),
               pd.Period('2008-03', 'M'),
               pd.Period('2008-04', 'M'),
               pd.Period('2008-02', 'M'),
               pd.Period('2008-01', 'M'),
               pd.Period('2008-05', 'M'),
               pd.Period('2008-06', 'M'),
               pd.Period('2008-03', 'M'),
               pd.Period('2008-04', 'M'),
               pd.Period('2008-02', 'M'),
               pd.Period('2008-01', 'M'),
               pd.Period('2008-05', 'M'),
               pd.Period('2008-06', 'M'),
               pd.Period('2008-03', 'M')]
    assert sorted([p.to_timestamp() for p in periods]) \
        == [p.to_timestamp() for p in sorted(periods)]
#
@jreback
Copy link
Contributor

jreback commented Mar 21, 2013

can you copy your example to your PR, and then close this? thxs

@dhirschfeld
Copy link
Contributor Author

AFAIK the "correct" way to do this is to state closes #2781 or fixes #2781 in your commit message in which case GitHub will automatically add a reference to this issue in your PR and will automatically close this issue when your PR gets merged into upstream. The reason this isn't being done is because you're missing the # symbol in front of the issue number.

I think it would be a bit premature to close the issue before PR is merged, but I'm watching the PR & am happy to close once it gets merged.

@dhirschfeld
Copy link
Contributor Author

This issue is fixed in PR #2987.

@ghost
Copy link

ghost commented Mar 21, 2013

I tend to avoid # mentions in commit messages, because rewriting PR branches and pushing
pollutes the issue page with multiple references, so I stopped using it and use GH1234
instead, closing things manually. github support never got back to me on being able to
delete references manually, that was months ago.

@jreback
Copy link
Contributor

jreback commented Mar 21, 2013

yes you are right, just trying to remove the issues from the 0.11 list (and your PR is marked 0.11, but on the PR list not issues)....

@wesm wesm closed this as completed Mar 28, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Datetime Datetime data dtype
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants