Skip to content

Commit

Permalink
When parsing dsjson, skip lines not starting with "{" (#1593)
Browse files Browse the repository at this point in the history
  • Loading branch information
marco-rossi29 authored and JohnLangford committed Sep 10, 2018
1 parent d08381f commit 118899d
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions vowpalwabbit/parse_example_json.h
Original file line number Diff line number Diff line change
Expand Up @@ -1190,6 +1190,13 @@ int read_features_json(vw* all, v_array<example*>& examples)
line[num_chars] = '\0';
if (all->p->decision_service_json)
{
// Skip lines that do not start with "{"
if (line[0] != '{')
{
reread = true;
continue;
}

DecisionServiceInteraction interaction;
VW::template read_line_decision_service_json<audit>(*all, examples, line, num_chars, false, reinterpret_cast<VW::example_factory_t>(&VW::get_unused_example), all, &interaction);

Expand Down

0 comments on commit 118899d

Please sign in to comment.