-
Notifications
You must be signed in to change notification settings - Fork 46
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
kr8s.api.get returns async APIObject, would expect sync objects #555
Comments
I'm not able to reproduce this one. >>> import kr8s
>>> api = kr8s.api()
>>> pods = list(api.get(kr8s.objects.Pod))
>>> type(pods[0])
<class 'kr8s.objects.Pod'>
>>> pods[0]._asyncio
False
>>> type(pods[0].get)
<class 'method'> |
Also tried with the same kwargs to make sure that wasn't the problem, but can't reproduce with that either. >>> pods = list(api.get(kr8s.objects.Pod, label_selector={'run': 'foo'}, namespace="default"))
>>> type(pods[0])
<class 'kr8s.objects.Pod'>
>>> pods[0]._asyncio
False
>>> type(pods[0].get)
<class 'method'> |
@jacobtomlinson pylance (pyright) is saying it: |
It might be the correct class, but static type checkers are not recognizing it since I guess you made it dynamic. The typehint says it returns an APIObject generator, which only has the async methods. |
Ah I see, it doesn't actually return that type, but it hints that it does. Fixed in #556. |
Which project are you requesting an enhancement for?
kr8s
What do you need?
Doing get on the api returns a generator of APIObjects but this class doesn't have the sync methods.
The text was updated successfully, but these errors were encountered: