def _execute_query(self, query, get_column_names=False, commit=False):
    try:
        connection = pyodbc.connect(self._connection_string)
        cursor = connection.cursor()
        cursor.execute(query)
        logger.info(f"Executed '{query}' on {self} (Azure).")
        if commit:
            cursor.commit()
        else:
            rows = cursor.fetchall()
            if get_column_names:
                return (rows, [col[0] for col in cursor.description])
            else:
                return rows
    except Exception as error:
        logger.error(f"Error while executing '{query}' on {self} (Azure): {error}")
def _execute_query(self, query, get_column_names=False, commit=False):
    try:
        connection = pyodbc.connect(self._connection_string)
        cursor = connection.cursor()
        cursor.execute(query)
        logger.info(f"Executed '{query}' on {self} (Azure).")
        if commit:
            cursor.commit()
        else:
            rows = cursor.fetchall()
            if get_column_names:
                return (rows, [col[0] for col in cursor.description])
            else:
                return rows
    except Exception as error:
        logger.error(f"Error while executing '{query}' on {self} (Azure): {error}")