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

Function CheckForDuplicateKeys

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

Source from the content-addressed store, hash-verified

955}
956
957Status 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
977Status ConvertMap(PandasOptions options, const ChunkedArray& data,
978 PyObject** out_values) {

Callers 1

ConvertMapFunction · 0.85

Calls 4

UnknownErrorFunction · 0.85
OKFunction · 0.50
dataMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected