def get_latest_time_value_from_metadata(dashboard_signal, metadata):
    """Get the most recent date with data for the signal."""
    df_for_source = metadata[(metadata.data_source == dashboard_signal.source) & (
        metadata.signal == dashboard_signal.covidcast_signal)]
    return df_for_source["max_time"].max().date()