Expand recommend table with gap, daily stats, and client-side sorting

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-06-25 17:36:31 +08:00
parent a56370d2af
commit b641a4eaa0
6 changed files with 324 additions and 28 deletions
+9
View File
@@ -46,6 +46,13 @@ def rows_missing_trend(rows: list[dict]) -> bool:
return any("trend" not in r for r in rows)
def rows_missing_daily_stats(rows: list[dict]) -> bool:
"""缓存是否为旧版(缺少跳空/量价字段)。"""
if not rows:
return False
return any("gap" not in r for r in rows)
def recommend_cache_needs_refresh(
cached: dict,
*,
@@ -59,6 +66,8 @@ def recommend_cache_needs_refresh(
return True
if rows_missing_trend(rows):
return True
if rows_missing_daily_stats(rows):
return True
if float(capital or 0) > 0 and not rows:
return True
return False