def METHOD_NAME(ref_path):
    if ref_path is None:
        logging.debug("No table reference, skipping partition key.")
        return
    try:
        reference_metadata = Metadata.from_file(ref_path / METADATA_FILE)
    except Exception as metadata_exception:
        logging.warning(f"Unable to get reference metadata: {metadata_exception}")
        return
    bigquery_metadata = reference_metadata.bigquery
    if bigquery_metadata is None:
        logging.warning(
            f"No bigquery metadata at {ref_path}, unable to get partition key."
        )
        return
    partition_metadata = bigquery_metadata.time_partitioning
    if partition_metadata is None:
        logging.warning(
            f"No partition metadata at {ref_path}, unable to get partition key."
        )
        return
    return partition_metadata.field