FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

feat: introduce `java.time` methods and variables by diegomarquezp · Pull Request #3586 · googleapis/java-bigquery · GitHub

This repository was archived by the owner on Mar 23, 2026. It is now read-only.
/ java-bigquery Public archive

feat: introduce java.time methods and variables - #3586

Merged
diegomarquezp merged 2 commits into
mainfrom
introduce-java-time
Dec 3, 2024
Merged

feat: introduce java.time methods and variables#3586
diegomarquezp merged 2 commits into
mainfrom
introduce-java-time

Conversation

Copy link
Copy Markdown
Contributor

This PR introduces java.time alternatives to existing org.threeten.bp.* methods, as well as switching internal variables (if any) to java.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).

product-auto-label Bot added size: m Pull request size is medium. api: bigquery Issues related to the googleapis/java-bigquery API. labels Nov 19, 2024
Comment on lines +349 to 354
/**
* 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) {

diegomarquezp Nov 20, 2024
edited
Loading

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

@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).

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.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

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?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

@diegomarquezp , marking it as @ObsoleteApi and the suggested alternative makes sense.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Thanks!

diegomarquezp requested a review from lqiu96 November 20, 2024 02:41
diegomarquezp marked this pull request as ready for review November 20, 2024 02:41
diegomarquezp requested review from a team, PhongChuong and chalmerlowe November 20, 2024 02:41
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

api: bigquery Issues related to the googleapis/java-bigquery API. size: m Pull request size is medium.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants


Back | FazBrowse Home | New Git URL