Skip to content
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

Fix BigQueryInsertJobOperatorAsync failure after the google provider upgrade #471

Merged
merged 7 commits into from
Jun 27, 2022

Conversation

rajaths010494
Copy link
Contributor

@rajaths010494 rajaths010494 commented Jun 24, 2022

  • Sync version has changed and removed _job_id in operator which was used in our repo,
  • Code has been moved to hooks with certain changes.
  • Implement the code change needed for it in our repo

closes #470

@codecov
Copy link

codecov bot commented Jun 24, 2022

Codecov Report

Merging #471 (9756e9e) into main (e19c656) will not change coverage.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##             main     #471   +/-   ##
=======================================
  Coverage   97.66%   97.66%           
=======================================
  Files          62       62           
  Lines        3465     3465           
=======================================
  Hits         3384     3384           
  Misses         81       81           
Impacted Files Coverage Δ
...nomer/providers/google/cloud/operators/bigquery.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e19c656...9756e9e. Read the comment docs.

@rajaths010494 rajaths010494 marked this pull request as ready for review June 24, 2022 10:47
Copy link
Collaborator

@phanikumv phanikumv left a comment

Choose a reason for hiding this comment

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

Let's test in astro cloud after merging this.

@pankajkoti
Copy link
Collaborator

Let's test in astro cloud after merging this.

We should also be able to test this locally with the latest version of the provider.

- Add test case for generate_job_id
- remove unused ignore
@rajaths010494 rajaths010494 requested a review from kaxil June 24, 2022 13:54
@phanikumv phanikumv changed the title Fix BigQueryInsertJobOperatorAsync bug Fix BigQueryInsertJobOperatorAsync failure after the google provider upgrade Jun 27, 2022
Comment on lines +89 to +96
job_id = self.hook.generate_job_id(
job_id=self.job_id,
dag_id=self.dag_id,
task_id=self.task_id,
logical_date=context["logical_date"],
configuration=self.configuration,
force_rerun=self.force_rerun,
)
Copy link
Collaborator

@kaxil kaxil Jun 27, 2022

Choose a reason for hiding this comment

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

If you wanted to make this backwards and forwards-compatible without bumping the dependency, you could do the following:

try:
    # for google provider>=8.1.0
    job_id = self.hook.generate_job_id(
        job_id=self.job_id,
        dag_id=self.dag_id,
        task_id=self.task_id,
        logical_date=context["logical_date"],
        configuration=self.configuration,
        force_rerun=self.force_rerun,
    )
except AttributeError:
    # for google provider<8.1.0
    job_id = self._job_id(context)

@kaxil kaxil merged commit ca0f660 into main Jun 27, 2022
@kaxil kaxil deleted the fix-bigqueryinsertjoboperatorasync-bug branch June 27, 2022 09:39
@phanikumv phanikumv added this to the 1.6.0 milestone Jun 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix BigQueryInsertJobOperatorAsync failure
5 participants