def get_take_result(): data = [] schema = None while len(data) < n: url = '{0}/data?offset={2}&count={1}'.format(frame.uri,n + len(data), offset + len(data)) result = executor.query(url) if not schema: schema = result.schema if len(result.data) == 0: break data.extend(result.data) return TakeResult(data, schema)