GH-39864: [C++] DataType::ToString support optionally show metadata#39888
GH-39864: [C++] DataType::ToString support optionally show metadata#39888pitrou merged 9 commits intoapache:mainfrom
Conversation
|
|
|
MapType::ToString() don't show the metadata currently. It use type().ToString() and field.name(). I didn't change here. |
westonpace
left a comment
There was a problem hiding this comment.
This looks like a reasonable addition to me. I think those python test failures might be relevant though (looks like the gdb extension might be calling ToString somewhere and need to explicitly pass a show_metadata arg)
pitrou
left a comment
There was a problem hiding this comment.
Can you also change AssertTypeEqual so that it shows the metadata on error?
|
|
I mean change these now that arrow/cpp/src/arrow/testing/gtest_util.cc Lines 235 to 242 in 8ffc214 |
Thank you! I see. |
cpp/src/arrow/testing/gtest_util.cc
Outdated
There was a problem hiding this comment.
Thanks, but this can actually be simplified now. ToStringWithMetadata was created because DataType::ToString didn't support the show_metadata argument. Now that it does, ToStringWithMetadata can probably be suppressed and all calls to ToStringWithMetadata(t, show_metadata) replaced with t.ToString(show_metadata).
Signed-off-by: xiansen.chen <xiansen.chen@openpie.com>
Signed-off-by: xiansen.chen <xiansen.chen@openpie.com>
Signed-off-by: xiansen.chen <xiansen.chen@openpie.com>
Signed-off-by: xiansen.chen <xiansen.chen@openpie.com>
Signed-off-by: xiansen.chen <xiansen.chen@openpie.com>
|
After merging your PR, Conbench analyzed the 7 benchmarking runs that have been run so far on merge-commit c5f60a0. There were no benchmark performance regressions. 🎉 The full Conbench report has more details. It also includes information about 12 possible false positives for unstable benchmarks that are known to sometimes produce them. |
Sorry, I've been busy with some other things lately... And thank you very much for your suggestions and subsequent changes! |
Rationale for this change
Support showing metadata of nested DataType which have child fields.
What changes are included in this PR?
Add an optional argument "show_metadata" to the ToString() of DataType and other DataType derived class. And we also add it to TypeHolder::ToString().
Are these changes tested?
Yes, I add tests for changes.
Are there any user-facing changes?
No.
Closes: #39864