Skip to content
This repository was archived by the owner on May 5, 2025. It is now read-only.

Commit 8bf6551

Browse files
fix: step 3 of changing cache task args (#1198)
1 parent 5e7c363 commit 8bf6551

3 files changed

Lines changed: 9 additions & 14 deletions

File tree

services/test_analytics/tests/test_ta_cache_rollups.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ def test_cache_test_rollups(storage, snapshot):
7878

7979
CacheTestRollupsTask().run_impl(
8080
_db_session=None,
81-
repoid=1,
81+
repo_id=1,
8282
branch=None,
8383
impl_type="new",
8484
)
@@ -170,7 +170,7 @@ def test_cache_test_rollups_use_timeseries_main(storage, snapshot):
170170

171171
CacheTestRollupsTask().run_impl(
172172
_db_session=None,
173-
repoid=1,
173+
repo_id=1,
174174
branch="main",
175175
impl_type="new",
176176
)
@@ -262,7 +262,7 @@ def test_cache_test_rollups_use_timeseries_branch(storage, snapshot):
262262

263263
CacheTestRollupsTask().run_impl(
264264
_db_session=None,
265-
repoid=1,
265+
repo_id=1,
266266
branch="feature",
267267
impl_type="new",
268268
)

tasks/cache_test_rollups.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -115,16 +115,11 @@ def run_impl(
115115
self,
116116
_db_session,
117117
branch: str,
118-
repo_id: int | None = None,
119-
repoid: int | None = None,
118+
repo_id: int,
120119
update_date: bool = True,
121120
impl_type: Literal["old", "new", "both"] = "old",
122121
**kwargs,
123122
):
124-
repo_id = repo_id or repoid
125-
if repo_id is None:
126-
raise ValueError("repo_id or repoid must be provided")
127-
128123
redis_conn = get_redis_connection()
129124
try:
130125
with redis_conn.lock(

tasks/tests/unit/test_cache_test_rollups.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ def test_cache_test_rollups(self, mock_storage, transactional_db):
8888

8989
task = CacheTestRollupsTask()
9090
result = task.run_impl(
91-
_db_session=None, repoid=self.repo.repoid, branch="main"
91+
_db_session=None, repo_id=self.repo.repoid, branch="main"
9292
)
9393
assert result == {"success": True}
9494

@@ -191,7 +191,7 @@ def test_cache_test_rollups_no_update_date(self, mock_storage, transactional_db)
191191
task = CacheTestRollupsTask()
192192
_ = task.run_impl(
193193
_db_session=None,
194-
repoid=rollup_date.repository_id,
194+
repo_id=rollup_date.repository_id,
195195
branch=rollup_date.branch,
196196
update_date=False,
197197
)
@@ -213,7 +213,7 @@ def test_cache_test_rollups_update_date(self, mock_storage, transactional_db):
213213
task = CacheTestRollupsTask()
214214
_ = task.run_impl(
215215
_db_session=None,
216-
repoid=rollup_date.repository_id,
216+
repo_id=rollup_date.repository_id,
217217
branch="main",
218218
update_date=True,
219219
)
@@ -231,7 +231,7 @@ def test_cache_test_rollups_update_date_does_not_exist(
231231
task = CacheTestRollupsTask()
232232
_ = task.run_impl(
233233
_db_session=None,
234-
repoid=self.repo.repoid,
234+
repo_id=self.repo.repoid,
235235
branch="main",
236236
update_date=True,
237237
)
@@ -249,7 +249,7 @@ def test_cache_test_rollups_both(self, mock_storage, transactional_db, mocker):
249249
with time_machine.travel(dt.datetime.now(dt.UTC), tick=False):
250250
_ = task.run_impl(
251251
_db_session=None,
252-
repoid=self.repo.repoid,
252+
repo_id=self.repo.repoid,
253253
branch="main",
254254
update_date=True,
255255
impl_type="both",

0 commit comments

Comments
 (0)