write_resource_data

write_resource_data(
    data: pl.DataFrame,
    resource_properties: ResourceProperties,
    package_path: Path | None = None,
)

Check and write the resource data into a file.

This function takes the data obtained after using join_resource_batches(), checks it against the resource_properties, and then writes the data to the resources data.parquet file . The Parquet file is saved based on the path found in ResourceProperties.path and is always overwritten. Before writing, this function does a check against the resource_properties to ensure that the data is correctly structured and tidy.

Parameters

data : pl.DataFrame

A DataFrame object with the resources data from the files in its batch/ folder.

resource_properties : ResourceProperties

The ResourceProperties object that contains the properties of the resource you want to create the Parquet file for.

package_path : Path | None = None

The path to the data package root folder (where datapackage.json is located). Defaults to the current working directory.

Returns

Path

The path of the created Parquet file.