From 118899d7de271494c60bffd6ee6c914623dcc0f1 Mon Sep 17 00:00:00 2001 From: Marco Rossi Date: Sun, 9 Sep 2018 22:00:54 -0400 Subject: [PATCH] When parsing dsjson, skip lines not starting with "{" (#1593) --- vowpalwabbit/parse_example_json.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/vowpalwabbit/parse_example_json.h b/vowpalwabbit/parse_example_json.h index bb8582949a9..77a4ddd855d 100644 --- a/vowpalwabbit/parse_example_json.h +++ b/vowpalwabbit/parse_example_json.h @@ -1190,6 +1190,13 @@ int read_features_json(vw* all, v_array& 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(*all, examples, line, num_chars, false, reinterpret_cast(&VW::get_unused_example), all, &interaction);