kaxil commented on a change in pull request #4353: [AIRFLOW-3480] Add Database 
Deploy/Update/Delete operators
URL: https://github.com/apache/incubator-airflow/pull/4353#discussion_r244882051
 
 

 ##########
 File path: airflow/contrib/operators/gcp_spanner_operator.py
 ##########
 @@ -197,3 +200,201 @@ def execute(self, context):
     def sanitize_queries(queries):
         if len(queries) and queries[-1] == '':
             del queries[-1]
+
+
+class CloudSpannerInstanceDatabaseDeployOperator(BaseOperator):
+    """
+    Creates a new Cloud Spanner database, or if database exists,
+    the operator does nothing.
+
+
+    :param project_id: The ID of the project that owns the Cloud Spanner 
Database.
+    :type project_id: str
+    :param instance_id: The Cloud Spanner instance ID.
+    :type instance_id: str
+    :param database_id: The Cloud Spanner database ID.
+    :type database_id: str
+    :param ddl_statements: The string list containing DDL for the new database.
+    :type ddl_statements: [str]
+    :param gcp_conn_id: The connection ID used to connect to Google Cloud 
Platform.
+    :type gcp_conn_id: str
+    """
+    # [START gcp_spanner_database_deploy_template_fields]
+    template_fields = ('project_id', 'instance_id', 'database_id', 
'ddl_statements',
+                       'gcp_conn_id')
+    template_ext = ('.sql', )
+    # [END gcp_spanner_database_deploy_template_fields]
+
+    @apply_defaults
+    def __init__(self,
+                 project_id,
+                 instance_id,
+                 database_id,
+                 ddl_statements,
+                 gcp_conn_id='google_cloud_default',
+                 *args, **kwargs):
+        # type: (str, str, str, [str], str, object, object) -> None
 
 Review comment:
   This is not needed if you have docstrings

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to