From 2da0aeffbe5d579f3e8d3e62f551ac2b703bb422 Mon Sep 17 00:00:00 2001 From: "Peter A. Jonsson" Date: Sun, 7 Sep 2025 16:59:38 +0200 Subject: [PATCH 1/2] schema: remove unused function --- cubedash/summary/_schema.py | 28 ---------------------------- 1 file changed, 28 deletions(-) diff --git a/cubedash/summary/_schema.py b/cubedash/summary/_schema.py index c77edc058..20f917435 100644 --- a/cubedash/summary/_schema.py +++ b/cubedash/summary/_schema.py @@ -70,34 +70,6 @@ def pg_create_index( ) -def pg_index_exists(conn, schema_name: str, table_name: str, index_name: str) -> bool: - """ - Does a postgres index exist? - - Unlike pg_exists(), we don't need heightened permissions on the table. - - So, for example, Explorer's limited-permission user can check agdc/ODC tables - that it doesn't own. - """ - return ( - conn.execute( - text(""" - select indexname - from pg_indexes - where schemaname=:schema_name and - tablename=:table_name and - indexname=:index_name - """), - { - "schema_name": schema_name, - "table_name": table_name, - "index_name": index_name, - }, - ).scalar() - is not None - ) - - def get_postgis_versions(conn) -> str: """What versions of Postgis, Postgres and libs do we have?""" return conn.execute(select(func.postgis_full_version())).scalar() From 0931865e8557fcf05f912244d40502b24eb140ce Mon Sep 17 00:00:00 2001 From: "Peter A. Jonsson" Date: Sun, 7 Sep 2025 21:57:56 +0200 Subject: [PATCH 2/2] stores: remove unused function --- cubedash/summary/_stores.py | 8 -------- 1 file changed, 8 deletions(-) diff --git a/cubedash/summary/_stores.py b/cubedash/summary/_stores.py index 25c275a6b..b2448352b 100644 --- a/cubedash/summary/_stores.py +++ b/cubedash/summary/_stores.py @@ -11,7 +11,6 @@ from uuid import UUID from zoneinfo import ZoneInfo -import dateutil.parser import structlog from cachetools.func import ttl_cache from dateutil import tz @@ -1527,13 +1526,6 @@ def get_dataset_footprint_region(self, dataset_id: UUID): return (to_shape(footprint) if footprint is not None else None, row.region_code) -def _safe_read_date(d): - if d: - return _utils.default_utc(dateutil.parser.parse(d)) - - return None - - def _summary_from_row( res: RowMapping, product_name: str,