Skip to content

Commit

Permalink
lint fix
Browse files Browse the repository at this point in the history
  • Loading branch information
gmechali committed Oct 21, 2024
1 parent 1133eb2 commit 2139275
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
7 changes: 5 additions & 2 deletions server/routes/shared_api/autocomplete/autocomplete.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ def autocomplete():
place_id_to_dcid = []
if place_ids:
place_id_to_dcid = json.loads(findplacedcid(place_ids).data)
logging.info("[Place_Autocomplete] Found %d place ID to DCID mappings.", len(place_id_to_dcid))
logging.info("[Place_Autocomplete] Found %d place ID to DCID mappings.",
len(place_id_to_dcid))

final_predictions = []
for prediction in prediction_responses:
Expand All @@ -63,6 +64,8 @@ def autocomplete():
matched_query=prediction.matched_query,
dcid=place_id_to_dcid[prediction.place_id])
final_predictions.append(current_prediction)
logging.info("[Place_Autocomplete] Returning a total of %d place predictions.", len(final_predictions))
logging.info(
"[Place_Autocomplete] Returning a total of %d place predictions.",
len(final_predictions))

return jsonify(AutoCompleteApiResponse(predictions=final_predictions))
5 changes: 3 additions & 2 deletions server/routes/shared_api/autocomplete/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
# limitations under the License.

import json
import re
import logging
import re
from typing import Dict, List
from urllib.parse import urlencode

Expand Down Expand Up @@ -123,7 +123,8 @@ def predict(queries: List[str], lang: str) -> List[ScoredPrediction]:
all_responses.append(scored_prediction)

all_responses.sort(key=get_score)
logging.info("[Place_Autocomplete] Received %d total place predictions.", len(all_responses))
logging.info("[Place_Autocomplete] Received %d total place predictions.",
len(all_responses))

responses = []
place_ids = set()
Expand Down

0 comments on commit 2139275

Please sign in to comment.