Support location for BigQueryInsertJobOperator in deferrable mode#37282
Merged
potiuk merged 1 commit intoapache:mainfrom Feb 12, 2024
Merged
Conversation
2f81cba to
89a8da6
Compare
Contributor
potiuk
approved these changes
Feb 12, 2024
81 tasks
Contributor
|
A little late here - but gcloud-aio released today the inclusion of a Perhaps with this work around merged in, we no longer need it. But we could also build around leveraging that param now. |
2 tasks
79 tasks
2 tasks
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR provides a workaround solution for the issue #35833.
It is really necessary because users are unable to use
BigQueryInsertJobOperatorin deferrable mode in regions other thanEU,USorus-central1. This fix was provided now because there is no response neither fromgcloud-aionorgoogle-cloud-bigqueryregarding their plans for providing async get_job method with the optionallocationparameter.The proposed solution:
BigQueryAsyncHookwraps the call of the synchronous methodBigQueryAsyncHook.get_job()inasyncio.loop.run_in_executor().locationis passed from theBigQueryInsertJobOperatorto theBigQueryInsertJobTrigger, where it is handed to the hook.BigQueryInsertJobTriggeris a parent class for other four triggers (see below), they were updated in order to comply with the base class attributes.BigQueryAsyncHook.get_job_status()don;t change behavior because the optional parameterlocationis ignored there. However, it would be very nice to fix them too and test carefully in a separated PR:closes: #35833