mik-laj commented on a change in pull request #4842: [AIRFLOW-4014] Change 
DatastoreHook and add tests
URL: https://github.com/apache/airflow/pull/4842#discussion_r262879150
 
 

 ##########
 File path: airflow/contrib/hooks/datastore_hook.py
 ##########
 @@ -19,58 +19,81 @@
 #
 
 import time
+
 from googleapiclient.discovery import build
+
 from airflow.contrib.hooks.gcp_api_base_hook import GoogleCloudBaseHook
 
 
 class DatastoreHook(GoogleCloudBaseHook):
     """
-    Interact with Google Cloud Datastore. This hook uses the Google Cloud 
Platform
-    connection.
+    Interact with Google Cloud Datastore. This hook uses the Google Cloud 
Platform connection.
 
     This object is not threads safe. If you want to make multiple requests
     simultaneously, you will need to create a hook per thread.
     """
 
-    def __init__(self,
-                 datastore_conn_id='google_cloud_datastore_default',
-                 delegate_to=None):
+    def __init__(self, datastore_conn_id='google_cloud_datastore_default', 
delegate_to=None):
         super(DatastoreHook, self).__init__(datastore_conn_id, delegate_to)
-        self.connection = self.get_conn()
-        self.admin_connection = self.get_conn('v1beta1')
+        self.connection = None
+        self.admin_connection = None
 
-    def get_conn(self, version='v1'):
+    def get_conn(self, version='v1', is_admin=False):
 
 Review comment:
   I think that this method should not have parameters. This will be consistent 
with other operators for GCP. Additional parameters can be passed by 
constructor.

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to