[BugFix] - Fix pylint possibly-used-before-assignment (#6484)

* fix: comply w/ possibly used before assignment

* remove disabe from .pylintrc

* remove reset test

* remove reset test

* fix: update missing keys message
This commit is contained in:
montezdesousa
2024-06-05 16:40:24 +01:00
committed by GitHub
parent e0be8cdacf
commit a52b24c16b
25 changed files with 56 additions and 63 deletions

View File

@@ -18,7 +18,6 @@ from typing import Any, Dict, List, Optional
import pandas as pd
import requests
from openbb import obb
from openbb_cli.config import constants
from openbb_cli.config.constants import (
ASSETS_DIRECTORY,
@@ -48,6 +47,8 @@ from prompt_toolkit.formatted_text import HTML
from prompt_toolkit.styles import Style
from pydantic import BaseModel
from openbb import obb
PLATFORM_ROUTERS = {
d: "menu" if not isinstance(getattr(obb, d), BaseModel) else "command"
for d in dir(obb)
@@ -291,7 +292,7 @@ class CLIController(BaseController):
: session.settings.N_TO_DISPLAY_OBBJECT_REGISTRY
]:
mt.add_raw(
f"[yellow]OBB{key}[/yellow]: {value['command']}",
f"[yellow]OBB{key}[/yellow]: {value['command']}", # type: ignore[index]
left_spacing=True,
)
@@ -769,7 +770,6 @@ def replace_dynamic(match: re.Match, special_arguments: Dict[str, str]) -> str:
str
The new string
"""
cleaned = match[0].replace("{", "").replace("}", "").replace("$", "")
key, default = cleaned.split("=")
dict_value = special_arguments.get(key, default)
@@ -939,7 +939,6 @@ def launch(
debug: bool = False, dev: bool = False, queue: Optional[List[str]] = None
) -> None:
"""Launch CLI."""
if queue:
main(debug, dev, queue, module="")
else: