-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Implement a GAX version of '_PublisherAPI'. #1764
Implement a GAX version of '_PublisherAPI'. #1764
Conversation
|
except ImportError: | ||
_HAVE_GAX = False | ||
else: | ||
_HAVE_GAX = True |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
@tseaver To make the conditional definition comments a bit more clear let me describe what I have in mind (as a parallel to
try:
from gcloud.pubsub._gax import _PublisherAPI
...
_HAVE_GAX = True
except ImportError:
_PublisherAPI = None # or maybe type(None) if you want it to be a class
...
_HAVE_GAX = False Having the conditional skip in |
How do you deal with those errors being triggered by tests in the tox environments where the |
@tseaver You can still |
|
The way you detect it isn't particularly important to me. My feedback is not all-encompassing, just that you don't conditionally define an entire module. |
What is the difference for the user of the library? In this implementaiton, they can import WIthin |
Anything named You could even just have try:
import google.gax
except ImportError:
_HAVE_GAX = False
else:
_HAVE_GAX = True
from gcloud.pubsub._gax_impl import _PublisherAPI I'm just advocating against conditionally defined top-level objects for the same of the code. |
else: | ||
_HAVE_GAX = True | ||
|
||
from google.pubsub.v1.pubsub_pb2 import PubsubMessage |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
The cause stuff looks alright, so the last hangup is the conditionally defined stuff. |
Note: paging methods ('list_topics' and 'list_topic_subscriptions') are only partially implemented, because the GAX API does not permit passing in a page token (it can be coerced into *returning* only a single page of results, and its token, though). See: - googleapis/gax-python#86 - googleapis/gax-python#94
Also, add docstring for private helper function. Addresses: #1764 (comment) #1764 (comment)
I.e., raise 'NotFound' on a miss.
0.14.0 causes google.pubsub.v1 to barf (see: https://github.com/googleapis/googleapis/issues/17).
Addresses: #1764 et ff.
Addresses: #1764 (comment) Drop local 'no-name-in-module' pylint suppression (master now disables it in global config).
@dhermes PTAL |
@tseaver Trying to review the "latest" changes but all the commits are from May 11 and May 12. Does a rebase change a commit date? Which ones are relevant since last review? |
LGTM. Sorry for the delay. |
Note: paging methods (
list_topics
andlist_topic_subscriptions
) are only partially implemented, because the GAX API does not permit passing in a page token (it cam be coerced into returning only a single page of results, and its token, though). See: