From e4eae920c4d2ad1cc36f3f2603179de8cfe252c8 Mon Sep 17 00:00:00 2001 From: mpeddada1 Date: Mon, 29 Dec 2025 23:13:00 +0000 Subject: [PATCH] impl(spanner): remove MakeTestRow which was been deprecated --- google/cloud/spanner/mocks/row.h | 23 +++++++++++++-------- google/cloud/spanner/row.cc | 10 --------- google/cloud/spanner/row.h | 35 -------------------------------- 3 files changed, 15 insertions(+), 53 deletions(-) diff --git a/google/cloud/spanner/mocks/row.h b/google/cloud/spanner/mocks/row.h index 1ff5b5102377d..62782965ba76f 100644 --- a/google/cloud/spanner/mocks/row.h +++ b/google/cloud/spanner/mocks/row.h @@ -18,6 +18,7 @@ #include "google/cloud/spanner/row.h" #include "google/cloud/spanner/value.h" #include "google/cloud/version.h" +#include #include #include #include @@ -27,9 +28,6 @@ namespace cloud { namespace spanner_mocks { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -// TODO(#9086): Delete this when the MakeRow() implementation is moved here. -#include "google/cloud/internal/disable_deprecation_warnings.inc" - /** * Creates a `spanner::Row` with the specified column names and values. * @@ -41,7 +39,14 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN */ inline spanner::Row MakeRow( std::vector> pairs) { - return spanner::MakeTestRow(std::move(pairs)); + auto values = std::vector{}; + auto columns = std::make_shared>(); + for (auto& p : pairs) { + values.emplace_back(std::move(p.second)); + columns->emplace_back(std::move(p.first)); + } + return spanner_internal::RowFriend::MakeRow(std::move(values), + std::move(columns)); } /** @@ -58,12 +63,14 @@ inline spanner::Row MakeRow( */ template spanner::Row MakeRow(Ts&&... ts) { - return spanner::MakeTestRow(std::forward(ts)...); + auto columns = std::make_shared>(); + for (std::size_t i = 0; i < sizeof...(ts); ++i) { + columns->emplace_back(std::to_string(i)); + } + std::vector v{spanner::Value(std::forward(ts))...}; + return spanner_internal::RowFriend::MakeRow(std::move(v), std::move(columns)); } -// TODO(#9086): Delete this when the MakeRow() implementation is moved here. -#include "google/cloud/internal/diagnostics_pop.inc" - GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace spanner_mocks } // namespace cloud diff --git a/google/cloud/spanner/row.cc b/google/cloud/spanner/row.cc index 9db2726b5f477..4b02d98823f9e 100644 --- a/google/cloud/spanner/row.cc +++ b/google/cloud/spanner/row.cc @@ -35,16 +35,6 @@ GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END namespace spanner { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN -Row MakeTestRow(std::vector> pairs) { - auto values = std::vector{}; - auto columns = std::make_shared>(); - for (auto& p : pairs) { - values.emplace_back(std::move(p.second)); - columns->emplace_back(std::move(p.first)); - } - return spanner_internal::RowFriend::MakeRow(std::move(values), - std::move(columns)); -} Row::Row() : Row({}, std::make_shared>()) {} diff --git a/google/cloud/spanner/row.h b/google/cloud/spanner/row.h index d73624551d1b6..3a288ab6b6b43 100644 --- a/google/cloud/spanner/row.h +++ b/google/cloud/spanner/row.h @@ -200,41 +200,6 @@ class Row { std::shared_ptr const> columns_; }; -/** - * Creates a `Row` with the specified column names and values. - * - * This overload accepts a vector of pairs, allowing the caller to specify both - * the column names and the `Value` that goes in each column. - * - * This function is intended for application developers who are mocking the - * results of a `Client::ExecuteQuery` call. - */ -GOOGLE_CLOUD_CPP_SPANNER_MAKE_TEST_ROW_DEPRECATED() -Row MakeTestRow(std::vector> pairs); - -/** - * Creates a `Row` with `Value`s created from the given arguments and with - * auto-generated column names. - * - * This overload accepts a variadic list of arguments that will be used to - * create the `Value`s in the row. The column names will be implicitly - * generated, the first column being "0", the second "1", and so on, - * corresponding to the argument's position. - * - * This function is intended for application developers who are mocking the - * results of a `Client::ExecuteQuery` call. - */ -template -GOOGLE_CLOUD_CPP_SPANNER_MAKE_TEST_ROW_DEPRECATED() -Row MakeTestRow(Ts&&... ts) { - auto columns = std::make_shared>(); - for (std::size_t i = 0; i < sizeof...(ts); ++i) { - columns->emplace_back(std::to_string(i)); - } - std::vector v{Value(std::forward(ts))...}; - return spanner_internal::RowFriend::MakeRow(std::move(v), std::move(columns)); -} - /** * A `RowStreamIterator` is an _Input Iterator_ (see below) that returns a * sequence of `StatusOr` objects.