Skip to content

Commit 9772881

Browse files
committed
refactor: remove end note date filter
1 parent 5ac5a24 commit 9772881

File tree

2 files changed

+14
-6
lines changed

2 files changed

+14
-6
lines changed

etl/seed/settings.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"languages": ["ja"],
44
"keywords": [],
55
"start_millis": 1761922800000,
6-
"end_millis": 1771858740000
6+
"end_millis": null
77
},
8-
"description": "Note filtering configuration. start_millis is required. end_millis is optional (null = no upper limit). Timestamps in milliseconds UTC. Current: 2025-11-01 00:00:00 JST ~ 2026-02-23 23:59:00 JST"
8+
"description": "Note filtering configuration. start_millis is required. end_millis is optional (null = no upper limit). Timestamps in milliseconds UTC. Current: 2025-11-01 00:00:00 JST ~"
99
}

etl/tests/test_extract_ratings_swap.py

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,11 @@ def test_aborts_when_below_min_rows(self) -> None:
177177

178178
def test_succeeds_when_above_min_rows(self) -> None:
179179
mock_session = MagicMock()
180+
# pg_indexesクエリ: scalar()は旧PK名、新PK名の順に呼ばれる
181+
mock_session.execute.return_value.scalar.side_effect = [
182+
"row_note_ratings_pkey", # 旧テーブルのPK名
183+
"row_note_ratings_new_pkey", # 新テーブルのPK名
184+
]
180185

181186
_swap_ratings_table(mock_session, min_rows=500, staging_count=1000)
182187

@@ -185,18 +190,21 @@ def test_succeeds_when_above_min_rows(self) -> None:
185190

186191
def test_swap_sql_sequence(self) -> None:
187192
mock_session = MagicMock()
193+
# pg_indexesクエリ: scalar()は旧PK名、新PK名の順に呼ばれる
194+
mock_session.execute.return_value.scalar.side_effect = [
195+
"row_note_ratings_pkey", # 旧テーブルのPK名
196+
"row_note_ratings_new_pkey", # 新テーブルのPK名
197+
]
188198

189199
_swap_ratings_table(mock_session, min_rows=1, staging_count=1000)
190200

191201
sql_calls = [str(c.args[0].text) for c in mock_session.execute.call_args_list]
192-
# ADD CONSTRAINT PK → SET LOGGED → DROP old → RENAME prod → RENAME old PK → RENAME staging → RENAME new PK → DROP old
193202
assert any("ADD CONSTRAINT" in s and "PRIMARY KEY" in s for s in sql_calls)
194203
assert any("SET LOGGED" in s for s in sql_calls)
195204
assert any("RENAME TO row_note_ratings_old" in s for s in sql_calls)
196-
# 旧PKインデックスを先にリネームして名前衝突を回避
197-
assert any("RENAME TO row_note_ratings_old_pkey" in s for s in sql_calls)
198205
assert any("RENAME TO row_note_ratings" in s for s in sql_calls)
199-
# 新PKインデックスのリネーム
206+
# カタログから取得したPK名でリネーム
207+
assert any("RENAME TO row_note_ratings_old_pkey" in s for s in sql_calls)
200208
assert any("RENAME TO row_note_ratings_pkey" in s for s in sql_calls)
201209

202210

0 commit comments

Comments
 (0)