Commit eeed191
committed
[SPARK-46808][PYTHON] Refine error classes in Python with automatic sorting function
### What changes were proposed in this pull request?
This PR proposes:
- Add the automated way of writing `error_classes.py` file, `from pyspark.errors.exceptions import _write_self; _write_self()`
- Fix the formatting of the JSON file to be consistent
- Fix typos within the error messages
- Fix parameter names to be consistent (it fixes some, not all)
### Why are the changes needed?
- Now, it is difficult to add a new error class because it enforces alphabetical order or error classes, etc. When you add multiple error classes, you should manually fix and move them around which is troublesome.
- In addition, the current JSON format isn't very consistent.
- For consistency. This PR includes the changes of *some* of parameter naming.
### Does this PR introduce _any_ user-facing change?
Yes, it fixes a couple of typos.
### How was this patch tested?
Unittests were fixed together.
### Was this patch authored or co-authored using generative AI tooling?
No.
Closes #44848 from HyukjinKwon/SPARK-46808.
Authored-by: Hyukjin Kwon <[email protected]>
Signed-off-by: Hyukjin Kwon <[email protected]>1 parent e7fb0ad commit eeed191
File tree
11 files changed
+429
-382
lines changed- python/pyspark
- errors
- exceptions
- sql
- connect
- tests
- connect
11 files changed
+429
-382
lines changedLarge diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1663 | 1663 | | |
1664 | 1664 | | |
1665 | 1665 | | |
1666 | | - | |
| 1666 | + | |
1667 | 1667 | | |
1668 | 1668 | | |
1669 | 1669 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
353 | 353 | | |
354 | 354 | | |
355 | 355 | | |
356 | | - | |
| 356 | + | |
357 | 357 | | |
358 | 358 | | |
359 | 359 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1319 | 1319 | | |
1320 | 1320 | | |
1321 | 1321 | | |
| 1322 | + | |
1322 | 1323 | | |
1323 | 1324 | | |
1324 | 1325 | | |
| |||
1329 | 1330 | | |
1330 | 1331 | | |
1331 | 1332 | | |
| 1333 | + | |
1332 | 1334 | | |
1333 | 1335 | | |
1334 | 1336 | | |
| |||
2385 | 2387 | | |
2386 | 2388 | | |
2387 | 2389 | | |
2388 | | - | |
| 2390 | + | |
2389 | 2391 | | |
2390 | 2392 | | |
2391 | 2393 | | |
| |||
5839 | 5841 | | |
5840 | 5842 | | |
5841 | 5843 | | |
5842 | | - | |
| 5844 | + | |
5843 | 5845 | | |
5844 | 5846 | | |
5845 | 5847 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1421 | 1421 | | |
1422 | 1422 | | |
1423 | 1423 | | |
1424 | | - | |
| 1424 | + | |
1425 | 1425 | | |
1426 | 1426 | | |
1427 | 1427 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2282 | 2282 | | |
2283 | 2283 | | |
2284 | 2284 | | |
2285 | | - | |
| 2285 | + | |
2286 | 2286 | | |
2287 | 2287 | | |
2288 | 2288 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1111 | 1111 | | |
1112 | 1112 | | |
1113 | 1113 | | |
1114 | | - | |
| 1114 | + | |
1115 | 1115 | | |
1116 | 1116 | | |
1117 | 1117 | | |
| |||
2044 | 2044 | | |
2045 | 2045 | | |
2046 | 2046 | | |
2047 | | - | |
| 2047 | + | |
2048 | 2048 | | |
2049 | 2049 | | |
2050 | 2050 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
190 | 190 | | |
191 | 191 | | |
192 | 192 | | |
193 | | - | |
| 193 | + | |
194 | 194 | | |
195 | 195 | | |
196 | 196 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2236 | 2236 | | |
2237 | 2237 | | |
2238 | 2238 | | |
2239 | | - | |
| 2239 | + | |
2240 | 2240 | | |
2241 | 2241 | | |
2242 | 2242 | | |
| |||
0 commit comments