mirror of
https://github.com/scylladb/scylladb.git
synced 2026-05-12 19:02:12 +00:00
alternator: change empty return of PutItem
Without any arguments, PutItem should return no data at all. But somehow, for reasons I don't understand, the boto3 driver gets confused from an empty JSON thinking it isn't JSON at all. If we return a structure with an empty "attributes" fields, boto3 is happy. Signed-off-by: Nadav Har'El <nyh@scylladb.com>
This commit is contained in:
@@ -297,7 +297,10 @@ future<json::json_return_type> executor::put_item(sstring content) {
|
||||
elogger.warn("Applying mutation {}", m);
|
||||
|
||||
return _proxy.mutate(std::vector<mutation>{std::move(m)}, db::consistency_level::QUORUM, db::no_timeout, tracing::trace_state_ptr()).then([] () {
|
||||
return make_ready_future<json::json_return_type>("{}");
|
||||
// The Boto3 gets confused if we return just an empty structure {},
|
||||
// thinking it isn't JSON at all. I don't know why, but putting an
|
||||
// empty Attributes field in the result solves the problem.
|
||||
return make_ready_future<json::json_return_type>("{ \"Attributes\": {} }");
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user