From 4343230fb03937eb7ce6b334f81c4ffdd3a5f95f Mon Sep 17 00:00:00 2001 From: Kobe Attias Date: Sun, 16 Jun 2024 10:55:03 -0400 Subject: [PATCH] Changing filter names to reflect new personalize env --- .../views/researchhub_unified_document_views.py | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/src/researchhub_document/views/researchhub_unified_document_views.py b/src/researchhub_document/views/researchhub_unified_document_views.py index 5377830d5..10eca4d21 100644 --- a/src/researchhub_document/views/researchhub_unified_document_views.py +++ b/src/researchhub_document/views/researchhub_unified_document_views.py @@ -23,6 +23,7 @@ from hypothesis.models import Hypothesis from paper.models import Paper from paper.utils import get_cache_key +from researchhub.settings import AWS_REGION_NAME from researchhub_document.filters import UnifiedDocumentFilter from researchhub_document.models import ( FeaturedContent, @@ -51,13 +52,9 @@ UNIFIED_DOC_PAGE_SIZE, UnifiedDocPagination, ) -from researchhub.settings import AWS_REGION_NAME from user.permissions import IsModerator from user.utils import reset_latest_acitvity_cache -from utils.aws import ( - get_arn, - PERSONALIZE, -) +from utils.aws import PERSONALIZE, get_arn from utils.permissions import ReadOnly @@ -142,7 +139,7 @@ def _get_recommendation_buckets(self, user_id): { "name": "highly-cited", "source": "personalize", - "campaign_arn": get_arn(PERSONALIZE, "campaign/recommendations3"), + "campaign_arn": get_arn(PERSONALIZE, "campaign/recommendations"), "filter_arn": get_arn(PERSONALIZE, "filter/highly-cited"), "num_results": 100, "dist_pct": 0.1, @@ -150,7 +147,7 @@ def _get_recommendation_buckets(self, user_id): { "name": "trending-citations", "source": "personalize", - "campaign_arn": get_arn(PERSONALIZE, "campaign/recommendations3"), + "campaign_arn": get_arn(PERSONALIZE, "campaign/recommendations"), "filter_arn": get_arn(PERSONALIZE, "filter/trending-citations"), "num_results": 100, "dist_pct": 0.25, @@ -158,7 +155,7 @@ def _get_recommendation_buckets(self, user_id): { "name": "popular-on-social-media", "source": "personalize", - "campaign_arn": get_arn(PERSONALIZE, "campaign/recommendations3"), + "campaign_arn": get_arn(PERSONALIZE, "campaign/recommendations"), "filter_arn": get_arn(PERSONALIZE, "filter/popular-on-social-media"), "num_results": 100, "dist_pct": 0.1, @@ -166,7 +163,7 @@ def _get_recommendation_buckets(self, user_id): { "name": "only-papers", "source": "personalize", - "campaign_arn": get_arn(PERSONALIZE, "campaign/recommendations3"), + "campaign_arn": get_arn(PERSONALIZE, "campaign/recommendations"), "filter_arn": get_arn(PERSONALIZE, "filter/only-papers"), "num_results": 100, "dist_pct": 0.1, @@ -174,7 +171,7 @@ def _get_recommendation_buckets(self, user_id): { "name": "trending-on-rh", "source": "personalize", - "campaign_arn": get_arn(PERSONALIZE, "campaign/trending-on-rh"), + "campaign_arn": get_arn(PERSONALIZE, "campaign/trending"), "filter_arn": None, "num_results": 100, "dist_pct": 0.15,