Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions jobs/quicksuggest2bq/quicksuggest2bq/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,10 @@ def download_suggestions(client: kinto_http.Client) -> Iterator[KintoSuggestion]
{"keyword": kw, "count": count}
for kw, count in suggestion_data.get("full_keywords", [])
],
"serp_categories": [
{"category": category_id}
for category_id in suggestion_data.get("serp_categories", [])
],
}
yield KintoSuggestion(**suggestion)

Expand Down
3 changes: 2 additions & 1 deletion jobs/quicksuggest2bq/tests/test_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,8 @@ def test_suggestion_full_keyword(self, mocked_kinto_client):

def test_suggestion_serp_categories(self, mocked_kinto_client):
suggestions = list(download_suggestions(mocked_kinto_client))
assert suggestions[0].serp_categories == SERP_CATEGORIES
assert suggestions[0].serp_categories[0]["category"] == 1
assert suggestions[0].serp_categories[1]["category"] == 2

def test_suggestion_score(self, mocked_kinto_client):
suggestions = list(download_suggestions(mocked_kinto_client))
Expand Down