cloud-fan commented on code in PR #56154:
URL: https://github.com/apache/spark/pull/56154#discussion_r3353409779


##########
python/pyspark/sql/conf.py:
##########
@@ -72,19 +76,43 @@ def get(
         key : str
             key of the configuration to get.
         default : str, optional
-            value of the configuration to get if the key does not exist.
+            value to return if the key is not explicitly set. When provided, 
this overrides
+            the key's built-in default value.
 
         Returns
         -------
-        The string value of the configuration set, or None.
+        str or None
+            The value of the configuration property.
+
+        Raises
+        ------
+        pyspark.errors.SparkNoSuchElementException
+            If the key is not explicitly set, has no built-in default value, 
and ``default``
+            is not provided.
 
         Examples
         --------
+        A key with no built-in default raises an exception when not explicitly 
set:

Review Comment:
   This header contradicts the example beneath it: 
`spark.conf.get("non-existent-key", "my_default")` supplies a `default` and 
returns `'my_default'`, so nothing is raised — the example shows the 
default-provided case, not the exception case. Since the whole point of this PR 
is to remove misleading doc prose, worth rewording so it doesn't introduce a 
fresh one:
   
   ```suggestion
           A key with no built-in default returns the provided ``default`` when 
not explicitly set:
   ```



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to