Skip to content
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

ARROW-15611: [C++] Migrate arrow::ipc::internal::json::ArrayFromJSON to Result<> #12713

Conversation

AlvinJ15
Copy link
Contributor

Migrate arrow::ipc::internal::json::ArrayFromJSON to Result<>

@github-actions
Copy link

@github-actions
Copy link

⚠️ Ticket has not been started in JIRA, please click 'Start Progress'.

Copy link
Member

@lidavidm lidavidm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are build errors that need fixing.

@@ -29,6 +29,7 @@
#include "arrow/scalar.h"
#include "arrow/table.h"
#include "arrow/type.h"
#include "arrow/testing/gtest_util.h"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure we want this linked to googletest, we should stick to the old version.

@AlvinJ15 AlvinJ15 force-pushed the ARROW-15611#Migrate_arrow_ipc_internal_json_ArrayFromJSON_to_Result branch 3 times, most recently from 4de1c69 to 749327a Compare March 27, 2022 09:03
@AlvinJ15 AlvinJ15 requested a review from lidavidm March 28, 2022 07:06
@@ -23,7 +23,7 @@ namespace arrow {
namespace gdb {

ARROW_PYTHON_EXPORT
void TestSession();
Status TestSession();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to update the binding signature on the Cython side.

@lidavidm
Copy link
Member

Er, whoops. Thanks for the changes, there's just a minor fix we should make. I think the S3 test issues are due to ARROW-16043, and we need to figure out why the GDB tests fail.

Copy link
Member

@pitrou pitrou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot for this, @AlvinJ15 . I think we can simplify things a bit, see comments.

// We define local variables for all types for which we want to test
// pretty-printing.
// Then, at the end of this function, we trap to the debugger, so that
// test instrumentation can print values from this frame by interacting
// with the debugger.
// The test instrumentation is in pyarrow/tests/test_gdb.py
// The test instrumentation is in pyarrow/tests/test_gdb.pytest_gdb.py
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that change is not deliberate, is it?

Comment on lines 85 to 89
Result<std::shared_ptr<Array>> SliceArrayFromJSON(const std::shared_ptr<DataType>& ty,
util::string_view json,
int64_t offset = 0,
int64_t length = -1) {
ARROW_ASSIGN_OR_RAISE(auto array, ArrayFromJSON(ty, json));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this change is necessary, instead, you could just have:

Suggested change
Result<std::shared_ptr<Array>> SliceArrayFromJSON(const std::shared_ptr<DataType>& ty,
util::string_view json,
int64_t offset = 0,
int64_t length = -1) {
ARROW_ASSIGN_OR_RAISE(auto array, ArrayFromJSON(ty, json));
std::shared_ptr<Array> SliceArrayFromJSON(const std::shared_ptr<DataType>& ty,
util::string_view json, int64_t offset = 0,
int64_t length = -1) {
auto array = *ArrayFromJSON(ty, json);

@@ -98,13 +96,13 @@ std::shared_ptr<Array> SliceArrayFromJSON(const std::shared_ptr<DataType>& ty,

} // namespace

void TestSession() {
Status TestSession() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similarly, this change doesn't seem necessary.

@AlvinJ15 AlvinJ15 force-pushed the ARROW-15611#Migrate_arrow_ipc_internal_json_ArrayFromJSON_to_Result branch from 749327a to 629f9fb Compare March 28, 2022 17:10
@AlvinJ15 AlvinJ15 requested a review from pitrou March 28, 2022 23:49
Copy link
Member

@pitrou pitrou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1, thanks for the update @AlvinJ15 !

@pitrou pitrou closed this in 77e2a11 Mar 29, 2022
@ursabot
Copy link

ursabot commented Mar 29, 2022

Benchmark runs are scheduled for baseline = 556ee23 and contender = 77e2a11. 77e2a11 is a master commit associated with this PR. Results will be available as each benchmark for each run completes.
Conbench compare runs links:
[Finished ⬇️0.0% ⬆️0.0%] ec2-t3-xlarge-us-east-2
[Finished ⬇️0.8% ⬆️0.04%] test-mac-arm
[Failed ⬇️0.0% ⬆️1.43%] ursa-i9-9960x
[Finished ⬇️0.34% ⬆️0.09%] ursa-thinkcentre-m75q
Buildkite builds:
[Finished] <https://buildkite.com/apache-arrow/arrow-bci-benchmark-on-ec2-t3-xlarge-us-east-2/builds/400| 77e2a113 ec2-t3-xlarge-us-east-2>
[Finished] <https://buildkite.com/apache-arrow/arrow-bci-benchmark-on-test-mac-arm/builds/386| 77e2a113 test-mac-arm>
[Failed] <https://buildkite.com/apache-arrow/arrow-bci-benchmark-on-ursa-i9-9960x/builds/382| 77e2a113 ursa-i9-9960x>
[Finished] <https://buildkite.com/apache-arrow/arrow-bci-benchmark-on-ursa-thinkcentre-m75q/builds/396| 77e2a113 ursa-thinkcentre-m75q>
[Finished] <https://buildkite.com/apache-arrow/arrow-bci-benchmark-on-ec2-t3-xlarge-us-east-2/builds/399| 556ee23e ec2-t3-xlarge-us-east-2>
[Finished] <https://buildkite.com/apache-arrow/arrow-bci-benchmark-on-test-mac-arm/builds/385| 556ee23e test-mac-arm>
[Failed] <https://buildkite.com/apache-arrow/arrow-bci-benchmark-on-ursa-i9-9960x/builds/386| 556ee23e ursa-i9-9960x>
[Finished] <https://buildkite.com/apache-arrow/arrow-bci-benchmark-on-ursa-thinkcentre-m75q/builds/395| 556ee23e ursa-thinkcentre-m75q>
Supported benchmarks:
ec2-t3-xlarge-us-east-2: Supported benchmark langs: Python, R. Runs only benchmarks with cloud = True
test-mac-arm: Supported benchmark langs: C++, Python, R
ursa-i9-9960x: Supported benchmark langs: Python, R, JavaScript
ursa-thinkcentre-m75q: Supported benchmark langs: C++, Java

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants