]> git.openstreetmap.org Git - nominatim.git/blobdiff - src/nominatim_db/clicmd/admin.py
remove remaining pylint hints
[nominatim.git] / src / nominatim_db / clicmd / admin.py
index 7b97557d5925187ab795dca0e43d110f2690e0bf..85482ea403fa53af1f4d92f50abb5f9a2f360cf0 100644 (file)
@@ -11,14 +11,10 @@ import logging
 import argparse
 import random
 
-from nominatim_core.errors import UsageError
-from nominatim_core.db.connection import connect
+from ..errors import UsageError
+from ..db.connection import connect, table_exists
 from .args import NominatimArgs
 
-# Do not repeat documentation of subcommand classes.
-# pylint: disable=C0111
-# Using non-top-level imports to avoid eventually unused imports.
-# pylint: disable=E0012,C0415
 
 LOG = logging.getLogger()
 
@@ -57,9 +53,7 @@ class AdminFuncs:
         mgroup.add_argument('--place-id', type=int,
                             help='Analyse indexing of the given Nominatim object')
 
-
     def run(self, args: NominatimArgs) -> int:
-        # pylint: disable=too-many-return-statements
         if args.warm:
             return self._warm(args)
 
@@ -93,7 +87,6 @@ class AdminFuncs:
 
         return 1
 
-
     def _warm(self, args: NominatimArgs) -> int:
         try:
             import nominatim_api as napi
@@ -115,7 +108,7 @@ class AdminFuncs:
 
                 tokenizer = tokenizer_factory.get_tokenizer_for_db(args.config)
                 with connect(args.config.get_libpq_dsn()) as conn:
-                    if conn.table_exists('search_name'):
+                    if table_exists(conn, 'search_name'):
                         words = tokenizer.most_frequent_words(conn, 1000)
                     else:
                         words = []