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

Fix return type annotation #1234

Merged
merged 1 commit into from
Jul 8, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions slack_sdk/oauth/token_rotation/async_rotator.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ async def perform_user_token_rotation( # type: ignore
*,
installation: Installation,
minutes_before_expiration: int = 120, # 2 hours by default
) -> Optional[Bot]: # type: ignore
) -> Optional[Installation]:
"""Performs user token rotation if the underlying user token is expired / expiring.

Args:
Expand Down Expand Up @@ -136,7 +136,7 @@ async def perform_user_token_rotation( # type: ignore
refreshed_installation.user_token = refresh_response.get("access_token")
refreshed_installation.user_refresh_token = refresh_response.get("refresh_token")
refreshed_installation.user_token_expires_at = int(time()) + int(refresh_response.get("expires_in"))
return refreshed_installation # type: ignore
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This may be still necessary if the pytype validation fails. In the case, could you revert this change?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems that pytype is happy with this removal. We can keep this as-is,

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pytype validation has passed!
Is not right?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry I meant you don't need to change this!

return refreshed_installation

except SlackApiError as e:
raise SlackTokenRotationError(e)