-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Support beam:logical_type:micros_instant:v1 in SpannerIo. #36840
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
base: master
Are you sure you want to change the base?
Conversation
1803689 to
1844618
Compare
|
Assigning reviewers: R: @shunping for label python. Note: If you would like to opt out of this review, comment Available commands:
The PR bot will only process comments in the main thread (not review comments). |
|
/gemini review |
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.
Code Review
This pull request adds support for microsecond-precision timestamps (MicrosInstant logical type) in SpannerIO. The changes correctly handle the conversion between java.time.Instant and Spanner's Timestamp for both writing and reading data. The integration tests have also been updated to cover this new functionality.
My review focuses on improving code maintainability by reducing duplication and enhancing the completeness of the integration tests. I've identified a few areas where helper methods could be introduced to centralize conversion logic, and a couple of test cases where assertions could be made more robust.
...io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/spanner/MutationUtils.java
Outdated
Show resolved
Hide resolved
...a/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/spanner/StructUtils.java
Outdated
Show resolved
Hide resolved
sdks/python/apache_beam/io/gcp/tests/xlang_spannerio_it_test.py
Outdated
Show resolved
Hide resolved
sdks/python/apache_beam/io/gcp/tests/xlang_spannerio_it_test.py
Outdated
Show resolved
Hide resolved
Abacn
left a comment
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.
LGTM after dedup conversion logics suggested by AI code review
nielm
left a comment
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.
Please also implement the gemini code assist changes...
.../google-cloud-platform/src/test/java/org/apache/beam/sdk/io/gcp/spanner/StructUtilsTest.java
Outdated
Show resolved
Hide resolved
sdks/python/apache_beam/io/gcp/tests/xlang_spannerio_it_test.py
Outdated
Show resolved
Hide resolved
cdccfd4 to
e6d62fe
Compare
|
@nielm can you please take another look? |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #36840 +/- ##
=========================================
Coverage 40.33% 40.34%
- Complexity 3456 3469 +13
=========================================
Files 1225 1225
Lines 187817 187859 +42
Branches 3586 3597 +11
=========================================
+ Hits 75762 75793 +31
- Misses 108665 108668 +3
- Partials 3390 3398 +8
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This adds support for the micros instant logical type in spanner IO reads and writes.
Thank you for your contribution! Follow this checklist to help us incorporate your contribution quickly and easily:
addresses #123), if applicable. This will automatically add a link to the pull request in the issue. If you would like the issue to automatically close on merging the pull request, commentfixes #<ISSUE NUMBER>instead.CHANGES.mdwith noteworthy changes.See the Contributor Guide for more tips on how to make review process smoother.
To check the build health, please visit https://github.com/apache/beam/blob/master/.test-infra/BUILD_STATUS.md
GitHub Actions Tests Status (on master branch)
See CI.md for more information about GitHub Actions CI or the workflows README to see a list of phrases to trigger workflows.