-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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 get_hosted_table_names in Python client #2551
Fix get_hosted_table_names in Python client #2551
Conversation
913c577
to
f4a8af0
Compare
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.
Thanks for the PR!
Good catch! Can you add a test please?
It was returning None. It now returns a future which resolves to the list of hosted table names.
f4a8af0
to
57653ba
Compare
@@ -64,6 +65,14 @@ async def websocket_client(self): | |||
""" | |||
return await websocket(CLIENT, "/websocket") | |||
|
|||
@asynccontextmanager | |||
async def managed_websocket_client(self): |
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.
I wrote my test first in the style of the others. But when I undid the fix to confirm that would turn my test red, it also made the test hang: when the test is red, await get_hosted_table_names()
throws, which exits the test before the client.terminate()
call.
So I wrote a tiny async context manager to handle cleaning up the client in that case.
The other tests in this file would also hang if they broke. I can rewrite the other tests in this style if you want
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.
It was so easy I went ahead and made the change and split it out into a separate commit. Let me know if you'd like any changes
Added a test to the starlette integration tests |
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.
Thanks for the PR! Looks good!
It was returning None. It now returns a future which resolves to the list of hosted table names.