Open doctorpangloss opened 6 years ago
Hi,
There is some plan to do better support to IDE autocomplete/IntelliSense/lints with those clients? E.g. @_gapic.add_methods on the clients makes this on vscode:
from google.cloud import pubsub_v1
client = pubsub_v1.SubscriberClient()
client.subscription_path(project_id, sub_id) < (1)
#(1) Instance of 'SubscriberClient' has no 'subscription_path' member
This is still an issue. Any of the methods dynamically added to ImageAnnotatorClient
by the add_single_feature_methods
decorator throw errors in pylint when used:
3 from google.cloud import vision
4
...
11
12 image = vision.Image(content=content)
13
>> 14 response = client.label_detection(image=image)
(env) [dcressman ~/projects/vision-api-test] pylint test.py
************* Module test
test.py:1:0: C0114: Missing module docstring (missing-module-docstring)
test.py:15:11: E1101: Instance of 'ImageAnnotatorClient' has no 'label_detection' member (no-member)
------------------------------------------------------------------
Your code has been rated at 5.38/10 (previous run: 5.00/10, +0.38)
If this is too difficult/not worth it to fix, can we at least try to call it out explicitly somewhere that pylint will not work out of the box? I figure that may save a lot of people some time.
I'm going to transfer this issue to google-cloud-python
as we're planning to move the code for google-cloud-vision
there in the next 1-2 weeks
https://github.com/GoogleCloudPlatform/google-cloud-python/blob/c2a7bffb11425d9c5e98425f8282866a7c7fd634/vision/google/cloud/vision_helpers/decorators.py#L18
Do you think you could commit a valid, simple set of methods that will appear in IDE autocompletes like PyCharm?
It would greatly improve usability of your cloud APIs.
The test is pretty simple:
virtualenv
withgoogle-vision-api
(for example) installed.ImageAnnotatorClient
object, for example.Maybe the equivalent of https://github.com/jbasko/autoboto ?