def __next__()

in azure-kusto-data/azure/kusto/data/streaming_response.py [0:0]


    def __next__(self) -> Dict[str, Any]:
        if self.done:
            raise StopIteration()

        if not self.started:
            self.reader.read_start_array()
            self.started = True

        token = self.reader.skip_until_token_with_paths((JsonTokenType.START_MAP, "item"), (JsonTokenType.END_ARRAY, ""))
        if token == JsonTokenType.END_ARRAY:
            self.done = True
            raise StopIteration()

        frame_type = self.read_frame_type()
        parsed_frame = self.parse_frame(frame_type)
        is_primary_result = parsed_frame["FrameType"] == FrameType.DataTable and parsed_frame["TableKind"] == WellKnownDataSet.PrimaryResult.value
        if is_primary_result:
            self.started_primary_results = True
        elif self.started_primary_results:
            self.finished_primary_results = True

        return parsed_frame