-
Notifications
You must be signed in to change notification settings - Fork 3
feat: add temporary result storage and smoke test options #39
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?
Conversation
peterfoldes
commented
Jun 3, 2025
i'm getting some errors running this sql statement: it fails if i try to use either |
so iiuc this change doesn't provide a way to get access to the results URI from the sdk, correct? but you can opt into behind-the-scenes temp storage. which you would do because it increases the limit on the number of results you can get back? and/or you get more efficient cursoring through the results because sql-session can pull them from its s3 cache based on the execution id? |
another interesting behavior i discovered, when passing boolean values in the execute sql web socket message, they have to be stringified. i.e. this is valid:
but this is not (note no quotes around
|
@@ -209,6 +215,17 @@ def __execute_sql(self, sql: str, handler: Callable[[Any], None]) -> str: | |||
"statement": sql, | |||
} | |||
|
|||
if self.__store: |
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.
having thought about this a bit, imo the sdk should ONLY support presigned urls. because without them the user would have to use the rest api to generate temporary aws credentials, and that endpoint is non-public
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.
Although I see your point, I think for now it's simpler to keep the SDK non-opinionated.
request["store"] = {} | ||
if self.__store.format: | ||
request["store"]["format"] = self.__store.format.value | ||
if self.__store.single: | ||
request["store"]["single"] = str(self.__store.single) | ||
if self.__store.generate_presigned_url: | ||
request["store"]["generate_presigned_url"] = str( | ||
self.__store.generate_presigned_url | ||
) |
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.
If you make Store
a @dataclass
, you can:
- Simplify it a lot in
result_storage.py
- Literally just pass it here:
request["store"] = self.__store
and it'll serialize to JSON correctly.
@@ -209,6 +215,17 @@ def __execute_sql(self, sql: str, handler: Callable[[Any], None]) -> str: | |||
"statement": sql, | |||
} | |||
|
|||
if self.__store: |
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.
Although I see your point, I think for now it's simpler to keep the SDK non-opinionated.