Commit 80b4486
[SPARK-54769][PYTHON] Remove dead code in conversion.py
### What changes were proposed in this pull request?
Dead code is removed and replaced with assertions.
### Why are the changes needed?
There are two kinds of dead code in this PR:
1. The else case. We already confirmed that we need a converter for this `dataType`, `else` case should not ever happen, unless we made a mistake in our code.
2. If `ArrayType` has an `elementType` that does not need a converter, the `ArrayType` itself should not need a converter and we should never ask for one.
assertion has clear semantics that this should never happen, but also provides a reasonable and reproducible fallback behavior when unexpected happens. We can catch our code failure faster.
### Does this PR introduce _any_ user-facing change?
No.
### How was this patch tested?
CI
### Was this patch authored or co-authored using generative AI tooling?
No
Closes #53536 from gaogaotiantian/remove-dead-code.
Authored-by: Tian Gao <gaogaotiantian@hotmail.com>
Signed-off-by: Hyukjin Kwon <gurwls223@apache.org>1 parent 2549a58 commit 80b4486
1 file changed
+13
-26
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
436 | 436 | | |
437 | 437 | | |
438 | 438 | | |
439 | | - | |
440 | | - | |
441 | | - | |
442 | | - | |
443 | | - | |
| 439 | + | |
| 440 | + | |
444 | 441 | | |
445 | 442 | | |
446 | 443 | | |
| |||
613 | 610 | | |
614 | 611 | | |
615 | 612 | | |
616 | | - | |
617 | | - | |
618 | | - | |
619 | | - | |
620 | | - | |
621 | | - | |
622 | | - | |
623 | | - | |
624 | | - | |
625 | | - | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
626 | 616 | | |
627 | | - | |
628 | | - | |
629 | | - | |
630 | | - | |
631 | | - | |
632 | | - | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
633 | 623 | | |
634 | 624 | | |
635 | 625 | | |
| |||
793 | 783 | | |
794 | 784 | | |
795 | 785 | | |
796 | | - | |
797 | | - | |
798 | | - | |
799 | | - | |
800 | | - | |
| 786 | + | |
| 787 | + | |
801 | 788 | | |
802 | 789 | | |
803 | 790 | | |
| |||
0 commit comments