Merge branch 'main' into avm99963-monorail

Merged commit 34d8229ae2b51fb1a15bd208e6fe6185c94f6266

GitOrigin-RevId: 7ee0917f93a577e475f8e09526dd144d245593f4
diff --git a/search/backendsearchpipeline.py b/search/backendsearchpipeline.py
index 69fdc6b..56fb6af 100644
--- a/search/backendsearchpipeline.py
+++ b/search/backendsearchpipeline.py
@@ -1,7 +1,6 @@
-# Copyright 2016 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file or at
-# https://developers.google.com/open-source/licenses/bsd
+# Copyright 2016 The Chromium Authors
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
 
 """Backend issue issue search and sorting.
 
@@ -27,8 +26,8 @@
 from framework import framework_helpers
 from framework import sorting
 from framework import sql
-from proto import ast_pb2
-from proto import tracker_pb2
+from mrproto import ast_pb2
+from mrproto import tracker_pb2
 from search import ast2ast
 from search import ast2select
 from search import ast2sort
@@ -156,11 +155,11 @@
     where.extend(query_where)
   except ast2ast.MalformedQuery as e:
     # TODO(jrobbins): inform the user that their query had invalid tokens.
-    logging.info('Invalid query tokens %s.\n %r\n\n', e.message, query_ast)
+    logging.info('Invalid query tokens %s.\n %r\n\n', str(e), query_ast)
     return [], False, e
   except ast2select.NoPossibleResults as e:
     # TODO(jrobbins): inform the user that their query was impossible.
-    logging.info('Impossible query %s.\n %r\n\n', e.message, query_ast)
+    logging.info('Impossible query %s.\n %r\n\n', str(e), query_ast)
     return [], False, e
   logging.info('translated to left_joins %r', left_joins)
   logging.info('translated to where %r', where)
@@ -203,9 +202,9 @@
 
   issue_ids, db_capped = services.issue.RunIssueQuery(
       cnxn, left_joins + sort_left_joins, where, order_by, shard_id=shard_id)
-  logging.warn('executed "%s" query %r for %d issues in %dms',
-               query_desc, query_ast, len(issue_ids),
-               int((time.time() - start_time) * 1000))
+  logging.warning(
+      'executed "%s" query %r for %d issues in %dms', query_desc, query_ast,
+      len(issue_ids), int((time.time() - start_time) * 1000))
   capped = fts_capped or db_capped
   return issue_ids, capped, None
 
@@ -280,7 +279,7 @@
       query_desc='getting query issue IDs')
   logging.info('Found %d result_iids', len(result_iids))
   if error:
-    logging.warn('Got error %r', error)
+    logging.warning('Got error %r', error)
 
   projects_str = ','.join(str(pid) for pid in sorted(query_project_ids))
   projects_str = projects_str or 'all'