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

    https://github.com/apache/spark/pull/12784#discussion_r61645360
  
    --- Diff: python/pyspark/sql/conf.py ---
    @@ -33,62 +33,24 @@ def __init__(self, jconf):
         @ignore_unicode_prefix
         @since(2.0)
         def set(self, key, value):
    -        """Sets the given Spark runtime configuration property.
    -
    -        >>> spark.conf.set("garble", "marble")
    -        >>> spark.getConf("garble")
    -        u'marble'
    -        """
    +        """Sets the given Spark runtime configuration property."""
             self._jconf.set(key, value)
     
         @ignore_unicode_prefix
         @since(2.0)
    -    def get(self, key):
    +    def get(self, key, default=None):
             """Returns the value of Spark runtime configuration property for 
the given key,
             assuming it is set.
    -
    -        >>> spark.setConf("bogo", "sipeo")
    -        >>> spark.conf.get("bogo")
    -        u'sipeo'
    -        >>> spark.conf.get("definitely.not.set") # doctest: 
+IGNORE_EXCEPTION_DETAIL
    -        Traceback (most recent call last):
    -            ...
    -        Py4JJavaError: ...
             """
    -        return self._jconf.get(key)
    -
    -    @ignore_unicode_prefix
    -    @since(2.0)
    -    def getOption(self, key):
    -        """Returns the value of Spark runtime configuration property for 
the given key,
    -        or None if it is not set.
    -
    -        >>> spark.setConf("bogo", "sipeo")
    -        >>> spark.conf.getOption("bogo")
    -        u'sipeo'
    -        >>> spark.conf.getOption("definitely.not.set") is None
    -        True
    -        """
    -        iter = self._jconf.getOption(key).iterator()
    -        if iter.hasNext():
    -            return iter.next()
    +        if default is None:
    +            return self._jconf.get(key)
             else:
    -            return None
    +            return self._jconf.get(key, default)
    --- End diff --
    
    Could you check the type for key and default, or you will get an weird py4j 
error?


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