def _update_table_bq_description()

in src/package/dataplexutils/metadata/wizard.py [0:0]


    def _update_table_bq_description(self, table_fqn, description):
        """Updates the description of a BigQuery table.

        Args:
            table_fqn (str): The fully qualified name of the table
                (e.g., 'project.dataset.table')
            description (str): The new description to set

        Raises:
            Exception: If there is an error updating the description
        """
        try:
            table = self._cloud_clients[constants["CLIENTS"]["BIGQUERY"]].get_table(
                table_fqn
            )
                # Start Generation Here
            if self._client_options._add_ai_warning==True and table.description is not None:
                ai_warning = constants['OUTPUT_CLAUSES']['AI_WARNING']
                if ai_warning in table.description:
                    index = table.description.index(ai_warning)
                    table.description = table.description[:index] + description
                else:
                    table.description += f"\n{description}"
            else:
                table.description = f"{description}"
            #table.description = description
            logger.info(f"Updating table {table_fqn} with description: {description}")
            _ = self._cloud_clients[constants["CLIENTS"]["BIGQUERY"]].update_table(
                table, ["description"]
            )
        except Exception as e:
            logger.error(f"Exception: {e}.")
            raise e