-
Notifications
You must be signed in to change notification settings - Fork 83
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
Add query_namespaces
#409
Add query_namespaces
#409
Conversation
88be474
to
7941ee8
Compare
7fc2038
to
5da2610
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.
Nice work! Started an internal discussion. LGTM!
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.
Overall this felt easier to review than I thought it would be, nice job organizing things around these specific classes, and how things are handled by the query_namespaces
function itself.
I left a comment about the code added to the generated core.
import time | ||
import random | ||
|
||
def retry_api_call( |
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.
Is this just manually stubbing out retries in the generated code for now? Just curious, also regarding the print statement down there and whether it should be uncommented.
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.
This was just me throwing in something basic to get started. This is used to wrap __call_api, but I need to investigate the tuning of the constants and stuff to get the sleep intervals to sensible levels.
Also re: this being generated code, very soon I will be moving these elsewhere and not generating them, since the ApiClient and a couple other classes don't contain any generated content.
Problem
Sometimes people would like to run a query across multiple namespaces
Solution
Run a query for each namespace in parallel, then merge the results using a heap
TODO
A grpc implementation of this will follow in a separate PR. I have WIP on it, but some mypy type issues were causing me headaches and I'd rather land this stuff first.
Type of Change
Test Plan
Added integration tests