| 944 | } |
| 945 | |
| 946 | Status CheckForDuplicateKeys(bool error_on_duplicate_keys, Py_ssize_t total_dict_len, |
| 947 | Py_ssize_t total_raw_len) { |
| 948 | if (total_dict_len < total_raw_len) { |
| 949 | const char* message = |
| 950 | "[maps_as_pydicts] " |
| 951 | "After conversion of Arrow maps to pydicts, " |
| 952 | "detected data loss due to duplicate keys. " |
| 953 | "Original input length is [%lld], total converted pydict length is [%lld]."; |
| 954 | std::array<char, 256> buf; |
| 955 | std::snprintf(buf.data(), buf.size(), message, total_raw_len, total_dict_len); |
| 956 | |
| 957 | if (error_on_duplicate_keys) { |
| 958 | return Status::UnknownError(buf.data()); |
| 959 | } else { |
| 960 | ARROW_LOG(WARNING) << buf.data(); |
| 961 | } |
| 962 | } |
| 963 | return Status::OK(); |
| 964 | } |
| 965 | |
| 966 | Status ConvertMap(PandasOptions options, const ChunkedArray& data, |
| 967 | PyObject** out_values) { |
no test coverage detected