Skip to content

Commit

Permalink
Non Streaming response and logs
Browse files Browse the repository at this point in the history
  • Loading branch information
fjcasti1 committed Oct 21, 2024
1 parent af0698d commit bbeaa01
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/phoenix/server/api/routers/v1/spans.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,10 @@ async def query_spans_handler(
detail=f"Invalid query: {e}",
status_code=HTTP_422_UNPROCESSABLE_ENTITY,
)
print(f"{queries=}\n\n")
print(f"{span_queries=}\n\n")
print(f"{project_name=}\n\n")
print(f"{end_time=}\n\n")
async with request.app.state.db() as session:
results = []
for query in span_queries:
Expand All @@ -114,12 +118,13 @@ async def query_spans_handler(
)
if not results:
raise HTTPException(status_code=HTTP_404_NOT_FOUND)
print(f"{results=}\n\n")

async def content() -> AsyncIterator[bytes]:
for result in results:
yield df_to_bytes(result)

return StreamingResponse(
return Response(
content=content(),
media_type="application/x-pandas-arrow",
)
Expand Down

0 comments on commit bbeaa01

Please sign in to comment.