mirror of
https://github.com/OpenBB-finance/OpenBB.git
synced 2026-11-13 12:51:49 +00:00
[Bugfix] Uncover cmd len warn (#6536)
* show warnings * better error msg * mypy ignore --------- Co-authored-by: Danglewood <85772166+deeleeramone@users.noreply.github.com> Co-authored-by: Igor Radovanovic <74266147+IgorWounds@users.noreply.github.com> Co-authored-by: James Maslek <jmaslek11@gmail.com>
This commit is contained in:
@@ -79,8 +79,8 @@ class MenuText:
|
||||
self.warnings.append(
|
||||
{
|
||||
"warning": "Command name too long",
|
||||
"command": name,
|
||||
"trimmed_command": new_name,
|
||||
"actual command": f"`{name}`",
|
||||
"displayed command": f"`{new_name}`",
|
||||
}
|
||||
)
|
||||
name = new_name
|
||||
|
||||
@@ -379,9 +379,7 @@ class PlatformController(BaseController):
|
||||
|
||||
session.console.print(text=mt.menu_text, menu=self.PATH)
|
||||
|
||||
settings = session.settings
|
||||
dev_mode = settings.DEBUG_MODE or settings.TEST_MODE
|
||||
if mt.warnings and dev_mode:
|
||||
if mt.warnings:
|
||||
session.console.print("")
|
||||
for w in mt.warnings:
|
||||
w_str = str(w).replace("{", "").replace("}", "").replace("'", "")
|
||||
|
||||
@@ -16,7 +16,7 @@ class ROUTER_derivatives(Container):
|
||||
@property
|
||||
def futures(self):
|
||||
# pylint: disable=import-outside-toplevel
|
||||
from . import derivatives_futures
|
||||
from . import derivatives_futures # type: ignore[attr-defined]
|
||||
|
||||
return derivatives_futures.ROUTER_derivatives_futures(
|
||||
command_runner=self._command_runner
|
||||
|
||||
@@ -2220,7 +2220,7 @@ class ROUTER_economy(Container):
|
||||
@property
|
||||
def survey(self):
|
||||
# pylint: disable=import-outside-toplevel
|
||||
from . import economy_survey
|
||||
from . import economy_survey # type: ignore[attr-defined]
|
||||
|
||||
return economy_survey.ROUTER_economy_survey(command_runner=self._command_runner)
|
||||
|
||||
|
||||
@@ -306,6 +306,6 @@ class ROUTER_index(Container):
|
||||
@property
|
||||
def price(self):
|
||||
# pylint: disable=import-outside-toplevel
|
||||
from . import index_price
|
||||
from . import index_price # type: ignore[attr-defined]
|
||||
|
||||
return index_price.ROUTER_index_price(command_runner=self._command_runner)
|
||||
|
||||
@@ -15,6 +15,6 @@ class ROUTER_regulators(Container):
|
||||
@property
|
||||
def sec(self):
|
||||
# pylint: disable=import-outside-toplevel
|
||||
from . import regulators_sec
|
||||
from . import regulators_sec # type: ignore[attr-defined]
|
||||
|
||||
return regulators_sec.ROUTER_regulators_sec(command_runner=self._command_runner)
|
||||
|
||||
@@ -130,7 +130,9 @@ class OECDHousePriceIndexFetcher(
|
||||
url.replace(".M.RHPI.", ".Q.RHPI."), headers=headers
|
||||
)
|
||||
if response.status_code != 200:
|
||||
raise Exception(f"Error with the OECD request: {response.status_code}")
|
||||
raise OpenBBError(
|
||||
f"Error with the OECD request (HTTP {response.status_code}): `{response.text}`"
|
||||
)
|
||||
df = read_csv(StringIO(response.text)).get(
|
||||
["REF_AREA", "TIME_PERIOD", "OBS_VALUE"]
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user