You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2021/02/16 05:52:11 UTC

[GitHub] [spark] scravy commented on a change in pull request #31565: [SPARK-34438] Check path component in isPython/isR, not full URI

scravy commented on a change in pull request #31565:
URL: https://github.com/apache/spark/pull/31565#discussion_r576564357



##########
File path: core/src/main/scala/org/apache/spark/deploy/SparkSubmit.scala
##########
@@ -1072,14 +1072,29 @@ object SparkSubmit extends CommandLineUtils with Logging {
    * Return whether the given primary resource requires running python.
    */
   private[deploy] def isPython(res: String): Boolean = {
-    res != null && res.endsWith(".py") || res == PYSPARK_SHELL
+    if (res == null) {
+      return false
+    }
+    if (res == PYSPARK_SHELL) {
+      return true
+    }
+    val uri = new java.net.URI(res)

Review comment:
       @HyukjinKwon Would this be a good place to add a test case? -> https://github.com/apache/spark/blob/master/core/src/test/scala/org/apache/spark/deploy/PythonRunnerSuite.scala
   
   Good point about the local paths... I'll take care of that.




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



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org