Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 0 additions & 28 deletions cubedash/summary/_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
8 changes: 0 additions & 8 deletions cubedash/summary/_stores.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand Down