Skip to content

Commit

Permalink
clean up code after debugging apache/datafusion-python#862
Browse files Browse the repository at this point in the history
  • Loading branch information
Rick Spencer committed Sep 7, 2024
1 parent b7545fb commit 6c8d7ee
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion shoots/shoots_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import argparse
import jwt
import datetime

try:
from .jwt_server_auth import JWTServerAuthHandler, JWTMiddleware
except ImportError:
Expand Down Expand Up @@ -152,14 +153,17 @@ def do_get(self, context, ticket):
raise e

except Exception as e:
raise flight.FlightServerError(extra_info=str(e))
exception = {"type":"DataFusionError",
"message":str(e)}
raise flight.FlightServerError(extra_info=json.dumps(exception))

def _get_arrow_table_from_sql(self, name, file_path, sql_query):
try:
ctx = SessionContext()
ctx.register_parquet(name, file_path)
result = ctx.sql(sql_query)
table = result.to_arrow_table()

return table
except Exception as e:
if "DataFusion error" in str(e):
Expand Down

0 comments on commit 6c8d7ee

Please sign in to comment.