From 6344c64435b8245066f7a39592059083cb6aae36 Mon Sep 17 00:00:00 2001 From: Miguel Vieira Date: Fri, 31 Mar 2023 09:40:55 +0100 Subject: [PATCH] fix: lint warnings --- data_portal_explorer/cli.py | 2 +- data_portal_explorer/data_portal_explorer.py | 8 +++----- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/data_portal_explorer/cli.py b/data_portal_explorer/cli.py index 634661e..fd48c21 100644 --- a/data_portal_explorer/cli.py +++ b/data_portal_explorer/cli.py @@ -214,7 +214,7 @@ def get_packages_requests(portals, workers, namespace, rows, limit): start = 0 number_of_requests = max(int(n / rows), 1) - for i in range(number_of_requests): + for _ in range(number_of_requests): requests.append([portal, namespace, start, rows]) start += rows except CKANAPIError as e: diff --git a/data_portal_explorer/data_portal_explorer.py b/data_portal_explorer/data_portal_explorer.py index 0d2cdd9..36fc8fa 100644 --- a/data_portal_explorer/data_portal_explorer.py +++ b/data_portal_explorer/data_portal_explorer.py @@ -27,8 +27,8 @@ def get_extensions(portal): @lru_cache(maxsize=64) -def get_remote_ckan(portal_url, get_only=False): - return RemoteCKAN(portal_url, get_only=True) +def get_remote_ckan(portal_url, get_only=True): + return RemoteCKAN(portal_url, get_only=get_only) def get_facets(portal, name): @@ -41,7 +41,7 @@ def get_facets(portal, name): if r and facet_field in r["facets"]: data = r["facets"][facet_field] - return dict(sorted(data.items(), key=lambda t: t[0].lower())) + return dict(sorted(data.items(), key=lambda t: t[0].lower().strip())) return {} @@ -55,8 +55,6 @@ def get_number_of_packages(portal): except CKANAPIError: return -1 - return 0 - def get_packages(portal, namespace, start, rows): url = portal["url"]