| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
|
@lqiu96 This check (java 8 only) is failing with Error: JsonToProtoMessageTest.testTimestampRepeated:890 expected:<test_string_repeated: 10 test_string_t_z_repeated: 1648493279010000 test_long_repeated: 1687984085000000 test_int_repeated: 153480695 test_float_repeated: [15346](https://github.com/googleapis/java-bigquerystorage/actions/runs/11942130315/job/33288467778?pr=2780#step:6:15347)8069500 test_offset_repeated: 1649135171000000 test_timezone_repeated: 1649174771000000 test_saformat_repeated: 1534680660000000 > but was:<test_string_repeated: 10 test_string_t_z_repeated: 1648493279010000 test_long_repeated: 1687984085000000 test_int_repeated: [15348](https://github.com/googleapis/java-bigquerystorage/actions/runs/11942130315/job/33288467778?pr=2780#step:6:15349)0695 test_float_repeated: 153468069500 test_offset_repeated: 1649149571000000 test_timezone_repeated: 1649174771000000 test_saformat_repeated: 1534680660000000 > The problem is with test_offset_repeated; it's the same as googleapis/sdk-platform-java#3330 (comment), but the difference here is that we use appendOffset() with a default zone string of +00:00, while the one in appendZoneOrOffsetId() is Z |
Sorry, something went wrong.
| .appendLiteral(' ') | ||
| .optionalEnd() | ||
| .optionalStart() | ||
| .appendOffset("+HH:MM", "+00:00") | ||
| .appendZoneOrOffsetId() | ||
| .optionalEnd() | ||
| .optionalStart() | ||
| .appendZoneText(TextStyle.SHORT) | ||
| .optionalEnd() | ||
| .optionalStart() | ||
| .appendLiteral('Z') | ||
| .optionalEnd() | ||
| .toFormatter() | ||
| .withZone(ZoneOffset.UTC); |
There was a problem hiding this comment.
This fix works for the current tests. Note that the literal Z is dropped from the config because appendZoneOrOffsetId() uses Z as the no-zone string
Sorry, something went wrong.
There was a problem hiding this comment.
Added a test for +00:00 in 260c835
Sorry, something went wrong.
|
|
||
| package com.google.cloud.bigquery.storage.util; | ||
|
|
||
| public class TimeConversionUtils { |
There was a problem hiding this comment.
Why is this added in BQStorage and not used from sdk-platform-java?
Sorry, something went wrong.
There was a problem hiding this comment.
They are functions only used in BQS so far (confirmed other repos don't need them). However, the reason is simply because it's faster to implement here than waiting for a new release of gax with the utilities we have here. What if we follow up in gax and temporarily have these functions in this repo?
Sorry, something went wrong.
There was a problem hiding this comment.
What if we follow up in gax and temporarily have these functions in this repo?
Sure. Can we make this class package-private until we migrate this to Gax? Can you also create an issue in sdk-platform-java for this?
Sorry, something went wrong.
There was a problem hiding this comment.
As discussed internally, left as @InternalApi, referencing the new issue in sdk-platform: https://github.com/googleapis/sdk-platform-java/issues/3412
Sorry, something went wrong.
| <to>java.time.Duration</to> | ||
| </difference> | ||
| <difference> | ||
| <!--The retryDelay field is used by ApiResultRetryAlgorithm, which is marked as @InternalApi--> |
There was a problem hiding this comment.
Errors$IsRetryableStatusResult is still marked as public even if it's only used by ApiResultRetryAlgorithm in the BQStorage SDK. I think it's still accessible which is problematic.
Sorry, something went wrong.
There was a problem hiding this comment.
@PhongChuong what's the rationale of Errors$IsRetryableStatusResult being public? Is it similar to the case of ApiResultRetryAlgorithm "visible for technical reasons"?
Also, does it make sense to change their datatypes directly, without threeten alternatives as done currently?
Sorry, something went wrong.
There was a problem hiding this comment.
I don't know the historical reason as to why it is public but from the code, I would assume that is it "visible for technical reasons". Specifically, while IsRetryableStatusResult is public, it seems to be only used in ApiResultRetryAlgorithm and it is not part of the return value. I think it would be okay to change the datatype directly here.
@yirutang , what do you think?
Sorry, something went wrong.
There was a problem hiding this comment.
I am fine making it private. I don't think external user should use it.
Sorry, something went wrong.
There was a problem hiding this comment.
Overall the changes looks good. Thank you for the PR, it looks like a lot of work tracking down all the changes needed.
Sorry, something went wrong.
| <to>java.time.Duration</to> | ||
| </difference> | ||
| <difference> | ||
| <!--The retryDelay field is used by ApiResultRetryAlgorithm, which is marked as @InternalApi--> |
There was a problem hiding this comment.
I don't know the historical reason as to why it is public but from the code, I would assume that is it "visible for technical reasons". Specifically, while IsRetryableStatusResult is public, it seems to be only used in ApiResultRetryAlgorithm and it is not part of the return value. I think it would be okay to change the datatype directly here.
@yirutang , what do you think?
Sorry, something went wrong.
There was a problem hiding this comment.
LGTM. Added a small comment if you could address
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
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).