Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace func.agdc.common_timestamp with hardcoded conversion #595

Open
wants to merge 9 commits into
base: develop
Choose a base branch
from
5 changes: 4 additions & 1 deletion cubedash/summary/_extents.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
literal,
null,
select,
text,
)
from sqlalchemy.dialects import postgresql as postgres
from sqlalchemy.engine import Engine
Expand Down Expand Up @@ -532,7 +533,9 @@ def _dataset_creation_expression(md: MetadataType) -> ClauseElement:
else:
doc = md.dataset_fields["metadata_doc"].alchemy_expression
creation_dt = md.definition["dataset"].get("creation_dt") or ["creation_dt"]
creation_expression = func.agdc.common_timestamp(doc[creation_dt].astext)
creation_expression = text(
str(doc[creation_dt].astext) + "::timestamp at time zone 'utc'"
)

# If they're missing a dataset-creation time, fall back to the time it was indexed.
return func.coalesce(creation_expression, DATASET.c.added)
Expand Down
Loading