'Fetch the first row and then close the result set unconditionally.
Returns None if no row is present.'

def first(self):

    if (self._metadata is None):
        self._non_result()
    try:
        row = self._fetchone_impl()
    except Exception as e:
        self.connection._handle_dbapi_exception(e, None, None, self.cursor, self.context)
    try:
        if (row is not None):
            return self.process_rows([row])[0]
        else:
            return None
    finally:
        self.close()
