alamashir commented on code in PR #64938:
URL: https://github.com/apache/airflow/pull/64938#discussion_r3127963404


##########
providers/google/src/airflow/providers/google/cloud/operators/bigquery.py:
##########
@@ -93,22 +83,23 @@ class IfExistAction(enum.Enum):
     SKIP = "skip"
 
 
-class _BigQueryHookWithFlexibleProjectId(BigQueryHook):
-    @property
-    def project_id(self) -> str:
-        _, project_id = self.get_credentials_and_project_id()
-        return project_id or PROVIDE_PROJECT_ID
+class _BigQueryDbHookMixin:
+    def get_db_hook(self: BigQueryCheckOperator) -> BigQueryHook:  # 
type:ignore[misc]
+        """Get BigQuery DB Hook."""
+        from airflow.providers.google.cloud.hooks.bigquery import BigQueryHook
 
-    @project_id.setter
-    def project_id(self, value: str) -> None:
-        cached_creds, _ = self.get_credentials_and_project_id()
-        self._cached_project_id = value or PROVIDE_PROJECT_ID
-        self._cached_credntials = cached_creds
+        class _BigQueryHookWithFlexibleProjectId(BigQueryHook):
+            @property
+            def project_id(self) -> str:
+                _, project_id = self.get_credentials_and_project_id()
+                return project_id or PROVIDE_PROJECT_ID
 
+            @project_id.setter
+            def project_id(self, value: str) -> None:
+                cached_creds, _ = self.get_credentials_and_project_id()
+                self._cached_project_id = value or PROVIDE_PROJECT_ID
+                self._cached_credntials = cached_creds

Review Comment:
   This typo (`_cached_credntials`) exists in the original code on `main` — we 
only moved this class definition inside the `get_db_hook()` method without 
modifying it. Fixing the typo here would be an unrelated change and could 
potentially affect behavior, so it's better addressed in a separate PR.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to