-
Notifications
You must be signed in to change notification settings - Fork 8
fix: use-server-side-cursor is not working #746
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ | |
import concurrent | ||
from typing import TYPE_CHECKING, AsyncIterator, Iterator, Optional, Union | ||
|
||
from application_sdk.constants import USE_SERVER_SIDE_CURSOR | ||
from application_sdk.inputs import Input | ||
from application_sdk.observability.logger_adaptor import get_logger | ||
|
||
|
@@ -120,6 +121,8 @@ def _execute_query(self) -> Union["pd.DataFrame", Iterator["pd.DataFrame"]]: | |
or iterator of DataFrames if chunked. | ||
""" | ||
with self.engine.connect() as conn: | ||
if USE_SERVER_SIDE_CURSOR: | ||
conn = conn.execution_options(yield_per=100000) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Bug: Server-Side Cursor Inconsistency and Yield Per IssueServer-side cursor configuration is only applied in |
||
return self._execute_pandas_query(conn) | ||
|
||
async def get_batched_dataframe( | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The magic number 100000 for yield_per should be extracted to a named constant or made configurable. This hardcoded value makes it difficult to tune performance for different use cases.
Copilot uses AI. Check for mistakes.