Commit cd1811b
authored
### Rationale for this change
pq.read_schema drops extension types (UUID comes back as fixed_size_binary[16]), while ParquetFile.schema_arrow and read_table preserve them. Schema inspection via metadata should match table/extension behavior.
### What changes are included in this PR?
- Plumb arrow_extensions_enabled into read_schema and return schema_arrow when enabled so extension types are preserved.
- Add regression test ensuring UUID extension types are retained by read_schema and downgraded to binary(16) when extensions are disabled.
### Are these changes tested?
- Yes: added unit test test_read_schema_uuid_extension_type
### Are there any user-facing changes?
- Behavior improvement: read_schema now preserves extension types (e.g., UUID) when extensions are enabled; no API break
Notes:
- I don't know if the fact the column types being returned are now extension<arrow.uuid> instead of fixed_size_binary[16], is considered a breaking change.
- This PR patch was AI generated, but I personally reviewed it, the scope is small, and it looks fine to me.
* GitHub Issue: #48254
Authored-by: Nicolas Vandeginste <n.vandeginste@abc-arbitrage.com>
Signed-off-by: Raúl Cumplido <raulcumplido@gmail.com>
1 parent 4ea1ad2 commit cd1811b
2 files changed
Lines changed: 46 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
265 | 265 | | |
266 | 266 | | |
267 | 267 | | |
268 | | - | |
269 | | - | |
270 | | - | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
271 | 271 | | |
272 | 272 | | |
273 | 273 | | |
| |||
2372 | 2372 | | |
2373 | 2373 | | |
2374 | 2374 | | |
2375 | | - | |
| 2375 | + | |
2376 | 2376 | | |
2377 | 2377 | | |
2378 | 2378 | | |
| |||
2387 | 2387 | | |
2388 | 2388 | | |
2389 | 2389 | | |
| 2390 | + | |
| 2391 | + | |
| 2392 | + | |
| 2393 | + | |
2390 | 2394 | | |
2391 | 2395 | | |
2392 | 2396 | | |
| |||
2416 | 2420 | | |
2417 | 2421 | | |
2418 | 2422 | | |
2419 | | - | |
2420 | | - | |
| 2423 | + | |
| 2424 | + | |
| 2425 | + | |
| 2426 | + | |
| 2427 | + | |
| 2428 | + | |
2421 | 2429 | | |
2422 | 2430 | | |
2423 | 2431 | | |
2424 | 2432 | | |
2425 | | - | |
| 2433 | + | |
2426 | 2434 | | |
2427 | 2435 | | |
2428 | 2436 | | |
| |||
2437 | 2445 | | |
2438 | 2446 | | |
2439 | 2447 | | |
| 2448 | + | |
| 2449 | + | |
| 2450 | + | |
2440 | 2451 | | |
2441 | 2452 | | |
2442 | 2453 | | |
| |||
2462 | 2473 | | |
2463 | 2474 | | |
2464 | 2475 | | |
2465 | | - | |
2466 | | - | |
2467 | | - | |
| 2476 | + | |
| 2477 | + | |
| 2478 | + | |
| 2479 | + | |
| 2480 | + | |
| 2481 | + | |
2468 | 2482 | | |
2469 | 2483 | | |
2470 | 2484 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
849 | 849 | | |
850 | 850 | | |
851 | 851 | | |
| 852 | + | |
| 853 | + | |
| 854 | + | |
| 855 | + | |
| 856 | + | |
| 857 | + | |
| 858 | + | |
| 859 | + | |
| 860 | + | |
| 861 | + | |
| 862 | + | |
| 863 | + | |
| 864 | + | |
| 865 | + | |
| 866 | + | |
| 867 | + | |
| 868 | + | |
| 869 | + | |
| 870 | + | |
| 871 | + | |
| 872 | + | |
| 873 | + | |
0 commit comments