From 5ebf7a35009fcca410c43b9327203915ddfd0628 Mon Sep 17 00:00:00 2001 From: Ethan Wolinsky Date: Mon, 8 May 2023 22:21:32 -0400 Subject: [PATCH] Remove extra colon in dependencies key This seems like a bug, but if I'm mistaken please let me know. --- rq/job.py | 2 +- tests/test_job.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/rq/job.py b/rq/job.py index a0574e60..ee8544ad 100644 --- a/rq/job.py +++ b/rq/job.py @@ -716,7 +716,7 @@ class Job: @property def dependencies_key(self): - return '{0}:{1}:dependencies'.format(self.redis_job_namespace_prefix, self.id) + return '{0}{1}:dependencies'.format(self.redis_job_namespace_prefix, self.id) def fetch_dependencies(self, watch: bool = False, pipeline: Optional['Pipeline'] = None) -> List['Job']: """Fetch all of a job's dependencies. If a pipeline is supplied, and diff --git a/tests/test_job.py b/tests/test_job.py index 23bbd119..850bf7c4 100644 --- a/tests/test_job.py +++ b/tests/test_job.py @@ -994,7 +994,7 @@ class TestJob(RQTestCase): def test_dependencies_key_should_have_prefixed_job_id(self): job_id = 'random' job = Job(id=job_id) - expected_key = Job.redis_job_namespace_prefix + ":" + job_id + ':dependencies' + expected_key = Job.redis_job_namespace_prefix + job_id + ':dependencies' assert job.dependencies_key == expected_key