Skip to content

GH-45908: [C++][Docs] Rename and expose basic {Array,...}FromJSON helpers as public APIs - #46180

Merged
amoeba merged 33 commits into
apache:mainfrom
amoeba:feature/GH-45908--expose-from-json
May 14, 2025
Merged

GH-45908: [C++][Docs] Rename and expose basic {Array,...}FromJSON helpers as public APIs#46180
amoeba merged 33 commits into
apache:mainfrom
amoeba:feature/GH-45908--expose-from-json

Conversation

@amoeba

@amoebaamoeba commented Apr 18, 2025

Copy link
Copy Markdown
Member

Rationale for this change

These functions are generally useful and stable so it would be a good idea to clearly include them in the public API. I'm starting here with just the basic ones in order to make the PR small. See #45908 for more information.

What changes are included in this PR?

  • Moves ArrayFromJSON, ChunkedArrayFromJSON, DictArrayFromJSON, ScalarFromJSON, DictScalarFromJSON from arrow::ipc::internal namespace to arrow::json so it's clearer they're part of the public API and that they're more useful than just for IPC
  • Renames each of the above from {Array,...}FromJSON to {Array,...}FromJSONString to avoid confusion between these helpers and the main JSON(L) reader
  • Renames arrow/util/json_simple.{h,cc} to arrow/json/from_string.{h,cc} both because of the namespace jump but also because the filename is more clear.
  • Adds User Guide and adds a listing in the API docs for moved functions

Are these changes tested?

Yes.

Are there any user-facing changes?

This expands the scope of our public API but does not break any existing public APIs though it's possible users

@github-actions

This comment was marked as resolved.

This moves the following functions from the IPC namespace to util to make it clear these are useful outside of their use in Arrow IPC.
- ArrayFromJSON
- ChunkedArrayFromJSON
- DictArrayFromJSON
- ScalarFromJSON
- DictScalarFromJSON
@amoeba
amoebaforce-pushed the feature/GH-45908--expose-from-json branch from 3b6015e to cf808f9CompareApril 21, 2025 01:00
@amoebaamoeba changed the title GH-45908: [C++] Expose {Array,...}FromJSON as public APIsGH-45908: [C++] Expose basic {Array,...}FromJSON helpers as public APIsApr 21, 2025
@amoeba
amoeba marked this pull request as ready for review April 21, 2025 02:36
@amoeba

Copy link
Copy Markdown
MemberAuthor

@github-actions crossbow submit preview-docs

@amoebaamoeba changed the title GH-45908: [C++] Expose basic {Array,...}FromJSON helpers as public APIsGH-45908: [C++][Docs] Expose basic {Array,...}FromJSON helpers as public APIsApr 21, 2025
@github-actions

Copy link
Copy Markdown

Revision: cf808f9

Submitted crossbow builds: ursacomputing/crossbow @ actions-7a9d15701e

TaskStatus
preview-docsGitHub Actions

@amoeba

Copy link
Copy Markdown
MemberAuthor

Docs previews:

@zanmato1984zanmato1984 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thank you for bringing this up! I have some minor comments.

Comment threadcpp/src/arrow/CMakeLists.txt
Comment threadcpp/src/arrow/acero/hash_join_node_test.cc Outdated
Comment threadcpp/src/arrow/meson.build Outdated
Comment threaddocs/source/cpp/api/array.rst Outdated
@github-actionsgithub-actionsBot added awaiting committer review Awaiting committer review and removed awaiting review Awaiting review labels Apr 21, 2025
@bkietz

Copy link
Copy Markdown
Member

Well, those cases appear to have been responsible for that failure. After looking more closely, we've got an issue open for this already: #46343

@amoeba

Copy link
Copy Markdown
MemberAuthor

Nice catch. I commented there. I reverted the testing commit so the PR is in a merge-able state. Would you be okay if we merged with that one job failing or should we wait on #46343 and rebase before merge?

@EnricoMiEnricoMi left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Some minor comments.

Comment threadcpp/examples/arrow/from_json_string_example.cc Outdated
Comment threadcpp/src/arrow/testing/gtest_util.cc
Comment threadcpp/src/arrow/testing/gtest_util.cc
Comment threadcpp/src/arrow/testing/gtest_util.cc
Comment threadcpp/src/arrow/testing/gtest_util.cc
Comment threadcpp/src/arrow/testing/gtest_util.cc
Comment threadcpp/src/arrow/testing/gtest_util.cc
Comment threadcpp/src/arrow/testing/gtest_util.cc
@github-actionsgithub-actionsBot added awaiting merge Awaiting merge and removed awaiting change review Awaiting change review labels May 9, 2025
Co-authored-by: Enrico Minack <github@enrico.minack.dev>
@amoeba

Copy link
Copy Markdown
MemberAuthor

Thanks @bkietz. There were a couple of comments from @EnricoMi and I'll merge this once those are resolved.

@EnricoMiEnricoMi left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM!

@amoeba
amoeba merged commit 07778d9 into apache:mainMay 14, 2025
@amoebaamoeba removed the awaiting merge Awaiting merge label May 14, 2025
@amoeba

Copy link
Copy Markdown
MemberAuthor

Merged. Thanks all for the reviews, it's greatly appreciated.

Comment threadcpp/src/arrow/dataset/test_util_internal.h
@github-actionsgithub-actionsBot added the awaiting committer review Awaiting committer review label May 14, 2025
Comment threadcpp/src/arrow/json/from_string.cc
Comment threadcpp/src/arrow/json/from_string.h
@pitrou

Copy link
Copy Markdown
Member

I posted a couple comments, it would be nice to do a post-commit polish PR.

@amoeba

Copy link
Copy Markdown
MemberAuthor

I'll file an issue to follow-up on those.

@conbench-apache-arrow

Copy link
Copy Markdown

After merging your PR, Conbench analyzed the 4 benchmarking runs that have been run so far on merge-commit 07778d9.

There were no benchmark performance regressions. 🎉

The full Conbench report has more details. It also includes information about 1 possible false positive for unstable benchmarks that are known to sometimes produce them.

amoeba added a commit to amoeba/arrow that referenced this pull request Jun 3, 2025
pullBot pushed a commit to thompson-tomo/arrow that referenced this pull request Jun 3, 2025
…nternal.h (apache#46695)
### Rationale for this change
Addresses apache#46180 (comment). One of three PRs to resolveapache#46439.
### What changes are included in this PR?
- Remove unneeded namespace prefix in test_util_internal.h.
### Are these changes tested?
Yes. Impacted tests still pass.
### Are there any user-facing changes?
No.
* GitHub Issue: apache#46439
Authored-by: Bryce Mecum <petridish@gmail.com>
Signed-off-by: Sutou Kouhei <kou@clear-code.com>
@amoeba

Copy link
Copy Markdown
MemberAuthor

The post-merge comments were all resolved in #46439.

Sign up for freeto 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.

7 participants

@amoeba@pitrou@kou@EnricoMi@bkietz@rok@zanmato1984