Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
fjcasti1 committed Oct 24, 2024
1 parent dc17edf commit 8a9f73d
Showing 1 changed file with 7 additions and 15 deletions.
22 changes: 7 additions & 15 deletions src/phoenix/server/api/routers/v1/spans.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,22 +120,14 @@ async def query_spans_handler(
raise HTTPException(status_code=HTTP_404_NOT_FOUND)
print(f"{results=}\n\n")

if len(results) == 1:
print(f"{df_to_bytes(results[0])=}\n\n")
return Response(
content=df_to_bytes(results[0]),
media_type="application/x-pandas-arrow",
)
else:

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

return StreamingResponse(
content=content(),
media_type="application/octet-stream",
)
return StreamingResponse(
content=content(),
media_type="application/octet-stream",
)


@router.get("/spans", include_in_schema=False, deprecated=True)
Expand Down

0 comments on commit 8a9f73d

Please sign in to comment.