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

Restructure JSON code to correctly reflect legacy/experimental status #13757

Merged

Conversation

vuule
Copy link
Contributor

@vuule vuule commented Jul 25, 2023

Description

Closes #11982

Moved files to correct directories.
Updated namespaces: experimental -> base, base -> legacy
Improved namespace nesting to reduce the need for fully qualified names (json::detail instead of detail::json).
Use host_span instead of std::vector & in all read_json variants.

Checklist

  • I am familiar with the Contributing Guidelines.
  • New or existing tests cover these changes.
  • The documentation is up to date with these changes.

@vuule vuule added tech debt improvement Improvement / enhancement to an existing function non-breaking Non-breaking change labels Jul 25, 2023
@vuule vuule self-assigned this Jul 25, 2023
@github-actions github-actions bot added libcudf Affects libcudf (C++/CUDA) code. CMake CMake build issue labels Jul 25, 2023
@vuule vuule changed the title Update JSON code structure to correctly reflect legacy/experimental status Restructure JSON code to correctly reflect legacy/experimental status Jul 31, 2023
@@ -547,7 +543,7 @@ void convert_json_to_columns(parse_options_view const& opts,
}

/**
* @copydoc cudf::io::gpu::detect_data_types
* @copydoc cudf::io::json::detail::legacy::detect_data_types
Copy link
Contributor Author

Choose a reason for hiding this comment

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

the namespace was incorrect here AFAICT

@vuule vuule marked this pull request as ready for review August 1, 2023 18:03
@vuule vuule requested review from a team as code owners August 1, 2023 18:03
@@ -33,7 +33,7 @@ namespace cudf::io::json::detail {
*
* @return cudf::table object that contains the array of cudf::column.
*/
table_with_metadata read_json(std::vector<std::unique_ptr<cudf::io::datasource>>& sources,
table_with_metadata read_json(host_span<std::unique_ptr<datasource>> sources,
Copy link
Contributor

Choose a reason for hiding this comment

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

Out of scope for this PR, but a host_span<unique_ptr> feels off when it comes to ownership semantics. This pattern seems prevalent in cuIO though. Also I don't know if there's a nice idiomatic way to write this otherwise though since most implicit conversions won't quite work and there's limited interop between implicit conversions and template deduction.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, really sends a mixed message :D
Surely we can lose the unique_ptrs somewhere along the call chain...

Copy link
Contributor

Choose a reason for hiding this comment

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

Why do we need this new header?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Because we now call legacy::read_json from read_json.cu. It does make me wonder if we still need the other read_json.hpp.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Just checked, the other header is needed for tests; keeping the files as they are.

@vuule
Copy link
Contributor Author

vuule commented Aug 3, 2023

/merge

@rapids-bot rapids-bot bot merged commit dcc8d91 into rapidsai:branch-23.10 Aug 3, 2023
@vuule vuule deleted the fea-read_json-namespace-cleanup branch August 3, 2023 20:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CMake CMake build issue improvement Improvement / enhancement to an existing function libcudf Affects libcudf (C++/CUDA) code. non-breaking Non-breaking change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEA] Make experimental/read_json.hpp the default JSON reading engine
3 participants