def METHOD_NAME(self):
    try:
        if self._connection is not None:
            self._connection.close()
    except (psycopg2.Error, psycopg2.Warning) as e:
        self.logger.warning(
            _("Error closing connection: {error}").format(
                error=e,
            )
        )
        self.logger.debug('Exception',  exc_info=True)
    finally:
        self._connection = None