| 2630 | } |
| 2631 | |
| 2632 | Status ConvertTableToPandas(const PandasOptions& options, std::shared_ptr<Table> table, |
| 2633 | PyObject** out) { |
| 2634 | ChunkedArrayVector arrays = table->columns(); |
| 2635 | FieldVector fields = table->fields(); |
| 2636 | |
| 2637 | // ARROW-3789: allow "self-destructing" by releasing references to columns as |
| 2638 | // we convert them to pandas |
| 2639 | table = nullptr; |
| 2640 | |
| 2641 | RETURN_NOT_OK(ConvertCategoricals(options, &arrays, &fields)); |
| 2642 | |
| 2643 | PandasOptions modified_options = options; |
| 2644 | modified_options.strings_to_categorical = false; |
| 2645 | modified_options.categorical_columns.reset(); |
| 2646 | |
| 2647 | if (options.split_blocks) { |
| 2648 | modified_options.allow_zero_copy_blocks = true; |
| 2649 | SplitBlockCreator helper(modified_options, std::move(fields), std::move(arrays)); |
| 2650 | return helper.Convert(out); |
| 2651 | } else { |
| 2652 | ConsolidatedBlockCreator helper(modified_options, std::move(fields), |
| 2653 | std::move(arrays)); |
| 2654 | return helper.Convert(out); |
| 2655 | } |
| 2656 | } |
| 2657 | |
| 2658 | } // namespace py |
| 2659 | } // namespace arrow |