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 2021/01/08 15:34:01 UTC

[GitHub] [airflow] TobKed commented on a change in pull request #13256: Refactor DataprocOperators to support google-cloud-dataproc 2.0

TobKed commented on a change in pull request #13256:
URL: https://github.com/apache/airflow/pull/13256#discussion_r554013925



##########
File path: airflow/providers/google/cloud/operators/dataproc.py
##########
@@ -613,18 +609,18 @@ def execute(self, context) -> dict:
 
         # Check if cluster is not in ERROR state
         self._handle_error_state(hook, cluster)
-        if cluster.status.state == cluster.status.CREATING:
+        if cluster.status.state == cluster.status.State.CREATING:
             # Wait for cluster to be be created
             cluster = self._wait_for_cluster_in_creating_state(hook)
             self._handle_error_state(hook, cluster)
-        elif cluster.status.state == cluster.status.DELETING:
+        elif cluster.status.state == cluster.status.State.DELETING:
             # Wait for cluster to be deleted
             self._wait_for_cluster_in_deleting_state(hook)
             # Create new cluster
             cluster = self._create_cluster(hook)
             self._handle_error_state(hook, cluster)
 
-        return MessageToDict(cluster)
+        return Cluster.to_json(cluster)

Review comment:
       Why `to_json` and not `to_dict` method?




----------------------------------------------------------------
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