MCPcopy Index your code
hub / github.com/dataease/SQLBot / get_chart_data_with_user

Function get_chart_data_with_user

backend/apps/chat/curd/chat.py:231–239  ·  view source on GitHub ↗
(session: SessionDep, current_user: CurrentUser, chat_record_id: int)

Source from the content-addressed store, hash-verified

229
230
231def get_chart_data_with_user(session: SessionDep, current_user: CurrentUser, chat_record_id: int):
232 stmt = select(ChatRecord.data).where(and_(ChatRecord.id == chat_record_id, ChatRecord.create_by == current_user.id))
233 res = session.execute(stmt)
234 for row in res:
235 try:
236 return orjson.loads(row.data)
237 except Exception:
238 pass
239 return {}
240
241def get_chart_data_with_user_live(session: SessionDep, current_user: CurrentUser, chat_record_id: int):
242 stmt = select(ChatRecord.datasource,ChatRecord.sql).where(and_(ChatRecord.id == chat_record_id, ChatRecord.create_by == current_user.id))

Callers 1

innerFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected