def is_glossary_empty()

in dataplex-quickstart-labs/00-resources/scripts/python/business-glossary-import/bg_import/glossary.py [0:0]


  def is_glossary_empty(self) -> bool:
    """Verify if targeted glossary is empty."""

    has_categories = bool(self._category_cache)
    has_terms = bool(self._term_cache)
    if not has_categories and not has_terms:
      logger.info(
          f'Glossary with ID: {self._config.glossary_id} does not have any'
          ' categories nor terms.'
      )
      return True

    if has_categories:
      logger.info(
          f'Glossary with ID: {self._config.glossary_id} already has some'
          ' categories.'
      )

    if has_terms:
      logger.info(
          f'Glossary with ID: {self._config.glossary_id} already has some'
          ' terms.'
      )
    return False