From 2c14e26acfb85152bd556450aeb48072b4d9d19f Mon Sep 17 00:00:00 2001 From: Danglewood <85772166+deeleeramone@users.noreply.github.com> Date: Sun, 5 Jul 2026 14:47:32 -0700 Subject: [PATCH] fixes for ty --- cli/openbb_cli/config/loader.py | 2 +- .../openbb_econometrics/econometrics_views.py | 5 +++-- .../extensions/technical/openbb_technical/helpers.py | 2 +- .../technical/openbb_technical/multi/compose.py | 5 +---- .../technical/openbb_technical/technical_views.py | 10 ++++++---- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/cli/openbb_cli/config/loader.py b/cli/openbb_cli/config/loader.py index 3861089e6cc..cad13003fa8 100644 --- a/cli/openbb_cli/config/loader.py +++ b/cli/openbb_cli/config/loader.py @@ -10,7 +10,7 @@ from typing import Any if sys.version_info >= (3, 11): # pragma: no cover import tomllib else: # pragma: no cover - import tomli as tomllib # ty: ignore[unresolved-import] + import tomli as tomllib DEFAULT_CONFIG_NAMES: tuple[str, ...] = ("openbb.toml", ".openbb.toml") PYPROJECT_NAME = "pyproject.toml" diff --git a/openbb_platform/extensions/econometrics/openbb_econometrics/econometrics_views.py b/openbb_platform/extensions/econometrics/openbb_econometrics/econometrics_views.py index 6e1618d10b0..be32716cd09 100644 --- a/openbb_platform/extensions/econometrics/openbb_econometrics/econometrics_views.py +++ b/openbb_platform/extensions/econometrics/openbb_econometrics/econometrics_views.py @@ -1,6 +1,6 @@ """Views for the Econometrics Extension.""" -from typing import TYPE_CHECKING, Any +from typing import TYPE_CHECKING, Any, cast if TYPE_CHECKING: from openbb_charting.core.openbb_figure import ( @@ -35,4 +35,5 @@ class EconometricsViews: """ from openbb_charting.charts.correlation_matrix import correlation_matrix - return correlation_matrix(**kwargs) + figure, content = correlation_matrix(**kwargs) + return cast("OpenBBFigure", figure), content diff --git a/openbb_platform/extensions/technical/openbb_technical/helpers.py b/openbb_platform/extensions/technical/openbb_technical/helpers.py index 848281c9179..857381875ac 100644 --- a/openbb_platform/extensions/technical/openbb_technical/helpers.py +++ b/openbb_platform/extensions/technical/openbb_technical/helpers.py @@ -453,7 +453,7 @@ def calculate_cones( df_ = [realized, min_, bottom_q, median, top_q, max_] df_windows = allowed_windows - df = DataFrame(df_, columns=df_windows) # ty: ignore[invalid-argument-type] + df = DataFrame(df_, columns=df_windows) df = df.rename( index={ 0: "realized", diff --git a/openbb_platform/extensions/technical/openbb_technical/multi/compose.py b/openbb_platform/extensions/technical/openbb_technical/multi/compose.py index 6581f4c6a9a..ec0ca1c40e8 100644 --- a/openbb_platform/extensions/technical/openbb_technical/multi/compose.py +++ b/openbb_platform/extensions/technical/openbb_technical/multi/compose.py @@ -217,10 +217,7 @@ def multi(params: MultiQueryParams) -> OBBject[list[MultiResultRow]]: bucket[f"{request.indicator}.{col}"] = value ordered_keys = sorted(merged.keys(), key=str) - out_rows = [ - MultiResultRow(date=key, values=merged[key]) # ty: ignore[invalid-argument-type] - for key in ordered_keys - ] + out_rows = [MultiResultRow(date=key, values=merged[key]) for key in ordered_keys] return OBBject(results=out_rows) diff --git a/openbb_platform/extensions/technical/openbb_technical/technical_views.py b/openbb_platform/extensions/technical/openbb_technical/technical_views.py index eff78dac0e7..a37138469e4 100644 --- a/openbb_platform/extensions/technical/openbb_technical/technical_views.py +++ b/openbb_platform/extensions/technical/openbb_technical/technical_views.py @@ -1,6 +1,6 @@ """Views for the technical Extension.""" -from typing import TYPE_CHECKING, Any +from typing import TYPE_CHECKING, Any, Literal, cast if TYPE_CHECKING: from openbb_charting.core.openbb_figure import ( @@ -349,9 +349,11 @@ class TechnicalViews: show_tails = kwargs.get("show_tails") show_tails = True if show_tails is None else show_tails tail_periods = int(kwargs["tail_periods"]) if "tail_periods" in kwargs else 16 - tail_interval = ( - str(kwargs.get("tail_interval")) if "tail_interval" in kwargs else "week" - ) + tail_interval_input = kwargs.get("tail_interval", "week") + if tail_interval_input not in ("day", "week", "month"): + tail_interval: Literal["day", "week", "month"] = "week" + else: + tail_interval = cast(Literal["day", "week", "month"], tail_interval_input) date = kwargs.get("date") if "date" in kwargs else None show_tails = False if date is not None else show_tails if ratios_df.empty or momentum_df.empty: