I want to store processed data in pandas dataframe to azure blobs in parquet file format. But before uploading to blobs, I have to store it as parquet file in local disk and then upload. I want to write pyarrow.table into pyarrow.parquet.NativeFile and upload it directly. Can anyone help me with this. Below code is working fine:
import pyarrow as pa
import pyarrow.parquet as pq
battery_pq = pd.read_csv('test.csv')
######## SOme Data Processing
battery_pq = pa.Table.from_pandas(battery_pq)
pq.write_table(battery_pq,'example.parquet')
block_blob_service.create_blob_from_path(container_name,'example.parquet','example.parquet')
Need to create the file in memory(I/O file type object) and then upload it to blob.