[Serve][AIR] Fix pandas_read_json compatibility issue (#26494)

This commit is contained in:
Simon Mo 2022-07-14 15:29:14 -07:00 committed by GitHub
parent 469ec195be
commit ef1d5c9a97
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -93,4 +93,6 @@ async def pandas_read_json(raw_request: Request):
import pandas as pd
raw_json = await raw_request.body()
if isinstance(raw_json, bytes):
raw_json = raw_json.decode("utf-8")
return pd.read_json(raw_json, **raw_request.query_params)