feat: causal lab
This commit is contained in:
@@ -853,9 +853,10 @@ def analyze_event(body: AnalyzeRequest):
|
||||
|
||||
@router.get("/api/causal-lab/analyses")
|
||||
def list_analyses(
|
||||
template_id: int = Query(0),
|
||||
instrument: str = Query(""),
|
||||
limit: int = Query(100, le=500),
|
||||
template_id: int = Query(0),
|
||||
market_event_id: int = Query(0),
|
||||
instrument: str = Query(""),
|
||||
limit: int = Query(100, le=500),
|
||||
):
|
||||
try:
|
||||
from services.database import get_conn
|
||||
@@ -865,6 +866,8 @@ def list_analyses(
|
||||
conditions = ["1=1"]
|
||||
if template_id:
|
||||
conditions.append(f"a.template_id = {template_id}")
|
||||
if market_event_id:
|
||||
conditions.append(f"a.market_event_id = {market_event_id}")
|
||||
if instrument:
|
||||
conditions.append(f"a.instrument = '{instrument}'")
|
||||
where = " AND ".join(conditions)
|
||||
|
||||
Reference in New Issue
Block a user