From e0776b4e55edad61398ccd009d8bcd8313029ee7 Mon Sep 17 00:00:00 2001 From: Igor Radovanovic <74266147+IgorWounds@users.noreply.github.com> Date: Fri, 18 Aug 2023 15:52:29 +0200 Subject: [PATCH] MyPy improvements --- .../fmp/openbb_fmp/models/balance_sheet.py | 2 - .../fmp/openbb_fmp/models/cash_flow.py | 3 -- .../fmp/openbb_fmp/models/financial_ratios.py | 5 -- .../fmp/openbb_fmp/models/income_statement.py | 1 - .../models/income_statement_growth.py | 2 - .../fmp/openbb_fmp/models/key_metrics.py | 2 - .../models/revenue_business_line.py | 3 -- .../openbb_fmp/models/revenue_geographic.py | 3 -- .../openbb_polygon/models/balance_sheet.py | 2 - .../openbb_polygon/models/cash_flow.py | 2 - .../openbb_polygon/models/forex_pairs.py | 25 ++++++--- .../openbb_polygon/models/income_statement.py | 2 - .../openbb_polygon/models/stock_eod.py | 8 +-- .../yfinance/openbb_yfinance/utils/helpers.py | 8 +-- .../app/static/package/__extensions__.py | 1 - .../openbb_core/app/static/package/economy.py | 4 +- .../app/static/package/stocks_fa.py | 54 +++++++++---------- .../standard_models/analyst_estimates.py | 4 +- .../openbb_provider/standard_models/base.py | 4 +- .../openbb_provider/standard_models/cpi.py | 2 +- .../standard_models/income_statement.py | 2 +- .../income_statement_growth.py | 4 +- .../standard_models/key_metrics.py | 4 +- .../standard_models/revenue_business_line.py | 4 +- .../standard_models/revenue_geographic.py | 4 +- 25 files changed, 70 insertions(+), 85 deletions(-) diff --git a/openbb_sdk/providers/fmp/openbb_fmp/models/balance_sheet.py b/openbb_sdk/providers/fmp/openbb_fmp/models/balance_sheet.py index 70e47512c36..cc1ba1bf893 100644 --- a/openbb_sdk/providers/fmp/openbb_fmp/models/balance_sheet.py +++ b/openbb_sdk/providers/fmp/openbb_fmp/models/balance_sheet.py @@ -116,8 +116,6 @@ class FMPBalanceSheetFetcher( api_key = credentials.get("fmp_api_key") if credentials else "" - query.period = "annual" if query.period == "annually" else "quarter" - url = create_url( 3, f"balance-sheet-statement/{query.symbol}", api_key, query, ["symbol"] ) diff --git a/openbb_sdk/providers/fmp/openbb_fmp/models/cash_flow.py b/openbb_sdk/providers/fmp/openbb_fmp/models/cash_flow.py index ae0c7f68c46..5ef15788d0c 100644 --- a/openbb_sdk/providers/fmp/openbb_fmp/models/cash_flow.py +++ b/openbb_sdk/providers/fmp/openbb_fmp/models/cash_flow.py @@ -100,11 +100,8 @@ class FMPCashFlowStatementFetcher( **kwargs: Any, ) -> List[Dict]: """Return the raw data from the FMP endpoint.""" - api_key = credentials.get("fmp_api_key") if credentials else "" - query.period = "annual" if query.period == "annually" else "quarter" - url = create_url( 3, f"cash-flow-statement/{query.symbol}", api_key, query, ["symbol"] ) diff --git a/openbb_sdk/providers/fmp/openbb_fmp/models/financial_ratios.py b/openbb_sdk/providers/fmp/openbb_fmp/models/financial_ratios.py index 07f2de2123c..974f3232813 100644 --- a/openbb_sdk/providers/fmp/openbb_fmp/models/financial_ratios.py +++ b/openbb_sdk/providers/fmp/openbb_fmp/models/financial_ratios.py @@ -108,14 +108,9 @@ class FMPFinancialRatiosFetcher( **kwargs: Any, ) -> List[Dict]: """Return the raw data from the FMP endpoint.""" - api_key = credentials.get("fmp_api_key") if credentials else "" - query.period = ( - "annual" if query.period == "annually" else "quarter" # mypy: ignore - ) base_url = "https://financialmodelingprep.com/api/v3" - data: List[Dict] = [] def multiple_symbols(symbol: str, data: List[Dict]) -> None: diff --git a/openbb_sdk/providers/fmp/openbb_fmp/models/income_statement.py b/openbb_sdk/providers/fmp/openbb_fmp/models/income_statement.py index 5f058bfb669..88ed44a75e3 100644 --- a/openbb_sdk/providers/fmp/openbb_fmp/models/income_statement.py +++ b/openbb_sdk/providers/fmp/openbb_fmp/models/income_statement.py @@ -101,7 +101,6 @@ class FMPIncomeStatementFetcher( api_key = credentials.get("fmp_api_key") if credentials else "" - query.period = "annual" if query.period == "annually" else "quarter" symbol = query.symbol or query.cik base_url = "https://financialmodelingprep.com/api/v3" diff --git a/openbb_sdk/providers/fmp/openbb_fmp/models/income_statement_growth.py b/openbb_sdk/providers/fmp/openbb_fmp/models/income_statement_growth.py index 5dc6b426a74..f1d6175afd3 100644 --- a/openbb_sdk/providers/fmp/openbb_fmp/models/income_statement_growth.py +++ b/openbb_sdk/providers/fmp/openbb_fmp/models/income_statement_growth.py @@ -86,8 +86,6 @@ class FMPIncomeStatementGrowthFetcher( api_key = credentials.get("fmp_api_key") if credentials else "" - query.period = "annual" if query.period == "annually" else "quarter" - url = create_url( 3, f"income-statement-growth/{query.symbol}", api_key, query, ["symbol"] ) diff --git a/openbb_sdk/providers/fmp/openbb_fmp/models/key_metrics.py b/openbb_sdk/providers/fmp/openbb_fmp/models/key_metrics.py index ca755f500c7..a2eb8eeb51f 100644 --- a/openbb_sdk/providers/fmp/openbb_fmp/models/key_metrics.py +++ b/openbb_sdk/providers/fmp/openbb_fmp/models/key_metrics.py @@ -112,8 +112,6 @@ class FMPKeyMetricsFetcher( api_key = credentials.get("fmp_api_key") if credentials else "" - query.period = "annual" if query.period == "annually" else "quarter" - data: List[Dict] = [] def multiple_symbols(symbol: str, data: List[Dict]) -> None: diff --git a/openbb_sdk/providers/fmp/openbb_fmp/models/revenue_business_line.py b/openbb_sdk/providers/fmp/openbb_fmp/models/revenue_business_line.py index f12f13ac935..b564b1084ad 100644 --- a/openbb_sdk/providers/fmp/openbb_fmp/models/revenue_business_line.py +++ b/openbb_sdk/providers/fmp/openbb_fmp/models/revenue_business_line.py @@ -51,11 +51,8 @@ class FMPRevenueBusinessLineFetcher( **kwargs: Any, ) -> List[Dict]: """Return the raw data from the FMP endpoint.""" - api_key = credentials.get("fmp_api_key") if credentials else "" - query.period = "annual" if query.period == "annually" else "quarter" - url = create_url(4, "revenue-product-segmentation", api_key, query) data = get_data(url, **kwargs) diff --git a/openbb_sdk/providers/fmp/openbb_fmp/models/revenue_geographic.py b/openbb_sdk/providers/fmp/openbb_fmp/models/revenue_geographic.py index 01f99065c95..c2af1da1a3e 100644 --- a/openbb_sdk/providers/fmp/openbb_fmp/models/revenue_geographic.py +++ b/openbb_sdk/providers/fmp/openbb_fmp/models/revenue_geographic.py @@ -51,11 +51,8 @@ class FMPRevenueGeographicFetcher( **kwargs: Any, ) -> List[Dict]: """Return the raw data from the FMP endpoint.""" - api_key = credentials.get("fmp_api_key") if credentials else "" - query.period = "annual" if query.period == "annually" else "quarter" - url = create_url(4, "revenue-geographic-segmentation", api_key, query) data = get_data(url, **kwargs) diff --git a/openbb_sdk/providers/polygon/openbb_polygon/models/balance_sheet.py b/openbb_sdk/providers/polygon/openbb_polygon/models/balance_sheet.py index c8d255f28a3..f790600225c 100644 --- a/openbb_sdk/providers/polygon/openbb_polygon/models/balance_sheet.py +++ b/openbb_sdk/providers/polygon/openbb_polygon/models/balance_sheet.py @@ -52,8 +52,6 @@ class PolygonBalanceSheetFetcher( ) -> dict: api_key = credentials.get("polygon_api_key") if credentials else "" - query.period = "annual" if query.period == "annually" else "quarter" - base_url = "https://api.polygon.io/vX/reference/financials" query_string = get_querystring(query.dict(by_alias=True), []) request_url = f"{base_url}?{query_string}&apiKey={api_key}" diff --git a/openbb_sdk/providers/polygon/openbb_polygon/models/cash_flow.py b/openbb_sdk/providers/polygon/openbb_polygon/models/cash_flow.py index 70bf46e90d9..d467ab9eae4 100644 --- a/openbb_sdk/providers/polygon/openbb_polygon/models/cash_flow.py +++ b/openbb_sdk/providers/polygon/openbb_polygon/models/cash_flow.py @@ -46,8 +46,6 @@ class PolygonCashFlowStatementFetcher( ) -> dict: api_key = credentials.get("polygon_api_key") if credentials else "" - query.period = "annual" if query.period == "annually" else "quarter" - base_url = "https://api.polygon.io/vX/reference/financials" query_string = get_querystring(query.dict(by_alias=True), []) request_url = f"{base_url}?{query_string}&apiKey={api_key}" diff --git a/openbb_sdk/providers/polygon/openbb_polygon/models/forex_pairs.py b/openbb_sdk/providers/polygon/openbb_polygon/models/forex_pairs.py index eaa8aae2577..305eb76d666 100644 --- a/openbb_sdk/providers/polygon/openbb_polygon/models/forex_pairs.py +++ b/openbb_sdk/providers/polygon/openbb_polygon/models/forex_pairs.py @@ -63,10 +63,16 @@ class PolygonForexPairsData(ForexPairsData): market: str = Field(description="The name of the trading market. Always 'fx'.") locale: str = Field(description="The locale of the currency pair.") - currency_symbol: str = Field(description="The symbol of the quote currency.") - currency_name: str = Field(description="The name of the quote currency.") - base_currency_symbol: str = Field(description="The symbol of the base currency.") - base_currency_name: str = Field(description="The name of the base currency.") + currency_symbol: Optional[str] = Field( + description="The symbol of the quote currency." + ) + currency_name: Optional[str] = Field(description="The name of the quote currency.") + base_currency_symbol: Optional[str] = Field( + description="The symbol of the base currency." + ) + base_currency_name: Optional[str] = Field( + description="The name of the base currency." + ) last_updated_utc: datetime = Field(description="The last updated timestamp in UTC.") delisted_utc: Optional[datetime] = Field( description="The delisted timestamp in UTC." @@ -108,7 +114,7 @@ class PolygonForexPairsFetcher( query: PolygonForexPairsQueryParams, credentials: Optional[Dict[str, str]], **kwargs: Any, - ) -> dict: + ) -> List[dict]: """Extract the data from the Polygon API.""" api_key = credentials.get("polygon_api_key") if credentials else "" @@ -135,7 +141,12 @@ class PolygonForexPairsFetcher( ) if data["status"] == "OK": - all_data.extend(data["results"]) + results = data.get("results") + if not isinstance(results, list): + raise ValueError( + "Expected 'results' to be a list, got something else." + ) + all_data.extend(results) elif data["status"] == "ERROR": raise UserWarning(data["error"]) @@ -146,7 +157,7 @@ class PolygonForexPairsFetcher( @staticmethod def transform_data( - data: dict, + data: List[dict], ) -> List[PolygonForexPairsData]: """Transform the data into a list of PolygonForexPairsData.""" diff --git a/openbb_sdk/providers/polygon/openbb_polygon/models/income_statement.py b/openbb_sdk/providers/polygon/openbb_polygon/models/income_statement.py index a80238fa470..043b2023e8b 100644 --- a/openbb_sdk/providers/polygon/openbb_polygon/models/income_statement.py +++ b/openbb_sdk/providers/polygon/openbb_polygon/models/income_statement.py @@ -72,8 +72,6 @@ class PolygonIncomeStatementFetcher( ) -> dict: api_key = credentials.get("polygon_api_key") if credentials else "" - query.period = "annual" if query.period == "annually" else "quarter" - base_url = "https://api.polygon.io/vX/reference/financials" query_string = get_querystring(query.dict(by_alias=True), []) request_url = f"{base_url}?{query_string}&apiKey={api_key}" diff --git a/openbb_sdk/providers/polygon/openbb_polygon/models/stock_eod.py b/openbb_sdk/providers/polygon/openbb_polygon/models/stock_eod.py index a9924b93b25..c68bce2002e 100644 --- a/openbb_sdk/providers/polygon/openbb_polygon/models/stock_eod.py +++ b/openbb_sdk/providers/polygon/openbb_polygon/models/stock_eod.py @@ -81,10 +81,10 @@ class PolygonStockEODFetcher( query: PolygonStockEODQueryParams, credentials: Optional[Dict[str, str]], **kwargs: Any, - ) -> List[PolygonStockEODData]: + ) -> List[dict]: api_key = credentials.get("polygon_api_key") if credentials else "" - data = [] + data: list = [] def multiple_symbols(symbol: str, data: List[PolygonStockEODData]) -> None: request_url = ( @@ -111,5 +111,5 @@ class PolygonStockEODFetcher( return data @staticmethod - def transform_data(data: List[PolygonStockEODData]) -> List[StockEODData]: - return [StockEODData.parse_obj(d.dict()) for d in data] + def transform_data(data: List[dict]) -> List[PolygonStockEODData]: + return [PolygonStockEODData.parse_obj(d) for d in data] diff --git a/openbb_sdk/providers/yfinance/openbb_yfinance/utils/helpers.py b/openbb_sdk/providers/yfinance/openbb_yfinance/utils/helpers.py index 964fb7610c6..6a05fe55297 100644 --- a/openbb_sdk/providers/yfinance/openbb_yfinance/utils/helpers.py +++ b/openbb_sdk/providers/yfinance/openbb_yfinance/utils/helpers.py @@ -1,7 +1,10 @@ """yfinance helpers module.""" -from datetime import datetime +from datetime import ( + date as dateType, + datetime, +) from pathlib import Path from typing import Optional @@ -18,7 +21,7 @@ def get_futures_data() -> pd.DataFrame: return pd.read_csv(Path(__file__).resolve().parent / "futures.csv") -def get_futures_curve(symbol: str, date: Optional[str]) -> pd.DataFrame: +def get_futures_curve(symbol: str, date: Optional[dateType]) -> pd.DataFrame: """Get the futures curve for a given symbol. Parameters @@ -33,7 +36,6 @@ def get_futures_curve(symbol: str, date: Optional[str]) -> pd.DataFrame: pd.DataFrame DataFrame with futures curve """ - futures_data = get_futures_data() exchange = futures_data[futures_data["Ticker"] == symbol]["Exchange"].values[0] today = datetime.today() diff --git a/openbb_sdk/sdk/core/openbb_core/app/static/package/__extensions__.py b/openbb_sdk/sdk/core/openbb_core/app/static/package/__extensions__.py index eae2eddef1d..afb365d4720 100644 --- a/openbb_sdk/sdk/core/openbb_core/app/static/package/__extensions__.py +++ b/openbb_sdk/sdk/core/openbb_core/app/static/package/__extensions__.py @@ -1,7 +1,6 @@ ### THIS FILE IS AUTO-GENERATED. DO NOT EDIT. ### - from openbb_core.app.static.container import Container diff --git a/openbb_sdk/sdk/core/openbb_core/app/static/package/economy.py b/openbb_sdk/sdk/core/openbb_core/app/static/package/economy.py index 69472576633..a25cb1640ba 100644 --- a/openbb_sdk/sdk/core/openbb_core/app/static/package/economy.py +++ b/openbb_sdk/sdk/core/openbb_core/app/static/package/economy.py @@ -316,7 +316,7 @@ class CLASS_economy(Container): OpenBBCustomParameter(description="The data units."), ] = "growth_same", frequency: Annotated[ - Literal["monthly", "quarterly", "annual"], + Literal["monthly", "quarter", "annual"], OpenBBCustomParameter(description="The data time frequency."), ] = "monthly", harmonized: Annotated[ @@ -349,7 +349,7 @@ class CLASS_economy(Container): The country or countries to get data. units : Literal['growth_previous', 'growth_same', 'index_2015'] The data units. - frequency : Literal['monthly', 'quarterly', 'annual'] + frequency : Literal['monthly', 'quarter', 'annual'] The data time frequency. harmonized : bool Whether you wish to obtain harmonized data. diff --git a/openbb_sdk/sdk/core/openbb_core/app/static/package/stocks_fa.py b/openbb_sdk/sdk/core/openbb_core/app/static/package/stocks_fa.py index d1f1cf01248..9fdc804095f 100644 --- a/openbb_sdk/sdk/core/openbb_core/app/static/package/stocks_fa.py +++ b/openbb_sdk/sdk/core/openbb_core/app/static/package/stocks_fa.py @@ -43,9 +43,9 @@ class CLASS_stocks_fa(Container): OpenBBCustomParameter(description="Symbol to get data for."), ], period: Annotated[ - Literal["annually", "quarterly"], + Literal["annual", "quarter"], OpenBBCustomParameter(description="Period of the data to return."), - ] = "annually", + ] = "annual", limit: Annotated[ Optional[pydantic.types.NonNegativeInt], OpenBBCustomParameter(description="The number of data entries to return."), @@ -60,7 +60,7 @@ class CLASS_stocks_fa(Container): ---------- symbol : Union[str, List[str]] Symbol to get data for. - period : Literal['annually', 'quarterly'] + period : Literal['annual', 'quarter'] Period of the data to return. limit : Optional[pydantic.types.NonNegativeInt] The number of data entries to return. @@ -499,9 +499,9 @@ class CLASS_stocks_fa(Container): OpenBBCustomParameter(description="Symbol to get data for."), ], period: Annotated[ - Literal["annually", "quarterly"], + Literal["annual", "quarter"], OpenBBCustomParameter(description="Period of the data to return."), - ] = "annually", + ] = "annual", limit: Annotated[ Optional[pydantic.types.NonNegativeInt], OpenBBCustomParameter(description="The number of data entries to return."), @@ -516,7 +516,7 @@ class CLASS_stocks_fa(Container): ---------- symbol : Union[str, List[str]] Symbol to get data for. - period : Literal['annually', 'quarterly'] + period : Literal['annual', 'quarter'] Period of the data to return. limit : Optional[pydantic.types.NonNegativeInt] The number of data entries to return. @@ -1316,9 +1316,9 @@ class CLASS_stocks_fa(Container): OpenBBCustomParameter(description="Symbol to get data for."), ], period: Annotated[ - Literal["annually", "quarterly"], + Literal["annual", "quarter"], OpenBBCustomParameter(description="Period of the data to return."), - ] = "annually", + ] = "annual", limit: Annotated[ int, OpenBBCustomParameter(description="The number of data entries to return."), @@ -1333,7 +1333,7 @@ class CLASS_stocks_fa(Container): ---------- symbol : Union[str, List[str]] Symbol to get data for. - period : Literal['annually', 'quarterly'] + period : Literal['annual', 'quarter'] Period of the data to return. limit : int The number of data entries to return. @@ -1522,9 +1522,9 @@ class CLASS_stocks_fa(Container): OpenBBCustomParameter(description="Symbol to get data for."), ], period: Annotated[ - Literal["annually", "quarterly"], + Literal["annual", "quarter"], OpenBBCustomParameter(description="Period of the data to return."), - ] = "annually", + ] = "annual", limit: Annotated[ Optional[pydantic.types.NonNegativeInt], OpenBBCustomParameter(description="The number of data entries to return."), @@ -1539,7 +1539,7 @@ class CLASS_stocks_fa(Container): ---------- symbol : Union[str, List[str]] Symbol to get data for. - period : Literal['annually', 'quarterly'] + period : Literal['annual', 'quarter'] Period of the data to return. limit : Optional[pydantic.types.NonNegativeInt] The number of data entries to return. @@ -1724,9 +1724,9 @@ class CLASS_stocks_fa(Container): OpenBBCustomParameter(description="The number of data entries to return."), ] = 10, period: Annotated[ - Literal["annually", "quarterly"], + Literal["annual", "quarter"], OpenBBCustomParameter(description="Period of the data to return."), - ] = "annually", + ] = "annual", chart: bool = False, provider: Optional[Literal["fmp"]] = None, **kwargs @@ -1739,7 +1739,7 @@ class CLASS_stocks_fa(Container): Symbol to get data for. limit : int The number of data entries to return. - period : Literal['annually', 'quarterly'] + period : Literal['annual', 'quarter'] Period of the data to return. chart : bool Whether to create a chart or not, by default False. @@ -2155,9 +2155,9 @@ class CLASS_stocks_fa(Container): OpenBBCustomParameter(description="Symbol to get data for."), ], period: Annotated[ - Literal["annually", "quarterly"], + Literal["annual", "quarter"], OpenBBCustomParameter(description="Period of the data to return."), - ] = "annually", + ] = "annual", limit: Annotated[ Optional[int], OpenBBCustomParameter(description="The number of data entries to return."), @@ -2172,7 +2172,7 @@ class CLASS_stocks_fa(Container): ---------- symbol : Union[str, List[str]] Symbol to get data for. - period : Literal['annually', 'quarterly'] + period : Literal['annual', 'quarter'] Period of the data to return. limit : Optional[int] The number of data entries to return. @@ -2919,9 +2919,9 @@ class CLASS_stocks_fa(Container): OpenBBCustomParameter(description="Symbol to get data for."), ], period: Annotated[ - Literal["annually", "quarterly"], + Literal["annual", "quarter"], OpenBBCustomParameter(description="Period of the data to return."), - ] = "annually", + ] = "annual", limit: Annotated[ Optional[pydantic.types.NonNegativeInt], OpenBBCustomParameter(description="The number of data entries to return."), @@ -2936,7 +2936,7 @@ class CLASS_stocks_fa(Container): ---------- symbol : Union[str, List[str]] Symbol to get data for. - period : Literal['annually', 'quarterly'] + period : Literal['annual', 'quarter'] Period of the data to return. limit : Optional[pydantic.types.NonNegativeInt] The number of data entries to return. @@ -3125,9 +3125,9 @@ class CLASS_stocks_fa(Container): OpenBBCustomParameter(description="Symbol to get data for."), ], period: Annotated[ - Literal["annually", "quarterly"], + Literal["annual", "quarter"], OpenBBCustomParameter(description="Period of the data to return."), - ] = "annually", + ] = "annual", structure: Annotated[ Literal["hierarchical", "flat"], OpenBBCustomParameter(description="Structure of the returned data."), @@ -3142,7 +3142,7 @@ class CLASS_stocks_fa(Container): ---------- symbol : Union[str, List[str]] Symbol to get data for. - period : Literal['annually', 'quarterly'] + period : Literal['annual', 'quarter'] Period of the data to return. structure : Literal['hierarchical', 'flat'] Structure of the returned data. @@ -3213,9 +3213,9 @@ class CLASS_stocks_fa(Container): OpenBBCustomParameter(description="Symbol to get data for."), ], period: Annotated[ - Literal["annually", "quarterly"], + Literal["annual", "quarter"], OpenBBCustomParameter(description="Period of the data to return."), - ] = "annually", + ] = "annual", structure: Annotated[ Literal["hierarchical", "flat"], OpenBBCustomParameter(description="Structure of the returned data."), @@ -3230,7 +3230,7 @@ class CLASS_stocks_fa(Container): ---------- symbol : Union[str, List[str]] Symbol to get data for. - period : Literal['annually', 'quarterly'] + period : Literal['annual', 'quarter'] Period of the data to return. structure : Literal['hierarchical', 'flat'] Structure of the returned data. diff --git a/openbb_sdk/sdk/provider/openbb_provider/standard_models/analyst_estimates.py b/openbb_sdk/sdk/provider/openbb_provider/standard_models/analyst_estimates.py index 5adc22b8f52..9748ef7135f 100644 --- a/openbb_sdk/sdk/provider/openbb_provider/standard_models/analyst_estimates.py +++ b/openbb_sdk/sdk/provider/openbb_provider/standard_models/analyst_estimates.py @@ -15,8 +15,8 @@ from openbb_provider.utils.descriptions import QUERY_DESCRIPTIONS class AnalystEstimatesQueryParams(QueryParams, BaseSymbol): """Analyst Estimates query.""" - period: Literal["quarterly", "annually"] = Field( - default="annually", description=QUERY_DESCRIPTIONS.get("period", "") + period: Literal["quarter", "annual"] = Field( + default="annual", description=QUERY_DESCRIPTIONS.get("period", "") ) limit: int = Field(default=30, description=QUERY_DESCRIPTIONS.get("limit", "")) diff --git a/openbb_sdk/sdk/provider/openbb_provider/standard_models/base.py b/openbb_sdk/sdk/provider/openbb_provider/standard_models/base.py index d901d14e951..ba6fea7bf43 100644 --- a/openbb_sdk/sdk/provider/openbb_provider/standard_models/base.py +++ b/openbb_sdk/sdk/provider/openbb_provider/standard_models/base.py @@ -23,8 +23,8 @@ class BaseSymbol(BaseModel): class FinancialStatementQueryParams(QueryParams, BaseSymbol): """Base model for financial statement query params.""" - period: Literal["annually", "quarterly"] = Field( - default="annually", description=QUERY_DESCRIPTIONS.get("period", "") + period: Literal["annual", "quarter"] = Field( + default="annual", description=QUERY_DESCRIPTIONS.get("period", "") ) limit: Optional[NonNegativeInt] = Field( default=12, description=QUERY_DESCRIPTIONS.get("limit", "") diff --git a/openbb_sdk/sdk/provider/openbb_provider/standard_models/cpi.py b/openbb_sdk/sdk/provider/openbb_provider/standard_models/cpi.py index 751343d29e0..b3da560d335 100644 --- a/openbb_sdk/sdk/provider/openbb_provider/standard_models/cpi.py +++ b/openbb_sdk/sdk/provider/openbb_provider/standard_models/cpi.py @@ -62,7 +62,7 @@ CPI_COUNTRIES = Literal[ CPI_UNITS = Literal["growth_previous", "growth_same", "index_2015"] -CPI_FREQUENCY = Literal["monthly", "quarterly", "annual"] +CPI_FREQUENCY = Literal["monthly", "quarter", "annual"] class CPIQueryParams(QueryParams): diff --git a/openbb_sdk/sdk/provider/openbb_provider/standard_models/income_statement.py b/openbb_sdk/sdk/provider/openbb_provider/standard_models/income_statement.py index 55a4fa50cbd..4501ea886b9 100644 --- a/openbb_sdk/sdk/provider/openbb_provider/standard_models/income_statement.py +++ b/openbb_sdk/sdk/provider/openbb_provider/standard_models/income_statement.py @@ -22,7 +22,7 @@ class IncomeStatementData(Data): date: dateType = Field(description="Date of the income statement.") symbol: str = Field(description="Symbol of the company.") - cik: Optional[int] = Field(description="Central Index Key.") + cik: Optional[str] = Field(description="Central Index Key.") currency: Optional[str] = Field(description="Reporting currency.") filing_date: Optional[dateType] = Field(description="Filling date.") diff --git a/openbb_sdk/sdk/provider/openbb_provider/standard_models/income_statement_growth.py b/openbb_sdk/sdk/provider/openbb_provider/standard_models/income_statement_growth.py index 1e3273a892c..c5ebf53607b 100644 --- a/openbb_sdk/sdk/provider/openbb_provider/standard_models/income_statement_growth.py +++ b/openbb_sdk/sdk/provider/openbb_provider/standard_models/income_statement_growth.py @@ -16,8 +16,8 @@ class IncomeStatementGrowthQueryParams(QueryParams, BaseSymbol): """Income Statement Growth Query.""" limit: int = Field(default=10, description=QUERY_DESCRIPTIONS.get("limit", "")) - period: Literal["annually", "quarterly"] = Field( - default="annually", description=QUERY_DESCRIPTIONS.get("period", "") + period: Literal["annual", "quarter"] = Field( + default="annual", description=QUERY_DESCRIPTIONS.get("period", "") ) diff --git a/openbb_sdk/sdk/provider/openbb_provider/standard_models/key_metrics.py b/openbb_sdk/sdk/provider/openbb_provider/standard_models/key_metrics.py index 5f6276f4174..fe7fc7e4c64 100644 --- a/openbb_sdk/sdk/provider/openbb_provider/standard_models/key_metrics.py +++ b/openbb_sdk/sdk/provider/openbb_provider/standard_models/key_metrics.py @@ -15,8 +15,8 @@ from openbb_provider.utils.descriptions import DATA_DESCRIPTIONS, QUERY_DESCRIPT class KeyMetricsQueryParams(QueryParams, BaseSymbol): """Key Metrics Query.""" - period: Literal["annually", "quarterly"] = Field( - default="annually", description=QUERY_DESCRIPTIONS.get("period", "") + period: Literal["annual", "quarter"] = Field( + default="annual", description=QUERY_DESCRIPTIONS.get("period", "") ) limit: Optional[int] = Field( default=100, description=QUERY_DESCRIPTIONS.get("limit", "") diff --git a/openbb_sdk/sdk/provider/openbb_provider/standard_models/revenue_business_line.py b/openbb_sdk/sdk/provider/openbb_provider/standard_models/revenue_business_line.py index f7111623202..d6b362aa01d 100644 --- a/openbb_sdk/sdk/provider/openbb_provider/standard_models/revenue_business_line.py +++ b/openbb_sdk/sdk/provider/openbb_provider/standard_models/revenue_business_line.py @@ -15,8 +15,8 @@ from openbb_provider.utils.descriptions import DATA_DESCRIPTIONS, QUERY_DESCRIPT class RevenueBusinessLineQueryParams(QueryParams, BaseSymbol): """Revenue Business Line Query.""" - period: Literal["quarterly", "annually"] = Field( - default="annually", description=QUERY_DESCRIPTIONS.get("period", "") + period: Literal["quarter", "annual"] = Field( + default="annual", description=QUERY_DESCRIPTIONS.get("period", "") ) structure: Literal["hierarchical", "flat"] = Field( default="flat", description="Structure of the returned data." diff --git a/openbb_sdk/sdk/provider/openbb_provider/standard_models/revenue_geographic.py b/openbb_sdk/sdk/provider/openbb_provider/standard_models/revenue_geographic.py index 1245e598ea8..130559d7f06 100644 --- a/openbb_sdk/sdk/provider/openbb_provider/standard_models/revenue_geographic.py +++ b/openbb_sdk/sdk/provider/openbb_provider/standard_models/revenue_geographic.py @@ -15,8 +15,8 @@ from openbb_provider.utils.descriptions import DATA_DESCRIPTIONS, QUERY_DESCRIPT class RevenueGeographicQueryParams(QueryParams, BaseSymbol): """Revenue by Geographic Segments Query.""" - period: Literal["quarterly", "annually"] = Field( - default="annually", description=QUERY_DESCRIPTIONS.get("period", "") + period: Literal["quarter", "annual"] = Field( + default="annual", description=QUERY_DESCRIPTIONS.get("period", "") ) structure: Literal["hierarchical", "flat"] = Field( default="flat", description="Structure of the returned data."