-
Notifications
You must be signed in to change notification settings - Fork 121
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
feat: introduce java.time
methods and variables
#3586
Conversation
/** | ||
* Creates a {@code QueryParameterValue} object with a type of INTERVAL. This method is obsolete. | ||
* Use {@link #interval(String)} instead. | ||
*/ | ||
@ObsoleteApi("Use interval(String) instead") | ||
public static QueryParameterValue interval(PeriodDuration value) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@lqiu96 I'm not sure if this makes sense. PeriodDuration
is part of Threeten Extra which only accepts java.time
objects. The class purpose is to blend a Period
(years to days) with a Duration
(hours to nanos).
I'm guessing we may want to keep it since it's just a helper class that happens to be from ThreeTen but not meant to be a backport (since this is not available in the JDK).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm. Ideally, I think we should try to migrate away from threeten-extra as well. I'm guessing from your comment that PeriodDuration doesn't exist in the JDK so we can't build a 1:1 method signature replacement with the available JDK alternative.
If interval(String)
has the same behavior, then I think that probably can use that as the alternative. But would be a question for the Bigquery SMEs to confirm that they have the same behavior.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you. @PhongChuong can you please confirm whether marking this threeten-extra
-based method as @ObsoleteApi
makes sense? And does interval(String)
as the suggested alternative make sense?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@diegomarquezp , marking it as @ObsoleteApi and the suggested alternative makes sense.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
This PR introduces
java.time
alternatives to existingorg.threeten.bp.*
methods, as well as switching internal variables (if any) tojava.time
The main constraint is to keep the changes backwards compatible, so for each existing threeten method "
method1(org.threeten.bp.Duration)
" we will add an alternative with a Duration (or Timestamp when applicable) suffix: "method1Duration(java.time.Duration)
".For most cases, the implementation will be held in the
java.time
method and the old threeten method will just delegate the call to it. However, for the case of abstract classes, the implementation will be kept in the threeten method to avoid breaking changes (i.e. users that already overloaded the method in their user code).