From 8a9f73d1c0788893e248453834890a277b77c495 Mon Sep 17 00:00:00 2001 From: Francisco Castillo Date: Thu, 24 Oct 2024 10:30:36 -0700 Subject: [PATCH] wip --- src/phoenix/server/api/routers/v1/spans.py | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/src/phoenix/server/api/routers/v1/spans.py b/src/phoenix/server/api/routers/v1/spans.py index b3b8c1f82e..b4d2a41019 100644 --- a/src/phoenix/server/api/routers/v1/spans.py +++ b/src/phoenix/server/api/routers/v1/spans.py @@ -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)