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

refactor: move json parser into its own lib #4381

Merged
merged 22 commits into from Dec 21, 2022

Conversation

olgavrou
Copy link
Collaborator

and move json tests to gtests

@@ -2,324 +2,6 @@

#include "vw/common/future_compat.h"

Copy link
Collaborator Author

@olgavrou olgavrou Dec 21, 2022

Choose a reason for hiding this comment

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

explicit template initialization needs to stick around here and in parse_example_json.cc until the deprecated functions are removed

template <typename... ArgsT>
std::unique_ptr<VW::config::options_i> make_args(ArgsT const&... args)
{
return std::unique_ptr<VW::config::options_cli>(new VW::config::options_cli(std::vector<std::string>({args...})));
}

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

parse_json/dsjson still used in most unit_tests so need to be available

test/unit_test/CMakeLists.txt Outdated Show resolved Hide resolved
vowpalwabbit/json_parser/CMakeLists.txt Outdated Show resolved Hide resolved
vowpalwabbit/json_parser/tests/dsjson_parser_test.cc Outdated Show resolved Hide resolved
vowpalwabbit/json_parser/tests/dsjson_parser_test.cc Outdated Show resolved Hide resolved
}

template <bool audit>
void read_line_json_s(const VW::label_parser& lbl_parser, hash_func_t hash_func, uint64_t hash_seed,
Copy link
Member

Choose a reason for hiding this comment

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

What does _s mean?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I am guessing string, we could rename it to plain read_line_json

Copy link
Member

Choose a reason for hiding this comment

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

Maybe after this merged we can do a pass cleaning up the functions a bit? We can leave it to later to make this one easier though

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yes we should, I also wanted to make some char*/size -> string_view transistions but the PR is big already

@olgavrou olgavrou merged commit 6cc5484 into VowpalWabbit:master Dec 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants