utils.add_metadata_to_parquet_files
utils.add_metadata_to_parquet_files(**snippet_attrs)Add metadata attributes to all Parquet files in a snippet-level directory.
This function takes snippet attributes and adds them as metadata to all .parquet and .pqt files found in the specified snippet directory. The metadata is useful for tracking provenance, parameters, and other contextual information.
Args: **snippet_attrs (Dict[str, Any]): Keyword arguments containing metadata to add to the Parquet files. Must include: - base_level_dir (str): Base directory path - snippet_level_dir (str): Snippet directory name Additional key-value pairs will be added as metadata attributes.
Returns: None: The function modifies files in place and does not return any values.
Note: The function constructs the full snippet directory path from base_level_dir and snippet_level_dir. Both .parquet and .pqt file extensions are supported. If the directory doesn’t exist, a warning is logged but no error is raised. Each file is processed individually using _update_parquet_metadata.
Example: >>> add_metadata_to_parquet_files( … base_level_dir=‘/data/probe1’, … snippet_level_dir=‘snippet_001’, … pid=‘probe1’, … t_start=100.5, … duration=30.0 … )