MCPcopy
hub / github.com/pandas-dev/pandas / parquetfastparquet_responder

Function parquetfastparquet_responder

pandas/tests/io/test_http_headers.py:58–74  ·  view source on GitHub ↗
(df)

Source from the content-addressed store, hash-verified

56
57
58def parquetfastparquet_responder(df):
59 # the fastparquet engine doesn't like to write to a buffer
60 # it can do it via the open_with function being set appropriately
61 # however it automatically calls the close method and wipes the buffer
62 # so just overwrite that attribute on this instance to not do that
63
64 # protected by an importorskip in the respective test
65 import fsspec
66
67 df.to_parquet(
68 "memory://fastparquet_user_agent.parquet",
69 index=False,
70 engine="fastparquet",
71 compression=None,
72 )
73 with fsspec.open("memory://fastparquet_user_agent.parquet", "rb") as f:
74 return f.read()
75
76
77def pickle_respnder(df):

Callers

nothing calls this directly

Calls 3

to_parquetMethod · 0.80
openMethod · 0.45
readMethod · 0.45

Tested by

no test coverage detected