Github user squito commented on a diff in the pull request:

    https://github.com/apache/spark/pull/7739#discussion_r36820815
  
    --- Diff: core/src/main/scala/org/apache/spark/SparkConf.scala ---
    @@ -479,6 +484,23 @@ class SparkConf(loadDefaults: Boolean) extends 
Cloneable with Logging {
         getAll.sorted.map{case (k, v) => k + "=" + v}.mkString("\n")
       }
     
    +  def getDriverExtraClassPath() : Option[String] = {
    +    // Concatenate common and driver classpath in that order
    +    val commonExtraClassPath = getOption("spark.common.extraClassPath")
    +    val driverExtraClassPath = getOption("spark.driver.extraClassPath")
    +    Option((commonExtraClassPath ++ 
driverExtraClassPath).mkString(File.pathSeparator)).filter(_
    --- End diff --
    
    this is super minor, but using `Option` as a wrapper makes the reader think 
that the you are checking for whether or not there is null inside.
    
    ```scala
    scala> Option("foo")
    res20: Option[String] = Some(foo)
    
    scala> Option("")
    res21: Option[String] = Some()
    
    scala> Option(null)
    res22: Option[Null] = None
    ```
    
    but really, you know there won't be any nulls, you are just trying to wrap 
the String in an option.  The more conventional thing to do in that case is to 
wrap with `Some`.  The end result is the same in this case -- both do the same 
thing when the input isn't null -- but the intention is a bit more clear.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to