feat(etl): 新增 yinyan_song_records2 初始化功能及空字符清理支持
- 扩展 run_etl.py,添加 --init-yinyan-records2 参数支持初始化 yinyan_song_records2 - 提升 BATCH_SIZE 从 100 到 1000,提升批处理效率 - 实现 _NulSafePgConnection 及 _NulSafePgCursor,自动清理 PostgreSQL 参数中的 NUL 字符,防止插入错误 - 新增查询接口 iter_hk_songs_records2_batches 和 fetch_all_song_record_relations,用于提取满足 records2 条件的歌曲关联数据 - 在 runner.py 中实现 initialize_yinyan_song_records2,写入所有合格歌曲关系并统一去除 records1 已存在的重复关系 - 在 writer.py 中新增 insert_yinyan_song_records2 和 delete_yinyan_song_records2_existing_relations 函数,实现批量插入和基于 records1 的重复关系删除 - 新增单元测试覆盖 NUL 字符清理、records2 插入及去重逻辑,保障代码质量和功能稳定性
Showing
10 changed files
with
330 additions
and
4 deletions
tests/test_connections.py
0 → 100644
-
Please register or sign in to post a comment