Commit 88cc153
[SPARK-48650][PYTHON] Display correct call site from IPython Notebook
### What changes were proposed in this pull request?
This PR proposes to display correct call site information from IPython Notebook.
### Why are the changes needed?
We added `DataFrameQueryContext` for PySpark error message from #45377, but it does not working very well from IPython Notebook.
### Does this PR introduce _any_ user-facing change?
No API changes, but the user-facing error message from IPython Notebook will be improved:
**Before**
<img width="1124" alt="Screenshot 2024-06-18 at 5 15 56 PM" src="https://github.com/apache/spark/assets/44108233/3e3aee2c-5bb0-4858-b392-e845b7280d31">
**After**
<img width="1163" alt="Screenshot 2024-06-19 at 8 45 05 AM" src="https://github.com/apache/spark/assets/44108233/81741d15-cac9-41e7-815a-5d84f1176c73">
**NOTE:** This also works when command is executed across multiple cells:
<img width="1175" alt="Screenshot 2024-06-19 at 8 42 29 AM" src="https://github.com/apache/spark/assets/44108233/d65fbf79-d621-4ae0-b220-2f7923cc3666">
### How was this patch tested?
Manually tested with IPython Notebook.
### Was this patch authored or co-authored using generative AI tooling?
No
Closes #47009 from itholic/error_context_on_notebook.
Authored-by: Haejoon Lee <[email protected]>
Signed-off-by: Hyukjin Kwon <[email protected]>1 parent e972dae commit 88cc153
1 file changed
+23
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| 24 | + | |
24 | 25 | | |
25 | 26 | | |
26 | 27 | | |
| |||
164 | 165 | | |
165 | 166 | | |
166 | 167 | | |
167 | | - | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
168 | 174 | | |
169 | | - | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
170 | 191 | | |
171 | 192 | | |
172 | 193 | | |
| |||
0 commit comments