files.parquet.pq_archive
files.parquet.pq_archive(
table_name=None,
schema=None,
data_dir=None,
file_name=None,
archive_dir=None,
)Archive a parquet file by renaming it into an archive subdirectory.
For workflow-oriented examples, see Parquet Utilities Examples and Data management ideas.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| table_name | str | Basename of the parquet file to archive when resolving the source file from schema and data_dir. |
None |
| schema | str | Name of the parquet schema directory used when resolving the source file from table_name. |
None |
| data_dir | str | Root directory of the parquet data repository. If omitted, defaults to DATA_DIR or the current working directory. |
None |
| file_name | str or path - like | Exact parquet file path to archive. If supplied, table_name and schema are ignored. |
None |
| archive_dir | str | Name of the archive directory under the schema directory. Defaults to "archive". |
None |
Returns
| Name | Type | Description |
|---|---|---|
| str or None | Archived file path as a string, or None if no file was archived. |
Examples
>>> pq_archive(table_name="company", schema="comp")
>>> pq_archive(file_name="~/Dropbox/pq_data/comp/company.parquet")