From 2bf0bf10649b163d505015827a5f92fc12675c95 Mon Sep 17 00:00:00 2001 From: Francesco Siddi Date: Wed, 21 Mar 2018 02:15:07 +0100 Subject: [PATCH] Formatting --- pillar/api/search/algolia_indexing.py | 5 +++-- pillar/celery/search_index_tasks.py | 5 ++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pillar/api/search/algolia_indexing.py b/pillar/api/search/algolia_indexing.py index e43393fe..704f623f 100644 --- a/pillar/api/search/algolia_indexing.py +++ b/pillar/api/search/algolia_indexing.py @@ -6,7 +6,7 @@ log = logging.getLogger(__name__) def push_updated_user(user_to_index: dict): - """Push an update to the Algolia index when a user item is updated""" + """Push an update to the index when a user document is updated.""" from pillar.api.utils.algolia import index_user_save @@ -20,6 +20,7 @@ def push_updated_user(user_to_index: dict): def index_node_save(node_to_index: dict): + """Save parsed node document to the index.""" from pillar.api.utils import algolia try: @@ -30,7 +31,7 @@ def index_node_save(node_to_index: dict): def index_node_delete(delete_id: str): - """ delete node using id""" + """Delete node using id.""" from pillar.api.utils import algolia try: diff --git a/pillar/celery/search_index_tasks.py b/pillar/celery/search_index_tasks.py index b61447e8..633c8355 100644 --- a/pillar/celery/search_index_tasks.py +++ b/pillar/celery/search_index_tasks.py @@ -57,14 +57,13 @@ def _handle_picture(node: dict, to_index: dict): def prepare_node_data(node_id: str, node: dict=None) -> dict: - """ - Given node by id or actual node build data object with fields to index. + """Given a node id or a node document, return an indexable version of it. Returns an empty dict when the node shouldn't be indexed. """ if node_id and node: - raise ValueError("do not provide node and node_id together") + raise ValueError("Do not provide node and node_id together") if node_id: node = _get_node_from_id(node_id)