phase 17: quote reserved word 'window' in all SQL queries across recommendation worker and query API

This commit is contained in:
Celes Renata
2026-04-12 03:45:51 -07:00
parent 181ed2b6cd
commit d16e15c885
3 changed files with 10 additions and 10 deletions
+3 -3
View File
@@ -74,7 +74,7 @@ WHERE d.id = ANY(
|| COALESCE(tw.top_opposing_evidence, '[]'::jsonb)
)::uuid
FROM trend_windows tw
WHERE tw.entity_id = $1 AND tw.window = $2
WHERE tw.entity_id = $1 AND tw."window" = $2
ORDER BY tw.generated_at DESC
LIMIT 1
)
@@ -117,12 +117,12 @@ async def fetch_data_quality_context(
_LATEST_TREND_QUERY = """
SELECT
entity_type, entity_id, window, trend_direction, trend_strength,
entity_type, entity_id, "window", trend_direction, trend_strength,
confidence, top_supporting_evidence, top_opposing_evidence,
dominant_catalysts, material_risks, contradiction_score,
disagreement_details, market_context, generated_at
FROM trend_windows
WHERE entity_id = $1 AND window = $2
WHERE entity_id = $1 AND "window" = $2
ORDER BY generated_at DESC
LIMIT 1
"""