Skip to content
Snippets Groups Projects
Commit b8e0c80e authored by Luc Yriarte's avatar Luc Yriarte
Browse files

Remove csv serialization support

parent 8bed4588
No related branches found
No related tags found
1 merge request!323Remove csv support from bulk APIs
......@@ -152,12 +152,6 @@ class DataframeSerializerAsync:
func = partial(DataframeSerializerSync.to_json, df, orient, *args, **kwargs)
return await asyncio.get_event_loop().run_in_executor(self.executor, func)
@with_trace("CSV bulk serialization")
async def to_csv(self, df: pd.DataFrame, *args, **kwargs) -> Optional[str]:
df = df.fillna("NaN")
func = partial(df.to_csv, *args, **kwargs)
return await asyncio.get_event_loop().run_in_executor(self.executor, func)
@with_trace("Parquet bulk deserialization")
async def read_parquet(self, data) -> pd.DataFrame:
return await asyncio.get_event_loop().run_in_executor(
......
......@@ -57,8 +57,6 @@ class MimeTypes:
JSON = MimeType(type="application/json", extension=".json")
CSV = MimeType(type="text/csv", extension=".csv")
MSGPACK = MimeType(
type="application/x-msgpack",
extension=".msgpack",
......
......@@ -248,10 +248,6 @@ class DataFrameRender:
content = await DataframeSerializerAsync().to_json(pdf, index=True, date_format='iso', orient=orient.value)
return Response(content, media_type=MimeTypes.JSON.type)
if MimeTypes.CSV.type in accept:
content = await DataframeSerializerAsync().to_csv(pdf)
return Response(content, media_type=MimeTypes.CSV.type)
content = await DataframeSerializerAsync().to_parquet(pdf)
return Response(content, media_type=MimeTypes.PARQUET.type)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment