HuangXingBo commented on a change in pull request #14621:
URL: https://github.com/apache/flink/pull/14621#discussion_r558174486



##########
File path: 
flink-python/src/main/java/org/apache/flink/python/util/PythonConfigUtil.java
##########
@@ -215,6 +228,19 @@ private static boolean 
isPythonOperator(StreamOperatorFactory streamOperatorFact
         }
     }
 
+    private static boolean isPythonOperator(Transformation<?> transform) {
+        if (transform instanceof OneInputTransformation) {
+            return isPythonOperator(((OneInputTransformation) 
transform).getOperatorFactory());
+        } else if (transform instanceof TwoInputTransformation) {
+            return isPythonOperator(((TwoInputTransformation) 
transform).getOperatorFactory());
+        } else if (transform instanceof AbstractMultipleInputTransformation) {
+            return isPythonOperator(
+                    ((AbstractMultipleInputTransformation) 
transform).getOperatorFactory());
+        } else {
+            return false;

Review comment:
       The transformation maybe other type of `Transformation` such as 
`SourceTransformation`. So we can't throw an exception here.




----------------------------------------------------------------
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:
us...@infra.apache.org


Reply via email to