-
Notifications
You must be signed in to change notification settings - Fork 3.7k
GH-45908: [C++][Docs] Expose basic {Array,...}FromJSON helpers as public APIs #46180
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
base: main
Are you sure you want to change the base?
Conversation
This comment was marked as resolved.
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
3b6015e
to
cf808f9
Compare
@github-actions crossbow submit preview-docs |
Revision: cf808f9 Submitted crossbow builds: ursacomputing/crossbow @ actions-7a9d15701e
|
Docs previews: |
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.
Thank you for bringing this up! I have some minor comments.
Co-authored-by: Enrico Minack <github@enrico.minack.dev>
Thanks for the review @pitrou
Adding an extra word wouldn't make the files longer than other files we already have so I think that's fine. Since "object" has a specific meaning in the context of JSON that differs from what these helpers are ingesting, maybe
Makes sense. I reverted the api.h change and updated the PR description. |
@github-actions crossbow submit preview-docs |
Revision: 11da4d4 Submitted crossbow builds: ursacomputing/crossbow @ actions-bfb9efe751
|
Latest docs preview:
I think the only remaining review item on this PR is wrapping up what's being discussed in #46180 (comment). |
I like |
It focus on filename not function names (such as I like (I think that developers don't think that the API accepts JSONL by |
I find As @kou says, it mimics the method suffix of all methods. |
Our JSONL reader lives in |
No, but developers will not understand the difference between |
And, by the way, we could also rename the functions since they are not public yet ;) |
Agreed. The most correct solution seems to be renaming to |
I like this. |
I'm not sure the benefit of putting these helpers in the public API outweighs the downsides of renaming I should also point out that there are other |
If we think that JSON means JSONL too, I think that we don't need to distinguish If we think that JSON doesn't mean JSONL, I think that renaming |
I'll admit it's entirely subjective. If most of those who have commented here are fine making the |
I can agree with this. In the end we must find an organization that is easy to understand for the user. It can involve renaming files or not, renaming APIs or not... |
JSONL is just lines of JSON, which feels more like a property of the reader than being a flavour of JSON. In my opinion, it does not feel contrary to JSON. Assuming the JSONL code stays in |
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?
ArrayFromJSON
,ChunkedArrayFromJSON
,DictArrayFromJSON
,ScalarFromJSON
,DictScalarFromJSON
fromarrow::ipc::internal
namespace toarrow::util
so it's clearer they're part of the public APIjson_simple.{h,cc}
tofrom_json.{h,cc}
which is clearer IMOAre 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
{Array,...}FromJSON
as public APIs #45908