-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
allow back-compat of timezone specifier #7074
Comments
cc @shoyer |
@shoyer This looks like the last thing needed for the 1.11.0 beta. |
@jreback Is your main concern a flood of deprecation warnings? |
well you need different code in numpy < 1.11 from >= 1.11 to get equivalent results. |
So, perhaps a FutureWarning and a long wait? |
@jreback What would be the best fix from your point of view? |
I @shoyer had the right soln. maybe leave the change along and if it is a UTC zone (e.g. a single 'Z') then show the |
I think we need the back compat. What numpy versions do you officially support? |
1.7+ |
That's exactly what current master & the 1.11 branch are doing, right? except that they use DeprecationWarning instead of FutureWarning? This is what deprecation warnings are for, to give a period where the old behavior continues to be accepted for back-compat :-) |
@njsmith BUT the problem is that I cannot change it AND have compat with previous versions. So I have either to have to accept a warning (and catch it only in >= 1.11 and not change any code), or use a compat function so that I don't get a warning in prior versions. I cannot simply change it if I want to maintain across numpy versions. |
Maybe |
@jreback: Still not sure I understand :-/. I think your options are:
I don't really see what numpy can do that would give you any other options, other than (3) just don't make the change at all. But I think we do want to eventually get rid of allowing the timezone in the string for naive datetime64s -- if nothing else it's necessary to clear the way to having real timezone support later! I can certainly see an argument that we should give the handling of Z timezones a longer deprecation period than we allow for other timezones, given that pandas uses them. Beyond that, what concretely do you want numpy to do? |
guess I will have to do option 2. |
@jreback If you make a shim function, could you post it here? That way folks running into the warning might find it. Also, could the |
your messaging is good.
|
Sorry to be pushy, but this is the last thing on the 1.11.0 release milestone. Is there something that is actionable here? I am willing to help if there is some clear actionable. Alternatively, could we make an alpha release while anything else here gets resolved and then add it in a beta? |
I guess nothing to do |
Closing this then. |
recently merged PR on fixing datetime w/tz parsing: #6453
we are hitting this in lots of places in here
I can simply put in a compat function to make this work with many versions of numpy (and not show the warning), but
it might make sense for back-compat to allow acceptance:
np.datetime64('2007-01-01 09:00:00.001Z')
w/o showing the deprecation warning as this is de-facto (at present) a naive timezone in numpy anyhow AND this allows the same code to work in numpy < 1.11(of course if a non-UTC tz, e.g. anything beyond the
Z
) then I would continue to do as the revised function.The text was updated successfully, but these errors were encountered: