Expand recommend table with gap, daily stats, and client-side sorting
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user