Commit 419ca89
authored
### Rationale for this change
As described in #36628, we want to raise an exception instead of showing segfaults when users try to instantiate some internal Parquet metadata classes.
### What changes are included in this PR?
This PR is a carry-on of #44245. I modified a few things and covered more test cases. This PR includes these changes:
* Raise an exception when users try to instantiate `Statistics`, `ParquetLogicalType`, `ColumnChunkMetaData`, `RowGroupMetaData`, `FileMetaData`
### Are these changes tested?
Yes, added unit tests
### Are there any user-facing changes?
Yes, after this change, users can't instantiate these classes anymore using the regular `__init__` workflow
* GitHub Issue: #36628
Authored-by: Tim Nguyen <6283718+curioustien@users.noreply.github.com>
Signed-off-by: Antoine Pitrou <antoine@python.org>
1 parent c124bb5 commit 419ca89
File tree
4 files changed
+58
-15
lines changed- python/pyarrow
- tests/parquet
4 files changed
+58
-15
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
164 | 164 | | |
165 | 165 | | |
166 | 166 | | |
167 | | - | |
| 167 | + | |
168 | 168 | | |
169 | 169 | | |
170 | 170 | | |
| |||
390 | 390 | | |
391 | 391 | | |
392 | 392 | | |
393 | | - | |
| 393 | + | |
394 | 394 | | |
395 | 395 | | |
396 | 396 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
631 | 631 | | |
632 | 632 | | |
633 | 633 | | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
634 | 643 | | |
635 | 644 | | |
636 | 645 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
55 | 58 | | |
56 | 59 | | |
57 | 60 | | |
| |||
217 | 220 | | |
218 | 221 | | |
219 | 222 | | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
220 | 227 | | |
221 | 228 | | |
222 | 229 | | |
| |||
253 | 260 | | |
254 | 261 | | |
255 | 262 | | |
256 | | - | |
| 263 | + | |
257 | 264 | | |
258 | 265 | | |
259 | 266 | | |
| |||
315 | 322 | | |
316 | 323 | | |
317 | 324 | | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
318 | 328 | | |
319 | 329 | | |
320 | 330 | | |
| |||
436 | 446 | | |
437 | 447 | | |
438 | 448 | | |
439 | | - | |
| 449 | + | |
440 | 450 | | |
441 | 451 | | |
442 | 452 | | |
| |||
739 | 749 | | |
740 | 750 | | |
741 | 751 | | |
742 | | - | |
743 | | - | |
744 | | - | |
745 | | - | |
746 | | - | |
747 | | - | |
748 | | - | |
| 752 | + | |
| 753 | + | |
| 754 | + | |
| 755 | + | |
| 756 | + | |
749 | 757 | | |
750 | 758 | | |
751 | 759 | | |
| |||
787 | 795 | | |
788 | 796 | | |
789 | 797 | | |
790 | | - | |
| 798 | + | |
791 | 799 | | |
792 | 800 | | |
793 | 801 | | |
| |||
866 | 874 | | |
867 | 875 | | |
868 | 876 | | |
| 877 | + | |
| 878 | + | |
| 879 | + | |
869 | 880 | | |
870 | 881 | | |
871 | 882 | | |
| |||
1027 | 1038 | | |
1028 | 1039 | | |
1029 | 1040 | | |
1030 | | - | |
| 1041 | + | |
| 1042 | + | |
| 1043 | + | |
1031 | 1044 | | |
1032 | 1045 | | |
1033 | 1046 | | |
| |||
1516 | 1529 | | |
1517 | 1530 | | |
1518 | 1531 | | |
1519 | | - | |
| 1532 | + | |
| 1533 | + | |
1520 | 1534 | | |
1521 | 1535 | | |
1522 | 1536 | | |
| |||
2259 | 2273 | | |
2260 | 2274 | | |
2261 | 2275 | | |
2262 | | - | |
| 2276 | + | |
2263 | 2277 | | |
2264 | 2278 | | |
2265 | 2279 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
794 | 794 | | |
795 | 795 | | |
796 | 796 | | |
| 797 | + | |
| 798 | + | |
| 799 | + | |
| 800 | + | |
| 801 | + | |
| 802 | + | |
| 803 | + | |
| 804 | + | |
| 805 | + | |
| 806 | + | |
| 807 | + | |
| 808 | + | |
| 809 | + | |
| 810 | + | |
| 811 | + | |
| 812 | + | |
| 813 | + | |
| 814 | + | |
| 815 | + | |
| 816 | + | |
0 commit comments