-
Notifications
You must be signed in to change notification settings - Fork 67
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
mypy type error for pager #991
Comments
This is generated code. Moving to generator component. |
@dpcollins-google ran into the same issue for Pub/Sub (see #970) and opened a bug fix to switch the annotation to The @property
def pages(self) -> Iterator[datacatalog.ListTagsResponse]:
yield self._response
while self._response.next_page_token:
self._request.page_token = self._response.next_page_token
self._response = self._method(self._request, metadata=self._metadata)
yield self._response
def __iter__(self) -> Iterator[tags.Tag]:
for page in self.pages:
yield from page.tags Closing this issue as I believe it has been resolved, but please let me know if you are still seeing issues @tmshn. |
Closing as obsolete |
Thanks for stopping by to let us know something could be better!
PLEASE READ: If you have a support contract with Google, please create an issue in the support console instead of filing on GitHub. This will ensure a timely response.
Please run down the following list and make sure you've tried the usual "quick fixes":
If you are still having issues, please be sure to include as much information as possible:
Environment details
python --version
3.9.1pip --version
21.0.1google-cloud-datacatalog
version:pip show google-cloud-datacatalog
3.2.0Steps to reproduce
DataCatlogClient#list_tags
in for-loopCode example
Error
I suspect this is due to the return type of
ListTagsPager#__iter__
is annotated asIterable
rather thanIterator
, but not sure (according to the Python protocol,Iterable
only offers__iter__
method, whileIterator
offers__next__
).https://github.com/googleapis/python-datacatalog/blob/936800c92a348b8ce438c4b608f17fe6d9f926a1/google/cloud/datacatalog_v1beta1/services/data_catalog/pagers.py#L470
Making sure to follow these steps will guarantee the quickest resolution possible.
Thanks!
The text was updated successfully, but these errors were encountered: