| 955 | } |
| 956 | |
| 957 | Status CheckForDuplicateKeys(bool error_on_duplicate_keys, Py_ssize_t total_dict_len, |
| 958 | Py_ssize_t total_raw_len) { |
| 959 | if (total_dict_len < total_raw_len) { |
| 960 | const char* message = |
| 961 | "[maps_as_pydicts] " |
| 962 | "After conversion of Arrow maps to pydicts, " |
| 963 | "detected data loss due to duplicate keys. " |
| 964 | "Original input length is [%lld], total converted pydict length is [%lld]."; |
| 965 | std::array<char, 256> buf; |
| 966 | std::snprintf(buf.data(), buf.size(), message, total_raw_len, total_dict_len); |
| 967 | |
| 968 | if (error_on_duplicate_keys) { |
| 969 | return Status::UnknownError(buf.data()); |
| 970 | } else { |
| 971 | ARROW_LOG(WARNING) << buf.data(); |
| 972 | } |
| 973 | } |
| 974 | return Status::OK(); |
| 975 | } |
| 976 | |
| 977 | Status ConvertMap(PandasOptions options, const ChunkedArray& data, |
| 978 | PyObject** out_values) { |
no test coverage detected