Skip to content

ENH/COMPAT: update tests for dateutil 2.5.3 #12951

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

Closed
wants to merge 2 commits into from

Conversation

jreback
Copy link
Contributor

@jreback jreback commented Apr 21, 2016

closes #12944

so this fixes the compat with all dateutils in the test suite
add the dayfirst and yearfirst args to Timestamp. This make testing and compat a lot
easier. xref discussion in #7599 where we didn't implement it, though the feeling was sort of +0.

@jreback jreback added Datetime Datetime data dtype Compat pandas objects compatability with Numpy or Python functions labels Apr 21, 2016
@jreback jreback added this to the 0.18.1 milestone Apr 21, 2016
@jreback
Copy link
Contributor Author

jreback commented Apr 21, 2016

cc @jorisvandenbossche @sinhrks

@jreback
Copy link
Contributor Author

jreback commented Apr 21, 2016

so we might want to ban 2.5.2 from being accepted in pandas because it has a bug in the dayfirst/yearfirst logic, though it will raise an error (rather than give incorrect results). Though its an edge case.

@sinhrks
Copy link
Member

sinhrks commented Apr 21, 2016

How about showing a warning?

@jreback
Copy link
Contributor Author

jreback commented Apr 22, 2016

@TomAugspurger @jorisvandenbossche comments? (or +1 ok too: :)

@jorisvandenbossche
Copy link
Member

As I expressed (I think) my feeling about this in the previous discussions, I am (in principle) -1 on the addition of dayfirst/yearfirst to Timestamp (it is just not needed and bloats its constructor).
Is it really a big difference for the tests? I don't directly see how that would be a problem, I would just think that the yearfirst/dayfirst tests do not test for Timestamp?


# OK
# 2.5.1 10-11-12 [dayfirst=0, yearfirst=0] -> 2012-10-11 00:00:00
# 2.5.2 10-11-12 [dayfirst=0, yearfirst=1] -> 2012-10-11 00:00:00
Copy link
Member

Choose a reason for hiding this comment

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

Should the yearfirst be 0 here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

not sure what you mean, this is just printing out the 4 combinations of booleans (True/False).

@jreback
Copy link
Contributor Author

jreback commented Apr 23, 2016

@jorisvandenbossche IIRC you were not -1, but indifferent. But I dont' see why we are not compat, it just causes even more confusion. Yes this mainly fixes tests, but to be honest. Having Timestamp and to_datetime be pretty much exactly the same is a good thing.

@jreback
Copy link
Contributor Author

jreback commented Apr 26, 2016

ok I took dayfirst/yearfirst off of the public Timestamp constructor. So this is just a compat PR now that fixes up tests mainly.

@jorisvandenbossche
Copy link
Member

@jreback sorry, late reply. I was maybe indeed more indifferent, anyway, you already merged now. It would maybe indeed be more easy (implementation wise) that to_datetime and Timestamp work similar, but my main concern is that I would not want us to encourage people to use Timestamp for anything else as manually constructing a timestamp when needed (and then you should always provide a standard string, and not use eg dayfirst), so not eg for parsing strings, as for this there is to_datetime.

@jreback
Copy link
Contributor Author

jreback commented Apr 26, 2016

@jorisvandenbossche yeah, I think would have to add format & dayfirst and weekfirst to be really consistent. I actually don't think its a big deal really. People mis-use pd.to_datetime all the time. So it gives them more fuel to the fire!

thanks for the comments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Compat pandas objects compatability with Numpy or Python functions Datetime Datetime data dtype
Projects
None yet
Development

Successfully merging this pull request may close these issues.

COMPAT: python-dateutil 2.5.3
3 participants