Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix StopIteration runtime error from generator for Python > 3.6.x #121

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions ksql/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,14 @@ def ksql(self, ksql_string, stream_properties=None):

def query(self, query_string, encoding="utf-8", chunk_size=128, stream_properties=None, idle_timeout=None, use_http2=None, return_objects=None):
if use_http2:
yield from self.sa.query2(
for result in self.sa.query2(
query_string=query_string,
encoding=encoding,
chunk_size=chunk_size,
stream_properties=stream_properties,
idle_timeout=idle_timeout,
)
):
yield result
else:
results = self.sa.query(
query_string=query_string,
Expand All @@ -63,7 +64,8 @@ def query(self, query_string, encoding="utf-8", chunk_size=128, stream_propertie
idle_timeout=idle_timeout
)

yield from process_query_result(results, return_objects)
for query_result in process_query_result(results, return_objects):
yield query_result

def close_query(self, query_id):
return self.sa.close_query(query_id)
Expand Down