-
Notifications
You must be signed in to change notification settings - Fork 215
Closed
Labels
api: pubsubIssues related to the googleapis/python-pubsub API.Issues related to the googleapis/python-pubsub API.priority: p2Moderately-important priority. Fix may not be included in next release.Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Description
I just tried the fixup script and ran into a few issues.
- It generates this change even though
PublisherClient.publish
does not take the new style parameters:
- publisher_client.publish(topic, bytes(json.dumps(message), 'utf-8'))
+ publisher_client.publish(request = {'topic': topic, 'messages': bytes(json.dumps(message), 'utf-8')})
- It generates this change even though
request
and keyword args are documented to be mutually exclusive:
- response = subscriber.pull(subscription_path, max_messages=NUM_MESSAGES, timeout=TIMEOUT)
+ response = subscriber.pull(
+ request = {'subscription': subscription_path, 'max_messages': NUM_MESSAGES}, timeout=TIMEOUT,
+ )
- all of the generated
request
keyword arguments break pep8 (they should not have spaces around=
)
Stylistically, I find the keyword arguments better to read than all of the inline dicts for the request
syntax. It'd be great if the tool had an option to emit the keyword args version.
Metadata
Metadata
Assignees
Labels
api: pubsubIssues related to the googleapis/python-pubsub API.Issues related to the googleapis/python-pubsub API.priority: p2Moderately-important priority. Fix may not be included in next release.Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.