You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spark.apache.org by gu...@apache.org on 2023/02/02 09:05:43 UTC
[spark] branch master updated: [SPARK-42281][PYTHON][DOCS] Update Debugging PySpark documents to show error message properly
This is an automated email from the ASF dual-hosted git repository.
gurwls223 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/spark.git
The following commit(s) were added to refs/heads/master by this push:
new 8c68fc77566 [SPARK-42281][PYTHON][DOCS] Update Debugging PySpark documents to show error message properly
8c68fc77566 is described below
commit 8c68fc77566e641dcb196de5bdec91215b00e44a
Author: itholic <ha...@databricks.com>
AuthorDate: Thu Feb 2 18:05:29 2023 +0900
[SPARK-42281][PYTHON][DOCS] Update Debugging PySpark documents to show error message properly
### What changes were proposed in this pull request?
This PR proposes to update examples in [Debugging PySpark](https://spark.apache.org/docs/latest/api/python/development/debugging.html#debugging-pyspark).
### Why are the changes needed?
Because the examples described in [Debugging PySpark](https://spark.apache.org/docs/latest/api/python/development/debugging.html#debugging-pyspark) don't match with current PySpark error framework.
### Does this PR introduce _any_ user-facing change?
Document update
### How was this patch tested?
manually test by building the document in local.
Closes #39852 from itholic/fix_develop_doc.
Authored-by: itholic <ha...@databricks.com>
Signed-off-by: Hyukjin Kwon <gu...@apache.org>
---
python/docs/source/development/debugging.rst | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/python/docs/source/development/debugging.rst b/python/docs/source/development/debugging.rst
index ba656294ef4..a188d3f3e78 100644
--- a/python/docs/source/development/debugging.rst
+++ b/python/docs/source/development/debugging.rst
@@ -411,7 +411,7 @@ Example:
>>> df['bad_key']
Traceback (most recent call last):
...
- pyspark.sql.utils.AnalysisException: Cannot resolve column name "bad_key" among (id)
+ pyspark.errors.exceptions.AnalysisException: Cannot resolve column name "bad_key" among (id)
Solution:
@@ -431,8 +431,9 @@ Example:
>>> spark.sql("select * 1")
Traceback (most recent call last):
...
- pyspark.sql.utils.ParseException:
- Syntax error at or near '1': extra input '1'(line 1, pos 9)
+ pyspark.errors.exceptions.ParseException:
+ [PARSE_SYNTAX_ERROR] Syntax error at or near '1': extra input '1'.(line 1, pos 9)
+
== SQL ==
select * 1
---------^^^
@@ -455,7 +456,7 @@ Example:
>>> spark.range(1).sample(-1.0)
Traceback (most recent call last):
...
- pyspark.sql.utils.IllegalArgumentException: requirement failed: Sampling fraction (-1.0) must be on interval [0, 1] without replacement
+ pyspark.errors.exceptions.IllegalArgumentException: requirement failed: Sampling fraction (-1.0) must be on interval [0, 1] without replacement
Solution:
@@ -474,6 +475,7 @@ Example:
.. code-block:: python
+ >>> import pyspark.sql.functions as F
>>> from pyspark.sql.functions import udf
>>> def f(x):
... return F.abs(x)
@@ -512,7 +514,7 @@ Example:
File "<stdin>", line 1, in <lambda>
ZeroDivisionError: division by zero
...
- pyspark.sql.utils.StreamingQueryException: Query q1 [id = ced5797c-74e2-4079-825b-f3316b327c7d, runId = 65bacaf3-9d51-476a-80ce-0ac388d4906a] terminated with exception: Writing job aborted
+ pyspark.errors.exceptions.StreamingQueryException: [STREAM_FAILED] Query [id = 74eb53a8-89bd-49b0-9313-14d29eed03aa, runId = 9f2d5cf6-a373-478d-b718-2c2b6d8a0f24] terminated with exception: Job aborted
Solution:
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@spark.apache.org
For additional commands, e-mail: commits-help@spark.apache.org