chore: avoid implicit optional in type annotations of method (#8727)

This commit is contained in:
Bowen Liang 2024-10-09 14:36:43 +08:00 • committed by GitHub
commit 240b66d737
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
37 changed files with 91 additions and 71 deletions

View file

@ -189,7 +189,7 @@ def compact_generate_response(response: Union[dict, RateLimitGenerator]) -> Resp
class TokenManager:
@classmethod
def generate_token(cls, account: Account, token_type: str, additional_data: dict = None) -> str:
def generate_token(cls, account: Account, token_type: str, additional_data: Optional[dict] = None) -> str:
old_token = cls._get_current_token_for_account(account.id, token_type)
if old_token:
if isinstance(old_token, bytes):