Other mypy fixes

This commit is contained in:
james
2023-02-16 09:06:31 -05:00
parent 15141122a2
commit a0f3ad125b
4 changed files with 7 additions and 7 deletions

View File

@@ -14,7 +14,7 @@ repos:
hooks:
- id: black
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: 'v0.0.244'
rev: 'v0.0.247'
hooks:
- id: ruff
- repo: https://github.com/codespell-project/codespell

View File

@@ -11,11 +11,11 @@ def get_session(email: str, password: str, token: str, save: bool):
if token:
console.print("Creating session from token.")
session = session_model.create_session_from_token(token, save)
session = session_model.create_session_from_token(token, save) # type: ignore
if not session:
console.print("Creating session from email and password.")
session = session_model.create_session(email, password, save)
session = session_model.create_session(email, password, save) # type: ignore
if not (isinstance(session, dict) and session):
raise Exception("Failed to create session.")

View File

@@ -1,6 +1,6 @@
import json
from enum import Enum
from typing import Optional
from typing import Any, Optional
import matplotlib.pyplot as plt
@@ -25,7 +25,7 @@ class LoginStatus(Enum):
UNAUTHORIZED = "unauthorized"
def create_session(email: str, password: str, save: bool) -> dict:
def create_session(email: str, password: str, save: bool) -> dict[Any, Any]:
"""Create a session.
Parameters
@@ -44,7 +44,7 @@ def create_session(email: str, password: str, save: bool) -> dict:
return session
def create_session_from_token(token: str, save: bool) -> dict:
def create_session_from_token(token: str, save: bool) -> dict[Any, Any]:
"""Create a session from token.
Parameters

View File

@@ -6,9 +6,9 @@ from pathlib import Path
from typing import Any, Dict, Literal, Optional, Union
from docstring_parser import parse
from website.controller_doc_classes import sub_names_full as subnames
from openbb_terminal.sdk_core.trailmap import Trailmap, get_trailmaps
from website.controller_doc_classes import sub_names_full as subnames
website_path = Path(__file__).parent.absolute()