You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dolphinscheduler.apache.org by GitBox <gi...@apache.org> on 2022/08/07 11:19:05 UTC

[GitHub] [dolphinscheduler] zhongjiajie commented on a diff in pull request #11330: [Feature][Python] Combine gateway.entry_point call in python api side

zhongjiajie commented on code in PR #11330:
URL: https://github.com/apache/dolphinscheduler/pull/11330#discussion_r939650233


##########
dolphinscheduler-python/pydolphinscheduler/src/pydolphinscheduler/java_gateway.py:
##########
@@ -63,3 +63,130 @@ def gateway_result_checker(
     ):
         raise PyDSJavaGatewayException("Get result state not success.")
     return result
+
+
+java_gateway = launch_gateway()

Review Comment:
   Function `launch_gateway` supported custom parameters in L30 -L34, should we consider about this?



##########
dolphinscheduler-python/pydolphinscheduler/src/pydolphinscheduler/java_gateway.py:
##########
@@ -63,3 +63,130 @@ def gateway_result_checker(
     ):
         raise PyDSJavaGatewayException("Get result state not success.")
     return result
+
+
+java_gateway = launch_gateway()
+
+
+def get_datasource_info(name):

Review Comment:
   We should better add some type hint for parameter.
   ```suggestion
   def get_datasource_info(name: str):
   ```



##########
dolphinscheduler-python/pydolphinscheduler/src/pydolphinscheduler/models/queue.py:
##########
@@ -33,10 +32,3 @@ def __init__(
         description: Optional[str] = "",
     ):
         super().__init__(name, description)
-
-    def create_if_not_exists(self, user=configuration.USER_NAME) -> None:
-        """Create Queue if not exists."""
-        gateway = launch_gateway()
-        # Here we set Queue.name and Queue.queueName same as self.name
-        result = gateway.entry_point.createProject(user, self.name, self.name)
-        gateway_result_checker(result, None)

Review Comment:
   Do you forget adding some method for this?



-- 
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: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org