| 2663 | } |
| 2664 | |
| 2665 | Status ConvertTableToPandas(const PandasOptions& options, std::shared_ptr<Table> table, |
| 2666 | PyObject** out) { |
| 2667 | ChunkedArrayVector arrays = table->columns(); |
| 2668 | FieldVector fields = table->fields(); |
| 2669 | |
| 2670 | // ARROW-3789: allow "self-destructing" by releasing references to columns as |
| 2671 | // we convert them to pandas |
| 2672 | table = nullptr; |
| 2673 | |
| 2674 | RETURN_NOT_OK(ConvertCategoricals(options, &arrays, &fields)); |
| 2675 | |
| 2676 | PandasOptions modified_options = options; |
| 2677 | modified_options.strings_to_categorical = false; |
| 2678 | modified_options.categorical_columns.reset(); |
| 2679 | |
| 2680 | if (options.split_blocks) { |
| 2681 | modified_options.allow_zero_copy_blocks = true; |
| 2682 | SplitBlockCreator helper(modified_options, std::move(fields), std::move(arrays)); |
| 2683 | return helper.Convert(out); |
| 2684 | } else { |
| 2685 | ConsolidatedBlockCreator helper(modified_options, std::move(fields), |
| 2686 | std::move(arrays)); |
| 2687 | return helper.Convert(out); |
| 2688 | } |
| 2689 | } |
| 2690 | |
| 2691 | } // namespace py |
| 2692 | } // namespace arrow |