-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GH-39864: [C++] DataType::ToString support optionally show metadata #39888
Conversation
|
MapType::ToString() don't show the metadata currently. It use type().ToString() and field.name(). I didn't change here.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
std::string ToStringWithMetadata(const DataType& t, bool show_metadata) { | ||
return t.ToString(); | ||
return t.ToString(show_metadata); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 <[email protected]>
Signed-off-by: xiansen.chen <[email protected]>
Signed-off-by: xiansen.chen <[email protected]>
Signed-off-by: xiansen.chen <[email protected]>
Signed-off-by: xiansen.chen <[email protected]>
Signed-off-by: xiansen.chen <[email protected]>
Signed-off-by: xiansen.chen <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've made a few minor changes. Thanks @Cerdore for tackling this, I'll be merging this PR if CI passes.
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. |
…data (apache#39888) ### 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: apache#39864 * Closes: apache#39864 Lead-authored-by: xiansen.chen <[email protected]> Co-authored-by: Antoine Pitrou <[email protected]> Signed-off-by: Antoine Pitrou <[email protected]>
Sorry, I've been busy with some other things lately... And thank you very much for your suggestions and subsequent changes! |
…data (apache#39888) ### 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: apache#39864 * Closes: apache#39864 Lead-authored-by: xiansen.chen <[email protected]> Co-authored-by: Antoine Pitrou <[email protected]> Signed-off-by: Antoine Pitrou <[email protected]>
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