def get_diligence_historical_statistics_details(self, company_name, company_guid):
        """Fetch and process diligence historical statistics for a specific company.

        Args:
            company_name (str): The name of the company.
            company_guid (str): The GUID of the company.

        Raises:
            BitSightException: If an error occurs during the process.
        """
        try:
            checkpoint_data_to_post = []
            post_data = []
            checkpoint_key = "{}".format(company_guid)
            checkpoint_data = self.checkpoint_obj.get_last_data(
                self.diligence_historical_statistics_state, table_name=DILIGENCE_HISTORICAL_STATISTICS_TABLE
            )
            last_data = self.checkpoint_obj.get_endpoint_last_data(
                checkpoint_data, "diligence_historical-statistics", company_guid
            )
            url = self.base_url + self.diligence_historical_statistics_path.format(
                company_guid
            )
            response = self.get_bitsight_data(url)
            if not response:
                return
            if response.get("results"):
                results_data = response.get("results")
                for data in results_data:
                    if data.get("counts"):
                        count_data = data.get("counts")
                        for count_category in count_data:
                            result_hash = self.get_results_hash(
                                count_category, data, company_name
                            )
                            if (
                                last_data and result_hash not in last_data
                            ) or not last_data:
                                count_category["grade"] = data["grade"]
                                count_category["date"] = data["date"]
                                post_data.append(count_category)
                                checkpoint_data_to_post.append(result_hash)
                            else:
                                checkpoint_data_to_post.append(result_hash)
                self.send_data_to_sentinel(
                    post_data,
                    DILIGENCE_HISTORICAL_STATISTICS_TABLE,
                    company_name,
                    "diligence historical statistics",
                )
            self.checkpoint_obj.save_checkpoint(
                self.diligence_historical_statistics_state,
                checkpoint_data,
                "diligence_historical-statistics",
                "{}_{}".format(DILIGENCE_HISTORICAL_STATISTICS_TABLE, "Checkpoint"),
                checkpoint_key,
                checkpoint_data_to_post,
            )
        except BitSightException:
            raise BitSightException()
        except Exception as err:
            applogger.exception(
                "{} {} Error in getting diligence historical statistics: {}".format(
                    self.logs_starts_with, ALERT_GRAPH_STATISTICS_FUNC_NAME, err
                )
            )
            raise BitSightException()
Fetch and process diligence historical statistics for a specific company.

        Args:
            company_name (str): The name of the company.
            company_guid (str): The GUID of the company.

        Raises:
            BitSightException: If an error occurs during the process.
        
Solutions/BitSight/Data Connectors/BitSightDataConnector/AlertsGraphStatisticsDetails/bitsight_statistics.py