Skip to content

Commit

Permalink
feat: Use release_date column instead of jsonb query
Browse files Browse the repository at this point in the history
  • Loading branch information
jpmckinney committed Oct 7, 2024
1 parent af5c94b commit c52dd6b
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions dataset/metadata_aggregator.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,16 +122,13 @@ def get_kingfisher_metadata(kingfisher_process_cursor, collection_id):
"""\
SELECT
LEFT(MAX(ocid), 11) AS ocid_prefix,
MIN(data ->> 'date') AS published_from,
MAX(data ->> 'date') AS published_to
MIN(release_date) AS published_from,
MAX(release_date) AS published_to
FROM
compiled_release
JOIN data ON data.id = data_id
WHERE
collection_id = %(collection_id)s
AND data ? 'date'
AND data ->> 'date' IS NOT NULL
AND data ->> 'date' <> ''
AND release_date <> ''
""",
{"collection_id": collection_id},
)
Expand Down

0 comments on commit c52dd6b

Please sign in to comment.