Files
danswer/backend/onyx/background/task_utils.py
Chris Weaver 70df685709 Non default schema fix (#4667)
* Use correct postgres schema

* Remove raw Session() use

* Refactor + add test

* Fix comment
2025-05-06 20:35:59 -07:00

12 lines
323 B
Python

QUERY_REPORT_NAME_PREFIX = "query-history"
def construct_query_history_report_name(
task_id: str,
) -> str:
return f"{QUERY_REPORT_NAME_PREFIX}-{task_id}.csv"
def extract_task_id_from_query_history_report_name(name: str) -> str:
return name.removeprefix(f"{QUERY_REPORT_NAME_PREFIX}-").removesuffix(".csv")