publish_data()
Upload a DataFrame (as CSV, Parquet, or JSON) or a data file.
With compress, the file is gzipped and .gz is added to dest.
Usage
publish_data(
data: pd.DataFrame | str | Path,
dest: str,
format: str = 'csv',
connection: str | None = None,
compress: bool = False,
include_private: bool = False,
*,
allow_private: bool | None = None,
) -> str
Arguments
| Name | Type | Default | Description |
|---|---|---|---|
| data required | pd.DataFrame | str | Path |
A DataFrame to write in |
|
| dest required | str |
The object's path in the bucket, including any extension. |
|
| format | str | 'csv' |
How a DataFrame is written. One of "csv", "parquet", or "json" (records). Default: "csv". It is checked for files too, but does not change them. |
| connection | str | None | None |
A storage bucket name from the settings. Default: the project's default bucket, then one marked |
| compress | bool | False |
Gzip the file before uploading. |
| include_private | bool | False |
Upload files with "private" in their path without asking. Only a person who has reviewed the files should set this. |
| allow_private | bool | None | None |
Deprecated name for |
Value
The public URL.
Raises
FrameworkError: Whenformatis not allowed, the file is missing or has "private" in its path and is not confirmed, no bucket is configured, or the upload fails.