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

Function MakeInnerOptions

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

Fix options for conversion of an inner (child) array.

Source from the content-addressed store, hash-verified

72
73// Fix options for conversion of an inner (child) array.
74PandasOptions MakeInnerOptions(PandasOptions options) {
75 // Make sure conversion of inner dictionary arrays always returns an array,
76 // not a dict {'indices': array, 'dictionary': array, 'ordered': bool}
77 options.decode_dictionaries = true;
78 options.categorical_columns.reset();
79 options.strings_to_categorical = false;
80
81 // In ARROW-7723, we found as a result of ARROW-3789 that second
82 // through microsecond resolution tz-aware timestamps were being promoted to
83 // use the DATETIME_NANO_TZ conversion path, yielding a datetime64[ns] NumPy
84 // array in this function. PyArray_GETITEM returns datetime.datetime for
85 // units second through microsecond but PyLong for nanosecond (because
86 // datetime.datetime does not support nanoseconds).
87 // We force the object conversion to preserve the value of the timezone.
88 // Nanoseconds are returned as integers.
89 options.coerce_temporal_nanoseconds = false;
90
91 return options;
92}
93
94// ----------------------------------------------------------------------
95// PyCapsule code for setting ndarray base to reference C++ object

Callers 3

ConvertStructFunction · 0.85
ConvertListsLikeFunction · 0.85
ConvertMapFunction · 0.85

Calls 1

resetMethod · 0.45

Tested by

no test coverage detected