-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Replace StorageV1 client with GCS client (take 4) #28079
Conversation
Codecov Report
@@ Coverage Diff @@
## master #28079 +/- ##
==========================================
- Coverage 72.31% 71.96% -0.36%
==========================================
Files 684 680 -4
Lines 101727 100163 -1564
==========================================
- Hits 73567 72080 -1487
+ Misses 26581 26505 -76
+ Partials 1579 1578 -1
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 14 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
|
||
return [(pair[0], pair[1], pair_to_status[pair]) for pair in src_dest_pairs] | ||
for pair, resp in list(zip(current_pairs, current_batch._responses)): |
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.
May mentioned in the past - current_paths and current_batch._responses has different length. Actually, for copy the response has 4x of the length as the current_paths. This is because copy involves multiple operations.
python zip does not care length match and this would miss potential error code beyond first N response (N=batch size)
May consider zip(current_batch._target_objects, current_batch._responses) they should have the same size.
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.
I'm pretty sure I'm testing for this already, but I've added an assertion just to be sure
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.
I made a test like this
also added some print to gcsio.py
Output:
5 20
200 200 200 200
200 200 200 200
200 200 200 200
200 404 200 404
200 200 200 200
gs://clouddfe-yihu-test/temp1/gcs_0.txt gs://clouddfe-yihu-test/temp2/gcs_0.txt 200
gs://clouddfe-yihu-test/temp1/gcs_1.txt gs://clouddfe-yihu-test/temp2/gcs_1.txt 200
gs://clouddfe-yihu-test/temp1/gcs_2.txt gs://clouddfe-yihu-test/temp2/gcs_2.txt 200
gs://clouddfe-yihu-test/temp1/gcs_3.txt gs://clouddfe-yihu-test/temp2/gcs_3.txt 200
gs://clouddfe-yihu-test/temp1/gcs_4.txt gs://clouddfe-yihu-test/temp2/gcs_4.txt 200
As can be seen, the length current_pairs and current_batch._responses is different (4 fold), and the return value missed the 404 code
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.
I see what you're saying, and running the tests with the assertion included has confirmed it. I'll dig into the client more to see what we can do about it.
Run Python 3.11 PostCommit |
Run Python 3.11 PostCommit |
Run Python 3.11 PostCommit |
6 similar comments
Run Python 3.11 PostCommit |
Run Python 3.11 PostCommit |
Run Python 3.11 PostCommit |
Run Python 3.11 PostCommit |
Run Python 3.11 PostCommit |
Run Python 3.11 PostCommit |
Run Python_Runners PreCommit 3.10 |
6933f3e
to
a86bb2d
Compare
Run Python 3.11 PostCommit |
fc594f5
to
208c369
Compare
Run Python 3.11 PostCommit |
1 similar comment
Run Python 3.11 PostCommit |
208c369
to
d3023c8
Compare
Checks are failing. Will not request review until checks are succeeding. If you'd like to override that behavior, 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.
Thanks for persistent on this. I went through carefully and commented on potential issues I found.
@@ -224,23 +223,6 @@ def test_delete_dataset_retries_for_timeouts(self, patched_time_sleep): | |||
wrapper._delete_dataset('', '') | |||
self.assertTrue(client.datasets.Delete.called) | |||
|
|||
@unittest.skipIf( |
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.
this test gets removed while the reason why it fails internally remains unknown. From a high level there might be still some regression regarding credential / anonymous credentials - to aware
I am fine with it for now but please do not remove the test until we understand why it fails in certain environment, could skip if for now
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.
I discussed this with Pablo and we agreed that the test was no longer necessary. While its failure is curious, IIRC, we determined that the test was not ultimately testing something relevant to production, so we didn't actually need to worry about it.
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.
This tests if user agent info is added to the request sent to bigquery. In various gcp component we use this info to track usage. This effort is active e.g. gcs counterpart #26770 #27211
That's possibly why it is saying not relevent to production, but does not mean it can be removed
We can make it "skipped" but please do not remove test
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.
Okay, I'll skip it and open an issue for it, since you say it's important.
Assigning reviewers. If you would like to opt out of this review, comment R: @AnandInguva for label python. Available commands:
The PR bot will only process comments in the main thread (not review comments). |
Run Python 3.11 PostCommit |
93ab58e
to
904550e
Compare
PreCommit Portable Python workflow fails during clean up unrelated. Opened actions/setup-java#543 |
…ache#28721) This reverts commit 56b1259.
The two commits are merged into one: * Reapply "Replace StorageV1 client with GCS client (apache#28079)" (apache#28721) * added project parameter to apiclient
* Cherry pick two previous commits on migrating gcs client The two commits are merged into one: * Reapply "Replace StorageV1 client with GCS client (#28079)" (#28721) * added project parameter to apiclient * Initialze storage client with project from pipeline option. --------- Co-authored-by: Bjorn Pedersen <[email protected]>
* Cherry pick two previous commits on migrating gcs client The two commits are merged into one: * Reapply "Replace StorageV1 client with GCS client (apache#28079)" (apache#28721) * added project parameter to apiclient * Initialze storage client with project from pipeline option. --------- Co-authored-by: Bjorn Pedersen <[email protected]>
Addresses #25676.
Now with improved error handling on batch requests (and test coverage of same).
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.md
with 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.