impl(bigtable): populate Value proto with Type for parameters#15752
impl(bigtable): populate Value proto with Type for parameters#15752scotthart merged 1 commit intogoogleapis:mainfrom
Conversation
Summary of ChangesHello @scotthart, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request enhances the Bigtable client library's ability to represent query parameters by ensuring that the type information for each parameter is explicitly included in its protobuf serialization. This provides a more complete and accurate representation of the data being sent to the Bigtable service, which can be critical for correct query execution and type validation. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request implements the population of the Type field within the Value proto for query parameters. The changes in bound_query.cc correctly extract both type and value information and assemble the final protobuf message. The corresponding test updates in bound_query_test.cc properly verify this new behavior. I've included one suggestion to slightly refactor the implementation for improved efficiency and conciseness.
| auto type_value = bigtable_internal::ValueInternals::ToProto(kv.second); | ||
| google::bigtable::v2::Value v = std::move(type_value.second); | ||
| *v.mutable_type() = std::move(type_value.first); | ||
| parameters[kv.first] = std::move(v); |
There was a problem hiding this comment.
This block can be simplified to avoid creating a temporary Value object and an extra move operation. You can directly operate on the map's value reference, which is slightly more efficient and readable.
auto type_value = bigtable_internal::ValueInternals::ToProto(kv.second);
auto& v = parameters[kv.first];
v = std::move(type_value.second);
*v.mutable_type() = std::move(type_value.first);
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #15752 +/- ##
=======================================
Coverage 92.95% 92.96%
=======================================
Files 2445 2445
Lines 226249 226254 +5
=======================================
+ Hits 210310 210335 +25
+ Misses 15939 15919 -20 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
No description provided.