def _convert_timestamp(ts: Any) -> Union[int, float]:
    """Convert various timestamp formats to Unix timestamp in seconds.

    Args:
        ts: Timestamp in any supported format (int, float, str, pd.Timestamp)

    Returns:
        Unix timestamp in seconds, or 0 if conversion fails
    """
    if pd.isna(ts):
        return 0
    elif isinstance(ts, (int, float)):
        return int(ts)
    elif isinstance(ts, str):
        return int(pd.Timestamp(ts).timestamp())
    elif isinstance(ts, pd.Timestamp):
        return int(ts.timestamp())
    else:
        return 0
Convert various timestamp formats to Unix timestamp in seconds.

    Args:
        ts: Timestamp in any supported format (int, float, str, pd.Timestamp)

    Returns:
        Unix timestamp in seconds, or 0 if conversion fails
    
src/dashboard/trulens/dashboard/utils/dashboard_utils.py