From e19a6649e1de0a256c5f7cbf8c1bf5fc73275b41 Mon Sep 17 00:00:00 2001 From: James McKinney <26463+jpmckinney@users.noreply.github.com> Date: Thu, 25 Jan 2024 16:07:08 -0500 Subject: [PATCH] fix: Fix extraction of OCID for collection metadata --- dataset/meta_data_aggregator.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/dataset/meta_data_aggregator.py b/dataset/meta_data_aggregator.py index f412a1d8..c3978ad8 100644 --- a/dataset/meta_data_aggregator.py +++ b/dataset/meta_data_aggregator.py @@ -134,6 +134,8 @@ def get_kingfisher_meta_data(kingfisher_process_cursor, collection_id): logger.warning("No rows found in `release` or `record` where collection_id = %s", root_id) return meta_data + meta_data["collection_metadata"]["ocid_prefix"] = release_or_record["ocid"][:11] + kingfisher_process_cursor.execute( "SELECT data FROM package_data WHERE id = %(id)s LIMIT 1", {"id": release_or_record["package_data_id"]}, @@ -142,11 +144,6 @@ def get_kingfisher_meta_data(kingfisher_process_cursor, collection_id): if package_data_row: package_data = package_data_row["data"] - - value = deep_get(release_or_record, "ocid") - if value and type(value) is str: - meta_data["collection_metadata"]["ocid_prefix"] = value[:11] - if value := deep_get(package_data, "publisher.name"): meta_data["collection_metadata"]["publisher"] = value