[Feature] Remove Python 3.9 (#7235)

* remove python 3.9 support and code

* black

* more cli lint

* more linting

* more lint

* fix for tests

* docstring grammar police

* add lock to to build function to avoid async import race conditions

* grammar police

* lots more linting

* relock
This commit is contained in:
Danglewood
2025-10-10 16:16:16 -07:00
committed by GitHub
parent 797b6b7445
commit 9f0d592839
1152 changed files with 76711 additions and 1023236 deletions

View File

@@ -5,7 +5,7 @@
from datetime import (
datetime,
)
from typing import Any, Literal, Optional
from typing import Any, Literal
from openbb_core.app.model.abstract.error import OpenBBError
from openbb_core.provider.abstract.fetcher import Fetcher
@@ -82,7 +82,7 @@ class CftcCotFetcher(Fetcher[CftcCotQueryParams, list[CftcCotData]]):
@staticmethod
async def aextract_data(
query: CftcCotQueryParams,
credentials: Optional[dict[str, str]],
credentials: dict[str, str] | None,
**kwargs: Any,
) -> list[dict]:
"""Extract the data from the CFTC API."""

View File

@@ -2,7 +2,7 @@
# pylint: disable=unused-argument
from typing import Any, Dict, List, Optional
from typing import Any
from openbb_core.provider.abstract.fetcher import Fetcher
from openbb_core.provider.standard_models.cot_search import (
@@ -29,25 +29,25 @@ class CftcCotSearchData(CotSearchData):
"subcategory": "commodity_subgroup_name",
}
commodity: Optional[str] = Field(default=None, description="Name of the commodity.")
commodity: str | None = Field(default=None, description="Name of the commodity.")
class CftcCotSearchFetcher(Fetcher[CftcCotSearchQueryParams, List[CftcCotSearchData]]):
class CftcCotSearchFetcher(Fetcher[CftcCotSearchQueryParams, list[CftcCotSearchData]]):
"""CFTC COT Search Fetcher."""
require_credentials = False
@staticmethod
def transform_query(params: Dict[str, Any]) -> CftcCotSearchQueryParams:
def transform_query(params: dict[str, Any]) -> CftcCotSearchQueryParams:
"""Transform the query params."""
return CftcCotSearchQueryParams(**params)
@staticmethod
def extract_data(
query: CftcCotSearchQueryParams,
credentials: Optional[Dict[str, str]],
credentials: dict[str, str] | None,
**kwargs: Any,
) -> List[Dict]:
) -> list[dict]:
"""Search a curated list of CFTC Commitment of Traders Reports."""
# pylint: disable=import-outside-toplevel
from importlib.resources import files # noqa
@@ -83,8 +83,8 @@ class CftcCotSearchFetcher(Fetcher[CftcCotSearchQueryParams, List[CftcCotSearchD
@staticmethod
def transform_data(
query: CotSearchQueryParams,
data: List[Dict],
data: list[dict],
**kwargs: Any,
) -> List[CftcCotSearchData]:
) -> list[CftcCotSearchData]:
"""Transform the data."""
return [CftcCotSearchData.model_validate(d) for d in data]