You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2020/01/10 16:16:02 UTC

[GitHub] [airflow] nuclearpinguin commented on a change in pull request #7131: [AIRFLOW-6534] - BigQuery - move methods from BigQueryBaseCursor to BigQueryHook

nuclearpinguin commented on a change in pull request #7131: [AIRFLOW-6534] - BigQuery - move methods from BigQueryBaseCursor to BigQueryHook
URL: https://github.com/apache/airflow/pull/7131#discussion_r365312838
 
 

 ##########
 File path: airflow/gcp/hooks/bigquery.py
 ##########
 @@ -154,85 +160,8 @@ def table_exists(self, project_id: str, dataset_id: str, table_id: str) -> bool:
                 return False
             raise
 
-
-class BigQueryPandasConnector(GbqConnector):
-    """
-    This connector behaves identically to GbqConnector (from Pandas), except
-    that it allows the service to be injected, and disables a call to
-    self.get_credentials(). This allows Airflow to use BigQuery with Pandas
-    without forcing a three legged OAuth connection. Instead, we can inject
-    service account credentials into the binding.
-    """
-
-    def __init__(
-        self, project_id: str, service: str, reauth: bool = False, verbose: bool = False, dialect="legacy"
-    ) -> None:
-        super().__init__(project_id)
-        gbq_check_google_client_version()
-        gbq_test_google_api_imports()
-        self.project_id = project_id
-        self.reauth = reauth
-        self.service = service
-        self.verbose = verbose
-        self.dialect = dialect
-
-
-class BigQueryConnection:
-    """
-    BigQuery does not have a notion of a persistent connection. Thus, these
-    objects are small stateless factories for cursors, which do all the real
-    work.
-    """
-
-    def __init__(self, *args, **kwargs) -> None:
-        self._args = args
-        self._kwargs = kwargs
-
-    def close(self) -> None:
-        """ BigQueryConnection does not have anything to close. """
-
-    def commit(self) -> None:
-        """ BigQueryConnection does not support transactions. """
-
-    def cursor(self) -> "BigQueryCursor":
-        """ Return a new :py:class:`Cursor` object using the connection. """
-        return BigQueryCursor(*self._args, **self._kwargs)
-
-    def rollback(self) -> NoReturn:
-        """ BigQueryConnection does not have transactions """
-        raise NotImplementedError(
-            "BigQueryConnection does not have transactions")
-
-
-class BigQueryBaseCursor(LoggingMixin):
 
 Review comment:
   Shouldn't we leave those classes to preserve backward compatibility?

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services