Skip to content
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

Update system test PubSub calls or change PubSub deps #64

Closed
sli2126 opened this issue Sep 16, 2020 · 4 comments
Closed

Update system test PubSub calls or change PubSub deps #64

sli2126 opened this issue Sep 16, 2020 · 4 comments
Assignees
Labels
api: logging Issues related to the googleapis/python-logging API. priority: p2 Moderately-important priority. Fix may not be included in next release.

Comments

@sli2126
Copy link

sli2126 commented Sep 16, 2020

The recent test failures have to do with a PubSub version update.

The broken method calls can be updated according to link, or the dependencies can be change like in python-storage (PR and possibly PR).

@product-auto-label product-auto-label bot added the api: logging Issues related to the googleapis/python-logging API. label Sep 16, 2020
@sli2126
Copy link
Author

sli2126 commented Sep 16, 2020

Looks like it will be fixed in #62

@sli2126 sli2126 closed this as completed Sep 16, 2020
@sli2126
Copy link
Author

sli2126 commented Oct 1, 2020

Looks like tests are still broken, re-opening.

@sli2126 sli2126 reopened this Oct 1, 2020
@yoshi-automation yoshi-automation added triage me I really want to be triaged. 🚨 This issue needs some love. labels Oct 1, 2020
@AlexanderFengFeng
Copy link

AlexanderFengFeng commented Oct 1, 2020

The primary reason that the PubSub version update is breaking tests is that in google-cloud-pubsub<2.0.0, parameters required by the API were positional parameters (like topic_path here) and optional parameters were keyword parameters. Now, following the 2.0.0 release, almost all methods that interact with the backend have a single positional parameter request.

The change is best exemplified like so:

Before:

from google.cloud import pubsub

publisher = pubsub.PublisherClient()

project_path = "projects/{}".format(PROJECT_ID)
topics = publisher.list_topics(project_path)

After:

from google.cloud import pubsub

publisher = pubsub.PublisherClient()

project_path = f"projects/{PROJECT_ID}"
topics = publisher.list_topics(request={"project": project_path})

There are two ways to resolve this:

  1. Change the PubSub dependency to "google-cloud-pubsub < 2.0.0" like @sli2126 mentioned by referencing storage's PR

OR

  1. Change arguments in PubSub calls
  • create_topic: topic_path -> request={"name"=topic_path"}
  • get_iam_policy topic_path -> request={"resource": topic_path}
  • set_iam_policy topic_path, policy -> request={"resource": topic_path, "policy": policy}
  • delete_topic self.topic_path -> request={"topic"=self.topic_path}

@simonz130 simonz130 added the priority: p2 Moderately-important priority. Fix may not be included in next release. label Oct 27, 2020
@yoshi-automation yoshi-automation removed triage me I really want to be triaged. 🚨 This issue needs some love. labels Oct 27, 2020
@daniel-sanche
Copy link
Contributor

This was fixed in #70

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: logging Issues related to the googleapis/python-logging API. priority: p2 Moderately-important priority. Fix may not be included in next release.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants