Skip to content

Commit

Permalink
fix: wrong genereated type hints
Browse files Browse the repository at this point in the history
  • Loading branch information
yon-mg committed Jan 29, 2021
1 parent 48253d3 commit 86e2c43
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,11 @@ class {{ method.name }}Pager:
yield self._response

{% if method.paged_result_field.map %}
def __iter__(self) -> Iterable[Tuple[str, {{ method.paged_result_field.ident | replace('Sequence[', '') | replace(']', '') }}]]:
def __iter__(self) -> Iterable[Tuple[str, {{ method.paged_result_field.type.fields.get('value').ident }}]]:
for page in self.pages:
yield from page.{{ method.paged_result_field.name}}.items()

def get(self, key: str) -> {{ method.paged_result_field.ident | replace('Sequence', 'Optional') }}:
def get(self, key: str) -> Optional[{{ method.paged_result_field.type.fields.get('value').ident }}]:
return self._response.items.get(key)
{% else %}
def __iter__(self) -> {{ method.paged_result_field.ident | replace('Sequence', 'Iterable') }}:
Expand Down

0 comments on commit 86e2c43

Please sign in to comment.