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 get_hosted_table_names in Python client #2551

Merged
merged 2 commits into from
Mar 12, 2024

Conversation

tomjakubowski
Copy link
Contributor

@tomjakubowski tomjakubowski commented Mar 2, 2024

It was returning None. It now returns a future which resolves to the list of hosted table names.

@tomjakubowski tomjakubowski force-pushed the bugfix/py_get_hosted_table_names branch from 913c577 to f4a8af0 Compare March 2, 2024 04:14
Copy link
Member

@texodus texodus left a 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.
@tomjakubowski tomjakubowski force-pushed the bugfix/py_get_hosted_table_names branch from f4a8af0 to 57653ba Compare March 4, 2024 23:19
@@ -64,6 +65,14 @@ async def websocket_client(self):
"""
return await websocket(CLIENT, "/websocket")

@asynccontextmanager
async def managed_websocket_client(self):
Copy link
Contributor Author

@tomjakubowski tomjakubowski Mar 4, 2024

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

Copy link
Contributor Author

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

@tomjakubowski
Copy link
Contributor Author

Added a test to the starlette integration tests

Copy link
Member

@texodus texodus left a 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!

@texodus texodus added the bug Concrete, reproducible bugs label Mar 12, 2024
@texodus texodus merged commit d9fa027 into finos:master Mar 12, 2024
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Concrete, reproducible bugs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants