def remove_truncated_data(self, data):
        """Function to remove the truncated data from the checkpoint file.

        Args:
            data (str): data from the checkpoint file.

        Returns:
            list: data after removing the truncated data.
        """
        truncated_log_prefix = "REMOVE TRUNCATED DATA"
        try:
            reversed_data = data[::-1]
            comma_index = reversed_data.find(",")
            updated_data = data[: -comma_index - 1] + "]"
            data = json.loads(updated_data)
            return data
        except json.JSONDecodeError as err:
            applogger.error(
                "{} {}: JSONDecodeError: Unable to loads JSON data from Sentinel table. Error: {}".format(
                    LOGS_STARTS_WITH, truncated_log_prefix, err
                )
            )
            raise BitSightException()
        except Exception as err:
            applogger.error(
                "{} {}: Exception: Unknown error while loads JSON data from Sentinel table. Error: {}".format(
                    LOGS_STARTS_WITH, truncated_log_prefix, err
                )
            )
            raise BitSightException()
Function to remove the truncated data from the checkpoint file.

        Args:
            data (str): data from the checkpoint file.

        Returns:
            list: data after removing the truncated data.
        
Solutions/BitSight/Data Connectors/BitSightDataConnector/SharedCode/utils.py