def read_latest_record_root_timestamp_in_ms(
        self, object_name: str, run_name: str
    ) -> Optional[int]:
        """
        Retrieve the timestamp of the latest record_root from the event table.

        Args:
            object_name: The name of the managing object.
            run_name: The unique name of the run.

        Returns:
            The timestamp of the latest record_root, or None if no records are found.
        """
        query = f"""
            SELECT
                MAX(TIMESTAMP) AS LATEST_TIMESTAMP
            FROM
                table(snowflake.local.GET_AI_OBSERVABILITY_EVENTS(
                    ?,
                    ?,
                    ?,
                    'EXTERNAL AGENT'
                ))
            WHERE
                RECORD_ATTRIBUTES:"snow.ai.observability.run.name" = ? AND
                RECORD_ATTRIBUTES:"{SpanAttributes.SPAN_TYPE}" = '{SpanAttributes.SpanType.RECORD_ROOT}';
        """

        try:
            result_df = self.session.sql(
                query,
                params=[
                    clean_up_snowflake_identifier(
                        self.session.get_current_database()
                    ),
                    clean_up_snowflake_identifier(
                        self.session.get_current_schema()
                    ),
                    object_name,
                    run_name,
                ],
            ).to_pandas()

            if "LATEST_TIMESTAMP" in result_df.columns and not result_df.empty:
                latest_timestamp = result_df["LATEST_TIMESTAMP"].iloc[0]

                return (
                    int(pd.Timestamp(latest_timestamp).timestamp() * 1000)
                    if latest_timestamp is not None
                    and not pd.isna(latest_timestamp)
                    else None
                )
            return None
        except Exception as e:
            logger.exception(
                f"Error encountered during reading latest record_root timestamp from event table: {e}."
            )
            raise

        Retrieve the timestamp of the latest record_root from the event table.

        Args:
            object_name: The name of the managing object.
            run_name: The unique name of the run.

        Returns:
            The timestamp of the latest record_root, or None if no records are found.
        
src/connectors/snowflake/trulens/connectors/snowflake/dao/run.py