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

Override GoogleBaseHook with BigqueryHook #1442

Merged
merged 3 commits into from
Dec 20, 2022

Conversation

utkarsharma2
Copy link
Collaborator

Description

What is the current behavior?

Because of below issue:

airflow.exceptions.AirflowException: You are trying to use `common-sql` with GoogleBaseHook, but its provider does not support it. Please upgrade the provider to a version that supports `common-sql`. The hook class should be a subclass of `airflow.providers.common.sql.hooks.sql.DbApiHook`. Got GoogleBaseHook Hook with class hierarchy: [<class 'airflow.providers.google.common.hooks.base_google.GoogleBaseHook'>, <class 'airflow.hooks.base.BaseHook'>, <class 'airflow.utils.log.logging_mixin.LoggingMixin'>, <class 'object'>]

We are using a work around and using Bigquey Hook

@utkarsharma2 utkarsharma2 marked this pull request as ready for review December 20, 2022 02:53
@utkarsharma2 utkarsharma2 merged commit c8ee4b4 into DataValidation Dec 20, 2022
@utkarsharma2 utkarsharma2 deleted the DataValidationBigquery branch December 20, 2022 02:53
utkarsharma2 added a commit that referenced this pull request Dec 20, 2022
# Description
## What is the current behavior?
Because of below issue:
```
airflow.exceptions.AirflowException: You are trying to use `common-sql` with GoogleBaseHook, but its provider does not support it. Please upgrade the provider to a version that supports `common-sql`. The hook class should be a subclass of `airflow.providers.common.sql.hooks.sql.DbApiHook`. Got GoogleBaseHook Hook with class hierarchy: [<class 'airflow.providers.google.common.hooks.base_google.GoogleBaseHook'>, <class 'airflow.hooks.base.BaseHook'>, <class 'airflow.utils.log.logging_mixin.LoggingMixin'>, <class 'object'>]
```
We are using a work around and using Bigquey Hook
Copy link
Member

@feluelle feluelle left a comment

Choose a reason for hiding this comment

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

Why did you merge without an approval?

def execute(self, context: "Context"):
if isinstance(self.dataset, BaseTable):
# Work around for GoogleBaseHook not inheriting from DBApi
Copy link
Member

Choose a reason for hiding this comment

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

@utkarsharma2 you forgot to remove the comment here.

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.

2 participants