MCPcopy Create free account
hub / github.com/apache/arrow / ConvertTableToPandas

Function ConvertTableToPandas

python/pyarrow/src/arrow/python/arrow_to_pandas.cc:2665–2689  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2663}
2664
2665Status 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

Callers 1

Calls 5

ConvertCategoricalsFunction · 0.85
columnsMethod · 0.80
fieldsMethod · 0.45
resetMethod · 0.45
ConvertMethod · 0.45

Tested by 1