diff --git a/src/fides/api/task/task_resources.py b/src/fides/api/task/task_resources.py index eff5c5064d..9999ec02aa 100644 --- a/src/fides/api/task/task_resources.py +++ b/src/fides/api/task/task_resources.py @@ -158,7 +158,10 @@ def extract_key_for_address(self, full_request_id: str) -> str: of the Dataset or the Collection name. """ request_id_dataset, collection = full_request_id.split(":") - dataset = request_id_dataset.split("__")[-1] + number_of_expected_items_to_remove = 2 + request_list = request_id_dataset.split("__") + address_list = request_list[number_of_expected_items_to_remove:] + dataset = "__".join(address_list) return f"{dataset}:{collection}" def cache_erasure(self, key: str, value: int) -> None: diff --git a/tests/ops/task/test_task_resources.py b/tests/ops/task/test_task_resources.py index efa84d5d3c..d5a13794c4 100644 --- a/tests/ops/task/test_task_resources.py +++ b/tests/ops/task/test_task_resources.py @@ -17,7 +17,7 @@ def test_cache_object(self, db, privacy_request, policy, integration_manual_conf [{"id": 2, "ccn": "111-111-1111-1111", "customer_id": 1}], ) resources.cache_object( - "access_request__postgres_example:double__underscore__collection", + "access_request__postgres__double__underscore__example:double__underscore__collection", [{"id": 3, "last_name": "Doe"}], ) resources.cache_erasure("manual_example:filing-cabinet", 2) @@ -28,7 +28,7 @@ def test_cache_object(self, db, privacy_request, policy, integration_manual_conf {"id": 2, "ccn": "111-111-1111-1111", "customer_id": 1} ], "postgres_example:customer": [{"id": 1, "last_name": "Doe"}], - "postgres_example:double__underscore__collection": [ + "postgres__double__underscore__example:double__underscore__collection": [ {"id": 3, "last_name": "Doe"} ], }