Fix options for conversion of an inner (child) array.
| 72 | |
| 73 | // Fix options for conversion of an inner (child) array. |
| 74 | PandasOptions 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 |
no test coverage detected