mirror of
https://github.com/OpenBB-finance/OpenBB.git
synced 2026-10-27 04:31:13 +00:00
Other mypy fixes
This commit is contained in:
2
.pre-commit-config.yaml
vendored
2
.pre-commit-config.yaml
vendored
@@ -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
|
||||
|
||||
@@ -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.")
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user