Skip to content

Read a CSV blob into an R data frame

Reads a CSV file via a storage handler created by [init_storage_handler()(init_storage_handler/) and converts the resulting Python Polars DataFrame to an R data frame.

read_csv_blob_as_df(handler, blob_name, sep = ",", col_classes = NULL, ...)
Argument Description
handler A Python object of class StorageHandler.
blob_name The path/name of the blob/file.
sep Field separator passed to Polars.
col_classes A named character vector of R column classes.
... Additional arguments passed to handler$read_csv_blob().

A data frame.

handler <- init_storage_handler()
df <- read_csv_blob_as_df(
handler = handler,
blob_name = "sample/data.csv",
sep = ";",
col_classes = c(
id = "character",
customer_id = "character",
amount = "numeric",
active = "logical",
created_at = "POSIXct"
)
)