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

Function CheckForDuplicateKeys

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

Source from the content-addressed store, hash-verified

944}
945
946Status 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
966Status ConvertMap(PandasOptions options, const ChunkedArray& data,
967 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