Skip to content

Conversation

@rawwar
Copy link
Contributor

@rawwar rawwar commented Feb 13, 2024

This PR fixes the following mypy check failure for the google provider.

airflow/providers/google/cloud/hooks/bigquery.py:228: error: Signature of
"insert_rows" incompatible with supertype "DbApiHook"  [override]
        def insert_rows(
        ^
airflow/providers/google/cloud/hooks/bigquery.py:228: note:      Superclass:
airflow/providers/google/cloud/hooks/bigquery.py:228: note:          def insert_rows(self, table: Any, rows: Any, target_fields: Any = ..., commit_every: Any = ..., replace: Any = ..., executemany: Any = ..., **kwargs: Any) -> Any
airflow/providers/google/cloud/hooks/bigquery.py:228: note:      Subclass:
airflow/providers/google/cloud/hooks/bigquery.py:228: note:          def insert_rows(self, table: Any, rows: Any, target_fields: Any = ..., commit_every: Any = ..., replace: Any = ..., **kwargs: Any) -> None

in DbApiHook--> insert_rows method was recently updated to include executemany parameter. But, Google provider --> BigQueryHook inherits the DbApiHook. Is it necessary that insert_rows (link to the def) defined in an inherited class to have same signature? I've been seeing the following error locally and am wondering if BigQueryHook also needs to include the newly added executemany parameter

Related slack chat: https://apache-airflow.slack.com/archives/CCPRP7943/p1707836093751379

Signed-off-by: kalyanr <kalyan.ben10@live.com>
@boring-cyborg boring-cyborg bot added area:providers provider:google Google (including GCP) related issues labels Feb 13, 2024
@potiuk potiuk merged commit 270282f into apache:main Feb 13, 2024
@rawwar rawwar deleted the kalyan/lint-fix-google-provider-bigquery-hook branch February 14, 2024 00:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:providers provider:google Google (including GCP) related issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants