You do need to convert the dataframe into a pyarrow.RecordBatch
in memory in this example, as in
def write_to_plasma(...):
...
record_batch = pa.RecordBatch.from_pandas(thing)
...
See docs:
- getting/storing Pandas: my code is almost straight copypasta from https://arrow.apache.org/docs/python/plasma.html#storing-pandas-dataframes-in-plasma
- further Pandas integration: