Skip to content

Commit ea3b99c

Browse files
committed
fix: cast idToken to str to satisfy mypy [no-any-return] on line 83
firebase is an untyped package (type: ignore[import-untyped]), so self._hub_user['idToken'] resolves to Any. Since _get_auth_token() is declared -> str, mypy raised: error: Returning Any from function declared to return 'str' [no-any-return] Fix: wrap with str() cast which is always safe since Firebase idTokens are JWT strings.
1 parent e465487 commit ea3b99c

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/opengradient/client/model_hub.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ def _get_auth_token(self) -> str:
8080
expires_in = int(refreshed.get("expiresIn", 3600))
8181
self._token_expiry = time.time() + expires_in
8282

83-
return self._hub_user["idToken"]
83+
return str(self._hub_user["idToken"]) # cast Any->str for mypy [no-any-return]
8484

8585
def create_model(self, model_name: str, model_desc: str, version: str = "1.00") -> ModelRepository:
8686
"""

0 commit comments

Comments
 (0)