From 0b9b12d19846595f4616af990733e70b4b5fc94d Mon Sep 17 00:00:00 2001 From: montezdesousa <79287829+montezdesousa@users.noreply.github.com> Date: Thu, 9 May 2024 18:50:24 +0100 Subject: [PATCH 1/3] [Feature] - Redefined standard fields & multiple_items_allowed property changes (#6377) * feat: add field annotation and replace multiple items by dict * comments & details * fix: fix api & update docs website * ^ * remove empty info * descriptions * descriptions * fix reference.json * remove debug code * remove debug code * docstring * docstring * fix: standard fields propagate to providers * comment * better * better * better * better * better * mypy fixes * mypy fixes * reference * cli fix: if the argument is required (aka standard) it means we don't want to touch it, unless choices need to be added * cli fix: touch the help message (with the available providers) only if it's not on the signature (aka standard field) --------- Co-authored-by: hjoaquim Co-authored-by: hjoaquim --- .../argparse_translator.py | 26 +- .../openbb_core/app/provider_interface.py | 29 +- .../openbb_core/app/static/package_builder.py | 32 +- .../openbb_core/app/static/utils/filters.py | 56 ++- .../provider/abstract/query_params.py | 16 +- .../core/openbb_core/provider/registry_map.py | 81 ++-- openbb_platform/openbb/assets/reference.json | 400 +++++++++++++++++- .../openbb/package/crypto_price.py | 10 +- openbb_platform/openbb/package/currency.py | 7 +- .../openbb/package/currency_price.py | 10 +- openbb_platform/openbb/package/economy.py | 14 +- openbb_platform/openbb/package/equity.py | 4 +- .../openbb/package/equity_estimates.py | 32 +- .../openbb/package/equity_fundamental.py | 16 +- .../openbb/package/equity_ownership.py | 2 +- .../openbb/package/equity_price.py | 16 +- openbb_platform/openbb/package/etf.py | 27 +- .../openbb/package/fixedincome_corporate.py | 4 +- openbb_platform/openbb/package/index.py | 10 +- openbb_platform/openbb/package/news.py | 14 +- .../models/equity_historical.py | 2 +- .../models/historical_eps.py | 2 +- .../openbb_benzinga/models/analyst_search.py | 10 +- .../openbb_benzinga/models/company_news.py | 9 +- .../openbb_benzinga/models/price_target.py | 2 +- .../openbb_cboe/models/equity_historical.py | 6 +- .../cboe/openbb_cboe/models/equity_quote.py | 2 +- .../openbb_cboe/models/index_historical.py | 8 +- .../openbb_econdb/models/country_profile.py | 2 +- .../models/economic_indicators.py | 4 +- .../openbb_finviz/models/equity_profile.py | 2 +- .../openbb_finviz/models/key_metrics.py | 2 +- .../openbb_finviz/models/price_performance.py | 2 +- .../openbb_finviz/models/price_target.py | 8 +- .../openbb_fmp/models/analyst_estimates.py | 4 +- .../fmp/openbb_fmp/models/company_news.py | 2 +- .../openbb_fmp/models/crypto_historical.py | 2 +- .../openbb_fmp/models/currency_historical.py | 2 +- .../openbb_fmp/models/currency_snapshots.py | 2 +- .../openbb_fmp/models/equity_historical.py | 2 +- .../fmp/openbb_fmp/models/equity_profile.py | 4 +- .../fmp/openbb_fmp/models/equity_quote.py | 2 +- .../models/equity_valuation_multiples.py | 2 +- .../fmp/openbb_fmp/models/etf_countries.py | 2 +- .../openbb_fmp/models/etf_equity_exposure.py | 4 +- .../fmp/openbb_fmp/models/etf_info.py | 2 +- .../models/executive_compensation.py | 4 +- .../models/forward_eps_estimates.py | 2 +- .../fmp/openbb_fmp/models/index_historical.py | 2 +- .../fmp/openbb_fmp/models/key_metrics.py | 2 +- .../openbb_fmp/models/price_performance.py | 2 +- .../fmp/openbb_fmp/models/price_target.py | 4 +- .../models/price_target_consensus.py | 2 +- .../providers/fred/openbb_fred/models/cpi.py | 7 +- .../fred/openbb_fred/models/series.py | 2 +- .../providers/fred/openbb_fred/models/spot.py | 4 +- .../openbb_intrinio/models/company_news.py | 8 +- .../openbb_intrinio/models/equity_info.py | 2 +- .../openbb_intrinio/models/equity_quote.py | 2 +- .../openbb_intrinio/models/etf_info.py | 2 +- .../models/etf_price_performance.py | 2 +- .../models/forward_eps_estimates.py | 2 +- .../models/forward_sales_estimates.py | 2 +- .../models/historical_attributes.py | 4 +- .../models/index_historical.py | 2 +- .../openbb_intrinio/models/key_metrics.py | 2 +- .../models/latest_attributes.py | 4 +- .../models/price_target_consensus.py | 2 +- .../openbb_nasdaq/models/economic_calendar.py | 2 +- .../models/historical_dividends.py | 2 +- .../openbb_polygon/models/company_news.py | 2 +- .../models/crypto_historical.py | 2 +- .../models/currency_historical.py | 2 +- .../models/currency_snapshots.py | 10 +- .../models/equity_historical.py | 2 +- .../openbb_polygon/models/index_historical.py | 2 +- .../openbb_tiingo/models/company_news.py | 2 +- .../openbb_tiingo/models/crypto_historical.py | 4 +- .../models/currency_historical.py | 4 +- .../openbb_tiingo/models/equity_historical.py | 4 +- .../tmx/openbb_tmx/models/company_news.py | 2 +- .../openbb_tmx/models/equity_historical.py | 2 +- .../tmx/openbb_tmx/models/equity_profile.py | 2 +- .../tmx/openbb_tmx/models/equity_quote.py | 2 +- .../tmx/openbb_tmx/models/etf_countries.py | 2 +- .../tmx/openbb_tmx/models/etf_info.py | 2 +- .../models/price_target_consensus.py | 2 +- .../models/equity_historical.py | 2 +- .../openbb_tradier/models/equity_quote.py | 2 +- .../models/economic_calendar.py | 2 +- .../openbb_yfinance/models/company_news.py | 2 +- .../models/crypto_historical.py | 2 +- .../models/currency_historical.py | 2 +- .../models/equity_historical.py | 2 +- .../openbb_yfinance/models/equity_profile.py | 2 +- .../openbb_yfinance/models/equity_quote.py | 2 +- .../openbb_yfinance/models/etf_info.py | 2 +- .../models/futures_historical.py | 2 +- .../models/index_historical.py | 2 +- .../openbb_yfinance/models/key_metrics.py | 2 +- .../openbb_yfinance/models/market_indices.py | 6 +- .../models/price_target_consensus.py | 2 +- .../models/share_statistics.py | 2 +- website/generate_platform_v4_markdown.py | 44 +- 104 files changed, 761 insertions(+), 333 deletions(-) diff --git a/cli/openbb_cli/argparse_translator/argparse_translator.py b/cli/openbb_cli/argparse_translator/argparse_translator.py index bf5917207d5..001e7afce04 100644 --- a/cli/openbb_cli/argparse_translator/argparse_translator.py +++ b/cli/openbb_cli/argparse_translator/argparse_translator.py @@ -225,9 +225,9 @@ class ArgparseTranslator: def _handle_argument_in_groups(self, argument, group): """Handle the argument and add it to the parser.""" - def _in_optional_arguments(arg): + def _in_group(arg, group_title): for action_group in self._parser._action_groups: - if action_group.title == "optional arguments": + if action_group.title == group_title: for action in action_group._group_actions: opts = action.option_strings if (opts and opts[0] == arg) or action.dest == arg: @@ -286,16 +286,26 @@ class ArgparseTranslator: # extend choices choices = tuple(set(_get_arg_choices(argument.name) + model_choices)) + # check if the argument is in the required arguments + if _in_group(argument.name, group_title="required arguments"): + for action in self._required._group_actions: + if action.dest == argument.name and choices: + # update choices + action.choices = choices + return + # check if the argument is in the optional arguments - if _in_optional_arguments(argument.name): + if _in_group(argument.name, group_title="optional arguments"): for action in self._parser._actions: if action.dest == argument.name: # update choices - action.choices = choices - # update help - action.help = _update_providers( - action.help or "", [group.title] - ) + if choices: + action.choices = choices + if argument.name not in self.signature.parameters: + # update help + action.help = _update_providers( + action.help or "", [group.title] + ) return # if the argument is in use, remove it from all groups diff --git a/openbb_platform/core/openbb_core/app/provider_interface.py b/openbb_platform/core/openbb_core/app/provider_interface.py index 0932704cb96..11bb21d5f77 100644 --- a/openbb_platform/core/openbb_core/app/provider_interface.py +++ b/openbb_platform/core/openbb_core/app/provider_interface.py @@ -253,17 +253,24 @@ class ProviderInterface(metaclass=SingletonMeta): annotation = field.annotation additional_description = "" - if (extra := field.json_schema_extra) and ( - multiple := extra.get("multiple_items_allowed") # type: ignore - ): - if provider_name: - additional_description += " Multiple comma separated items allowed." - else: - additional_description += ( - " Multiple comma separated items allowed for provider(s): " - + ", ".join(multiple) # type: ignore[arg-type] - + "." - ) + if extra := field.json_schema_extra: + providers = [] + for p, v in extra.items(): # type: ignore[union-attr] + if isinstance(v, dict) and v.get("multiple_items_allowed"): + providers.append(p) + elif isinstance(v, list) and "multiple_items_allowed" in v: + # For backwards compatibility, before this was a list + providers.append(p) + + if providers: + if provider_name: + additional_description += " Multiple comma separated items allowed." + else: + additional_description += ( + " Multiple comma separated items allowed for provider(s): " + + ", ".join(providers) # type: ignore[arg-type] + + "." + ) provider_field = ( f"(provider: {provider_name})" if provider_name != "openbb" else "" diff --git a/openbb_platform/core/openbb_core/app/static/package_builder.py b/openbb_platform/core/openbb_core/app/static/package_builder.py index 8a2a86a6619..5db17483a19 100644 --- a/openbb_platform/core/openbb_core/app/static/package_builder.py +++ b/openbb_platform/core/openbb_core/app/static/package_builder.py @@ -864,7 +864,15 @@ class MethodDefinition: original_type: Optional[type] = None, ) -> object: """Expand the original field type.""" - if extra and "multiple_items_allowed" in extra: + if extra and any( + ( + v.get("multiple_items_allowed") + if isinstance(v, dict) + # For backwards compatibility, before this was a list + else "multiple_items_allowed" in v + ) + for v in extra.values() + ): if original_type is None: raise ValueError( "multiple_items_allowed requires the original type to be specified." @@ -1450,6 +1458,10 @@ class ReferenceGenerator: expanded_types = MethodDefinition.TYPE_EXPANSION model_map = cls.pi.map[model] + # TODO: Change this to read the package data instead of pi.map directly + # We change some items (types, descriptions), so the reference.json + # does not reflect entirely the package code. + for field, field_info in model_map[provider][params_type]["fields"].items(): # Determine the field type, expanding it if necessary and if params_type is "Parameters" field_type = field_info.annotation @@ -1470,12 +1482,18 @@ class ReferenceGenerator: ) # fmt: skip # Add information for the providers supporting multiple symbols - if params_type == "QueryParams" and field_info.json_schema_extra: - multiple_items_list = field_info.json_schema_extra.get( - "multiple_items_allowed", None - ) - if multiple_items_list: - multiple_items = ", ".join(multiple_items_list) + if params_type == "QueryParams" and (extra := field_info.json_schema_extra): + + providers = [] + for p, v in extra.items(): # type: ignore[union-attr] + if isinstance(v, dict) and v.get("multiple_items_allowed"): + providers.append(p) + elif isinstance(v, list) and "multiple_items_allowed" in v: + # For backwards compatibility, before this was a list + providers.append(p) + + if providers: + multiple_items = ", ".join(providers) cleaned_description += ( f" Multiple items allowed for provider(s): {multiple_items}." ) diff --git a/openbb_platform/core/openbb_core/app/static/utils/filters.py b/openbb_platform/core/openbb_core/app/static/utils/filters.py index b2262a1e8c8..3f2c0270842 100644 --- a/openbb_platform/core/openbb_core/app/static/utils/filters.py +++ b/openbb_platform/core/openbb_core/app/static/utils/filters.py @@ -1,13 +1,13 @@ """OpenBB filters.""" -from typing import Dict, List, Optional +from typing import Any, Dict, Optional from openbb_core.app.utils import check_single_item, convert_to_basemodel def filter_inputs( data_processing: bool = False, - info: Optional[Dict[str, Dict[str, List[str]]]] = None, + info: Optional[Dict[str, Dict[str, Any]]] = None, **kwargs, ) -> dict: """Filter command inputs.""" @@ -16,32 +16,42 @@ def filter_inputs( kwargs[key] = convert_to_basemodel(value) if info: - PROPERTY = "multiple_items_allowed" - # Here we check if list items are passed and multiple items allowed for # the given provider/input combination. In that case we transform the list # into a comma-separated string - for field, props in info.items(): - if PROPERTY in props and ( - provider := kwargs.get("provider_choices", {}).get("provider") - ): - for p in ("standard_params", "extra_params"): - if field in kwargs.get(p, {}): - current = kwargs[p][field] - new = ( - ",".join(map(str, current)) - if isinstance(current, list) - else current + provider = kwargs.get("provider_choices", {}).get("provider") + for field, properties in info.items(): + + for p in ("standard_params", "extra_params"): + if field in kwargs.get(p, {}): + current = kwargs[p][field] + new = ( + ",".join(map(str, current)) + if isinstance(current, list) + else current + ) + + provider_properties = properties.get(provider, {}) + if isinstance(provider_properties, dict): + multiple_items_allowed = provider_properties.get( + "multiple_items_allowed" + ) + elif isinstance(provider_properties, list): + # For backwards compatibility, before this was a list + multiple_items_allowed = ( + "multiple_items_allowed" in provider_properties + ) + else: + multiple_items_allowed = True + + if not multiple_items_allowed: + check_single_item( + new, + f"{field} -> multiple items not allowed for '{provider}'", ) - if provider and provider not in props[PROPERTY]: - check_single_item( - new, - f"{field} -> multiple items not allowed for '{provider}'", - ) - - kwargs[p][field] = new - break + kwargs[p][field] = new + break else: provider = kwargs.get("provider_choices", {}).get("provider") for param_category in ("standard_params", "extra_params"): diff --git a/openbb_platform/core/openbb_core/provider/abstract/query_params.py b/openbb_platform/core/openbb_core/provider/abstract/query_params.py index acca9873767..be10b82f2f3 100644 --- a/openbb_platform/core/openbb_core/provider/abstract/query_params.py +++ b/openbb_platform/core/openbb_core/provider/abstract/query_params.py @@ -19,22 +19,24 @@ class QueryParams(BaseModel): Merge different json schema extra, identified by provider. Example: FMP fetcher: - __json_schema_extra__ = {"symbol": ["multiple_items_allowed"]} + __json_schema_extra__ = {"symbol": {"multiple_items_allowed": True}} Intrinio fetcher - __json_schema_extra__ = {"symbol": ["multiple_items_allowed"]} + __json_schema_extra__ = {"symbol": {"multiple_items_allowed": False}} - Creates a new field in the `symbol` schema with: + Creates new fields in the `symbol` schema: { - ..., - "multiple_items_allowed": ["fmp", "intrinio"], + "type": "string", + "description": "Symbol to get data for.", + "fmp": {"multiple_items_allowed": True}, + "intrinio": {"multiple_items_allowed": False} ..., } Multiple fields can be tagged with the same or multiple properties. Example: __json_schema_extra__ = { - "": ["some_prop", "another_prop"], - "": ["yet_another_prop"] + "": {"foo": 123, "bar": 456}, + "": {"foo": 789} } Attributes: diff --git a/openbb_platform/core/openbb_core/provider/registry_map.py b/openbb_platform/core/openbb_core/provider/registry_map.py index 05dff9ef4f6..a3a7fcc32d4 100644 --- a/openbb_platform/core/openbb_core/provider/registry_map.py +++ b/openbb_platform/core/openbb_core/provider/registry_map.py @@ -104,11 +104,11 @@ class RegistryMap: } ) - self._merge_json_schema_extra(p, fetcher, standard_extra[model_name]) + self._update_json_schema_extra(p, fetcher, standard_extra[model_name]) return standard_extra, original_models - def _merge_json_schema_extra( + def _update_json_schema_extra( self, provider: str, fetcher: Fetcher, @@ -116,26 +116,22 @@ class RegistryMap: ): """Merge json schema extra for different providers.""" model: BaseModel = RegistryMap._get_model(fetcher, "query_params") - std_fields = model_map["openbb"]["QueryParams"]["fields"] + standard_fields = model_map["openbb"]["QueryParams"]["fields"] extra_fields = model_map[provider]["QueryParams"]["fields"] - for f, props in getattr(model, "__json_schema_extra__", {}).items(): - for p in props: - if f in std_fields: - model_field = std_fields[f] - elif f in extra_fields: - model_field = extra_fields[f] + + for field, properties in getattr(model, "__json_schema_extra__", {}).items(): + if properties: + if field in standard_fields: + model_field = standard_fields[field] + elif field in extra_fields: + model_field = extra_fields[field] else: continue if model_field.json_schema_extra is None: model_field.json_schema_extra = {} - if p not in model_field.json_schema_extra: - model_field.json_schema_extra[p] = [] - - providers = model_field.json_schema_extra[p] - if provider not in providers: - providers.append(provider) + model_field.json_schema_extra[provider] = properties def _get_models(self, map_: MapType) -> List[str]: """Get available models.""" @@ -152,33 +148,38 @@ class RegistryMap: ) -> tuple: """Extract info (fields and docstring) from fetcher query params or data.""" model: BaseModel = RegistryMap._get_model(fetcher, type_) - all_fields = {} standard_info: Dict[str, Any] = {"fields": {}, "docstring": None} - found_top_level = False + extra_info: Dict[str, Any] = {"fields": {}, "docstring": model.__doc__} + found_first_standard = False - for c in RegistryMap._class_hierarchy(model): - if c.__name__ in SKIP: + family = RegistryMap._get_class_family(model) + for i, child in enumerate(family): + if child.__name__ in SKIP: continue - if (Path(getfile(c)).parent == STANDARD_MODELS_FOLDER) or found_top_level: - if not found_top_level: - # We might update the standard_info more than once to account for - # nested standard models, but we only want to update the docstring - # once with the __doc__ of the top-level standard model. - standard_info["docstring"] = c.__doc__ - found_top_level = True - standard_info["fields"].update(c.model_fields) + + parent = family[i + 1] if family[i + 1] not in SKIP else BaseModel + + fields = { + name: field + for name, field in child.model_fields.items() + # This ensures fields inherited by c are discarded. + # We need to compare child and parent __annotations__ + # because this attribute is redirected to the parent class + # when the child simply inherits the parent and does not + # define any attributes. + # TLDR: Only fields defined in c are included + if name in child.__annotations__ + and child.__annotations__ is not parent.__annotations__ + } + + if Path(getfile(child)).parent == STANDARD_MODELS_FOLDER: + if not found_first_standard: + # If standard uses inheritance we just use the first docstring + standard_info["docstring"] = child.__doc__ + found_first_standard = True + standard_info["fields"].update(fields) else: - all_fields.update(c.model_fields) - - extra_info: Dict[str, Any] = { - "fields": {}, - "docstring": model.__doc__, - } - - # We ignore fields that are already in the standard model - for name, field in all_fields.items(): - if name not in standard_info["fields"]: - extra_info["fields"][name] = field + extra_info["fields"].update(fields) return standard_info, extra_info @@ -204,6 +205,6 @@ class RegistryMap: ) @staticmethod - def _class_hierarchy(class_) -> tuple: - """Return the class hierarchy starting with the class itself until `object`.""" + def _get_class_family(class_) -> tuple: + """Return the class family starting with the class itself until `object`.""" return getattr(class_, "__mro__", ()) diff --git a/openbb_platform/openbb/assets/reference.json b/openbb_platform/openbb/assets/reference.json index 495c4e0b5ca..5ff26093f05 100644 --- a/openbb_platform/openbb/assets/reference.json +++ b/openbb_platform/openbb/assets/reference.json @@ -645,6 +645,13 @@ } ], "fmp": [ + { + "name": "symbol", + "type": "str", + "description": "Symbol of the currency pair.", + "default": "", + "optional": false + }, { "name": "currency", "type": "str", @@ -2882,6 +2889,13 @@ } ], "fred": [ + { + "name": "limit", + "type": "int", + "description": "The number of data entries to return.", + "default": 100000, + "optional": true + }, { "name": "frequency", "type": "Literal['a', 'q', 'm', 'w', 'd', 'wef', 'weth', 'wew', 'wetu', 'wem', 'wesu', 'wesa', 'bwew', 'bwem']", @@ -3585,6 +3599,13 @@ } ], "fred": [ + { + "name": "symbol", + "type": "str", + "description": "For this function, it is the series_group ID or series ID. If the symbol provided is for a series_group, set the `is_series_group` parameter to True. Not all series that are in FRED have geographical data.", + "default": "", + "optional": false + }, { "name": "is_series_group", "type": "bool", @@ -5156,6 +5177,13 @@ } ], "benzinga": [ + { + "name": "action", + "type": "Literal['Downgrades', 'Maintains', 'Reinstates', 'Reiterates', 'Upgrades', 'Assumes', 'Initiates Coverage On', 'Terminates Coverage On', 'Removes', 'Suspends', 'Firm Dissolved']", + "description": "Description of the change in rating from firm's last rating.Note that all of these terms are precisely defined.", + "default": null, + "optional": true + }, { "name": "action_change", "type": "Literal['Announces', 'Maintains', 'Lowers', 'Raises', 'Removes', 'Adjusts']", @@ -8200,8 +8228,23 @@ "optional": true } ], - "fmp": [], + "fmp": [ + { + "name": "period", + "type": "Literal['annual', 'quarter']", + "description": "None", + "default": "annual", + "optional": true + } + ], "intrinio": [ + { + "name": "period", + "type": "Literal['annual', 'quarter']", + "description": "None", + "default": "annual", + "optional": true + }, { "name": "fiscal_year", "type": "int", @@ -8211,6 +8254,13 @@ } ], "polygon": [ + { + "name": "period", + "type": "Literal['annual', 'quarter', 'ttm']", + "description": "None", + "default": "annual", + "optional": true + }, { "name": "filing_date", "type": "date", @@ -8303,7 +8353,15 @@ "optional": true } ], - "yfinance": [] + "yfinance": [ + { + "name": "period", + "type": "Literal['annual', 'quarter']", + "description": "None", + "default": "annual", + "optional": true + } + ] }, "returns": { "OBBject": [ @@ -9952,8 +10010,23 @@ "optional": true } ], - "fmp": [], + "fmp": [ + { + "name": "period", + "type": "Literal['annual', 'quarter']", + "description": "None", + "default": "annual", + "optional": true + } + ], "intrinio": [ + { + "name": "period", + "type": "Literal['annual', 'quarter', 'ttm', 'ytd']", + "description": "None", + "default": "annual", + "optional": true + }, { "name": "fiscal_year", "type": "int", @@ -9963,6 +10036,13 @@ } ], "polygon": [ + { + "name": "period", + "type": "Literal['annual', 'quarter']", + "description": "None", + "default": "annual", + "optional": true + }, { "name": "filing_date", "type": "date", @@ -10055,7 +10135,15 @@ "optional": true } ], - "yfinance": [] + "yfinance": [ + { + "name": "period", + "type": "Literal['annual', 'quarter']", + "description": "None", + "default": "annual", + "optional": true + } + ] }, "returns": { "OBBject": [ @@ -10111,6 +10199,13 @@ } ], "fmp": [ + { + "name": "fiscal_year", + "type": "int", + "description": "The fiscal year of the fiscal period.", + "default": null, + "optional": true + }, { "name": "filing_date", "type": "date", @@ -10817,6 +10912,20 @@ } ], "intrinio": [ + { + "name": "period", + "type": "Literal['annual', 'quarter']", + "description": "None", + "default": "annual", + "optional": true + }, + { + "name": "statement_type", + "type": "Literal['balance', 'income', 'cash']", + "description": "Cash flow statements are reported as YTD, Q4 is the same as FY.", + "default": "income", + "optional": true + }, { "name": "fiscal_year", "type": "int", @@ -12022,8 +12131,23 @@ "optional": true } ], - "fmp": [], + "fmp": [ + { + "name": "period", + "type": "Literal['annual', 'quarter']", + "description": "None", + "default": "annual", + "optional": true + } + ], "intrinio": [ + { + "name": "period", + "type": "Literal['annual', 'quarter', 'ttm', 'ytd']", + "description": "None", + "default": "annual", + "optional": true + }, { "name": "fiscal_year", "type": "int", @@ -12033,6 +12157,13 @@ } ], "polygon": [ + { + "name": "period", + "type": "Literal['annual', 'quarter', 'ttm']", + "description": "None", + "default": "annual", + "optional": true + }, { "name": "filing_date", "type": "date", @@ -12125,7 +12256,15 @@ "optional": true } ], - "yfinance": [] + "yfinance": [ + { + "name": "period", + "type": "Literal['annual', 'quarter']", + "description": "None", + "default": "annual", + "optional": true + } + ] }, "returns": { "OBBject": [ @@ -15225,8 +15364,23 @@ "optional": true } ], - "fmp": [], + "fmp": [ + { + "name": "period", + "type": "Literal['annual', 'quarter', 'ttm']", + "description": "Time period of the data to return.", + "default": "annual", + "optional": true + } + ], "intrinio": [ + { + "name": "period", + "type": "Literal['annual', 'quarter', 'ttm', 'ytd']", + "description": "Time period of the data to return.", + "default": "annual", + "optional": true + }, { "name": "fiscal_year", "type": "int", @@ -15972,6 +16126,20 @@ } ], "sec": [ + { + "name": "symbol", + "type": "str", + "description": "Symbol to get data for.", + "default": null, + "optional": true + }, + { + "name": "form_type", + "type": "Literal['1', '1-A', '1-A POS', '1-A-W', '1-E', '1-E AD', '1-K', '1-SA', '1-U', '1-Z', '1-Z-W', '10-12B', '10-12G', '10-D', '10-K', '10-KT', '10-Q', '10-QT', '11-K', '11-KT', '13F-HR', '13F-NT', '13FCONP', '144', '15-12B', '15-12G', '15-15D', '15F-12B', '15F-12G', '15F-15D', '18-12B', '18-K', '19B-4E', '2-A', '2-AF', '2-E', '20-F', '20FR12B', '20FR12G', '24F-2NT', '25', '25-NSE', '253G1', '253G2', '253G3', '253G4', '3', '305B2', '34-12H', '4', '40-17F1', '40-17F2', '40-17G', '40-17GCS', '40-202A', '40-203A', '40-206A', '40-24B2', '40-33', '40-6B', '40-8B25', '40-8F-2', '40-APP', '40-F', '40-OIP', '40FR12B', '40FR12G', '424A', '424B1', '424B2', '424B3', '424B4', '424B5', '424B7', '424B8', '424H', '425', '485APOS', '485BPOS', '485BXT', '486APOS', '486BPOS', '486BXT', '487', '497', '497AD', '497H2', '497J', '497K', '497VPI', '497VPU', '5', '6-K', '6B NTC', '6B ORDR', '8-A12B', '8-A12G', '8-K', '8-K12B', '8-K12G3', '8-K15D5', '8-M', '8F-2 NTC', '8F-2 ORDR', '9-M', 'ABS-15G', 'ABS-EE', 'ADN-MTL', 'ADV-E', 'ADV-H-C', 'ADV-H-T', 'ADV-NR', 'ANNLRPT', 'APP NTC', 'APP ORDR', 'APP WD', 'APP WDG', 'ARS', 'ATS-N', 'ATS-N-C', 'ATS-N/UA', 'AW', 'AW WD', 'C', 'C-AR', 'C-AR-W', 'C-TR', 'C-TR-W', 'C-U', 'C-U-W', 'C-W', 'CB', 'CERT', 'CERTARCA', 'CERTBATS', 'CERTCBO', 'CERTNAS', 'CERTNYS', 'CERTPAC', 'CFPORTAL', 'CFPORTAL-W', 'CORRESP', 'CT ORDER', 'D', 'DEF 14A', 'DEF 14C', 'DEFA14A', 'DEFA14C', 'DEFC14A', 'DEFC14C', 'DEFM14A', 'DEFM14C', 'DEFN14A', 'DEFR14A', 'DEFR14C', 'DEL AM', 'DFAN14A', 'DFRN14A', 'DOS', 'DOSLTR', 'DRS', 'DRSLTR', 'DSTRBRPT', 'EFFECT', 'F-1', 'F-10', 'F-10EF', 'F-10POS', 'F-1MEF', 'F-3', 'F-3ASR', 'F-3D', 'F-3DPOS', 'F-3MEF', 'F-4', 'F-4 POS', 'F-4MEF', 'F-6', 'F-6 POS', 'F-6EF', 'F-7', 'F-7 POS', 'F-8', 'F-8 POS', 'F-80', 'F-80POS', 'F-9', 'F-9 POS', 'F-N', 'F-X', 'FOCUSN', 'FWP', 'G-405', 'G-405N', 'G-FIN', 'G-FINW', 'IRANNOTICE', 'MA', 'MA-A', 'MA-I', 'MA-W', 'MSD', 'MSDCO', 'MSDW', 'N-1', 'N-14', 'N-14 8C', 'N-14MEF', 'N-18F1', 'N-1A', 'N-2', 'N-2 POSASR', 'N-23C-2', 'N-23C3A', 'N-23C3B', 'N-23C3C', 'N-2ASR', 'N-2MEF', 'N-30B-2', 'N-30D', 'N-4', 'N-5', 'N-54A', 'N-54C', 'N-6', 'N-6F', 'N-8A', 'N-8B-2', 'N-8F', 'N-8F NTC', 'N-8F ORDR', 'N-CEN', 'N-CR', 'N-CSR', 'N-CSRS', 'N-MFP', 'N-MFP1', 'N-MFP2', 'N-PX', 'N-Q', 'N-VP', 'N-VPFS', 'NO ACT', 'NPORT-EX', 'NPORT-NP', 'NPORT-P', 'NRSRO-CE', 'NRSRO-UPD', 'NSAR-A', 'NSAR-AT', 'NSAR-B', 'NSAR-BT', 'NSAR-U', 'NT 10-D', 'NT 10-K', 'NT 10-Q', 'NT 11-K', 'NT 20-F', 'NT N-CEN', 'NT N-MFP', 'NT N-MFP1', 'NT N-MFP2', 'NT NPORT-EX', 'NT NPORT-P', 'NT-NCEN', 'NT-NCSR', 'NT-NSAR', 'NTFNCEN', 'NTFNCSR', 'NTFNSAR', 'NTN 10D', 'NTN 10K', 'NTN 10Q', 'NTN 20F', 'OIP NTC', 'OIP ORDR', 'POS 8C', 'POS AM', 'POS AMI', 'POS EX', 'POS462B', 'POS462C', 'POSASR', 'PRE 14A', 'PRE 14C', 'PREC14A', 'PREC14C', 'PREM14A', 'PREM14C', 'PREN14A', 'PRER14A', 'PRER14C', 'PRRN14A', 'PX14A6G', 'PX14A6N', 'QRTLYRPT', 'QUALIF', 'REG-NR', 'REVOKED', 'RW', 'RW WD', 'S-1', 'S-11', 'S-11MEF', 'S-1MEF', 'S-20', 'S-3', 'S-3ASR', 'S-3D', 'S-3DPOS', 'S-3MEF', 'S-4', 'S-4 POS', 'S-4EF', 'S-4MEF', 'S-6', 'S-8', 'S-8 POS', 'S-B', 'S-BMEF', 'SBSE', 'SBSE-A', 'SBSE-BD', 'SBSE-C', 'SBSE-W', 'SC 13D', 'SC 13E1', 'SC 13E3', 'SC 13G', 'SC 14D9', 'SC 14F1', 'SC 14N', 'SC TO-C', 'SC TO-I', 'SC TO-T', 'SC13E4F', 'SC14D1F', 'SC14D9C', 'SC14D9F', 'SD', 'SDR', 'SE', 'SEC ACTION', 'SEC STAFF ACTION', 'SEC STAFF LETTER', 'SF-1', 'SF-3', 'SL', 'SP 15D2', 'STOP ORDER', 'SUPPL', 'T-3', 'TA-1', 'TA-2', 'TA-W', 'TACO', 'TH', 'TTW', 'UNDER', 'UPLOAD', 'WDL-REQ', 'X-17A-5']", + "description": "Type of the SEC filing form.", + "default": null, + "optional": true + }, { "name": "cik", "type": "Union[int, str]", @@ -17377,6 +17545,13 @@ } ], "intrinio": [ + { + "name": "filing_url", + "type": "str", + "description": "URL of the filing.", + "default": null, + "optional": true + }, { "name": "company_name", "type": "str", @@ -17860,6 +18035,13 @@ ], "fmp": [], "intrinio": [ + { + "name": "symbol", + "type": "str", + "description": "A Security identifier (Ticker, FIGI, ISIN, CUSIP, Intrinio ID).", + "default": "", + "optional": false + }, { "name": "source", "type": "Literal['iex', 'bats', 'bats_delayed', 'utp_delayed', 'cta_a_delayed', 'cta_b_delayed', 'intrinio_mx', 'intrinio_mx_plus', 'delayed_sip']", @@ -18503,8 +18685,30 @@ "optional": true } ], - "fmp": [], + "fmp": [ + { + "name": "interval", + "type": "Literal['1m', '5m', '15m', '30m', '1h', '4h', '1d']", + "description": "Time interval of the data to return.", + "default": "1d", + "optional": true + } + ], "intrinio": [ + { + "name": "symbol", + "type": "str", + "description": "A Security identifier (Ticker, FIGI, ISIN, CUSIP, Intrinio ID).", + "default": "", + "optional": false + }, + { + "name": "interval", + "type": "Literal['1m', '5m', '10m', '15m', '30m', '60m', '1h', '1d', '1W', '1M', '1Q', '1Y']", + "description": "Time interval of the data to return.", + "default": "1d", + "optional": true + }, { "name": "start_time", "type": "datetime.time", @@ -18535,6 +18739,13 @@ } ], "polygon": [ + { + "name": "interval", + "type": "str", + "description": "Time interval of the data to return. The numeric portion of the interval can be any positive integer. The letter portion can be one of the following: s, m, h, d, W, M, Q, Y", + "default": "1d", + "optional": true + }, { "name": "adjustment", "type": "Literal['splits_only', 'unadjusted']", @@ -18564,8 +18775,23 @@ "optional": true } ], - "tiingo": [], + "tiingo": [ + { + "name": "interval", + "type": "Literal['1d', '1W', '1M', '1Y']", + "description": "Time interval of the data to return.", + "default": "1d", + "optional": true + } + ], "yfinance": [ + { + "name": "interval", + "type": "Literal['1m', '2m', '5m', '15m', '30m', '60m', '90m', '1h', '1d', '5d', '1W', '1M', '1Q']", + "description": "Time interval of the data to return.", + "default": "1d", + "optional": true + }, { "name": "extended_hours", "type": "bool", @@ -19084,7 +19310,15 @@ "optional": true } ], - "fmp": [] + "fmp": [ + { + "name": "symbol", + "type": "str", + "description": "The ticker symbol.", + "default": "", + "optional": false + } + ] }, "model": "PricePerformance" }, @@ -20838,8 +21072,30 @@ "optional": true } ], - "fmp": [], + "fmp": [ + { + "name": "interval", + "type": "Literal['1m', '5m', '15m', '30m', '1h', '4h', '1d']", + "description": "Time interval of the data to return.", + "default": "1d", + "optional": true + } + ], "intrinio": [ + { + "name": "symbol", + "type": "str", + "description": "A Security identifier (Ticker, FIGI, ISIN, CUSIP, Intrinio ID).", + "default": "", + "optional": false + }, + { + "name": "interval", + "type": "Literal['1m', '5m', '10m', '15m', '30m', '60m', '1h', '1d', '1W', '1M', '1Q', '1Y']", + "description": "Time interval of the data to return.", + "default": "1d", + "optional": true + }, { "name": "start_time", "type": "datetime.time", @@ -20870,6 +21126,13 @@ } ], "polygon": [ + { + "name": "interval", + "type": "str", + "description": "Time interval of the data to return. The numeric portion of the interval can be any positive integer. The letter portion can be one of the following: s, m, h, d, W, M, Q, Y", + "default": "1d", + "optional": true + }, { "name": "adjustment", "type": "Literal['splits_only', 'unadjusted']", @@ -20899,8 +21162,23 @@ "optional": true } ], - "tiingo": [], + "tiingo": [ + { + "name": "interval", + "type": "Literal['1d', '1W', '1M', '1Y']", + "description": "Time interval of the data to return.", + "default": "1d", + "optional": true + } + ], "yfinance": [ + { + "name": "interval", + "type": "Literal['1m', '2m', '5m', '15m', '30m', '60m', '90m', '1h', '1d', '5d', '1W', '1M', '1Q']", + "description": "Time interval of the data to return.", + "default": "1d", + "optional": true + }, { "name": "extended_hours", "type": "bool", @@ -22776,7 +23054,15 @@ "optional": true } ], - "fmp": [], + "fmp": [ + { + "name": "symbol", + "type": "str", + "description": "The ticker symbol.", + "default": "", + "optional": false + } + ], "intrinio": [ { "name": "max_annualized", @@ -23149,6 +23435,13 @@ } ], "intrinio": [ + { + "name": "name", + "type": "str", + "description": "The common name for the holding.", + "default": null, + "optional": true + }, { "name": "security_type", "type": "str", @@ -24039,7 +24332,15 @@ "optional": true } ], - "fmp": [] + "fmp": [ + { + "name": "symbol", + "type": "str", + "description": "The ticker symbol.", + "default": "", + "optional": false + } + ] }, "model": "EtfHoldingsPerformance" }, @@ -26070,7 +26371,15 @@ "optional": true } ], - "fmp": [], + "fmp": [ + { + "name": "interval", + "type": "Literal['1m', '5m', '15m', '30m', '1h', '4h', '1d']", + "description": "Time interval of the data to return.", + "default": "1d", + "optional": true + } + ], "intrinio": [ { "name": "limit", @@ -26081,6 +26390,13 @@ } ], "polygon": [ + { + "name": "interval", + "type": "str", + "description": "Time interval of the data to return. The numeric portion of the interval can be any positive integer. The letter portion can be one of the following: s, m, h, d, W, M, Q, Y", + "default": "1d", + "optional": true + }, { "name": "sort", "type": "Literal['asc', 'desc']", @@ -26096,7 +26412,15 @@ "optional": true } ], - "yfinance": [] + "yfinance": [ + { + "name": "interval", + "type": "Literal['1m', '2m', '5m', '15m', '30m', '60m', '90m', '1h', '1d', '5d', '1W', '1M', '1Q']", + "description": "Time interval of the data to return.", + "default": "1d", + "optional": true + } + ] }, "returns": { "OBBject": [ @@ -26254,7 +26578,15 @@ "optional": true } ], - "fmp": [], + "fmp": [ + { + "name": "interval", + "type": "Literal['1m', '5m', '15m', '30m', '1h', '4h', '1d']", + "description": "Time interval of the data to return.", + "default": "1d", + "optional": true + } + ], "intrinio": [ { "name": "limit", @@ -26265,6 +26597,13 @@ } ], "polygon": [ + { + "name": "interval", + "type": "str", + "description": "Time interval of the data to return. The numeric portion of the interval can be any positive integer. The letter portion can be one of the following: s, m, h, d, W, M, Q, Y", + "default": "1d", + "optional": true + }, { "name": "sort", "type": "Literal['asc', 'desc']", @@ -26280,7 +26619,15 @@ "optional": true } ], - "yfinance": [] + "yfinance": [ + { + "name": "interval", + "type": "Literal['1m', '2m', '5m', '15m', '30m', '60m', '90m', '1h', '1d', '5d', '1W', '1M', '1Q']", + "description": "Time interval of the data to return.", + "default": "1d", + "optional": true + } + ] }, "returns": { "OBBject": [ @@ -26417,7 +26764,15 @@ "optional": true } ], - "fmp": [] + "fmp": [ + { + "name": "symbol", + "type": "Literal['dowjones', 'sp500', 'nasdaq']", + "description": "None", + "default": "dowjones", + "optional": true + } + ] }, "returns": { "OBBject": [ @@ -27387,6 +27742,13 @@ } ], "benzinga": [ + { + "name": "images", + "type": "List[Dict[str, str]]", + "description": "URL to the images of the news.", + "default": null, + "optional": true + }, { "name": "id", "type": "str", diff --git a/openbb_platform/openbb/package/crypto_price.py b/openbb_platform/openbb/package/crypto_price.py index 7c3bedbb362..bbd332f8d18 100644 --- a/openbb_platform/openbb/package/crypto_price.py +++ b/openbb_platform/openbb/package/crypto_price.py @@ -137,12 +137,10 @@ class ROUTER_crypto_price(Container): extra_params=kwargs, info={ "symbol": { - "multiple_items_allowed": [ - "fmp", - "polygon", - "tiingo", - "yfinance", - ] + "fmp": {"multiple_items_allowed": True}, + "polygon": {"multiple_items_allowed": True}, + "tiingo": {"multiple_items_allowed": True}, + "yfinance": {"multiple_items_allowed": True}, } }, ) diff --git a/openbb_platform/openbb/package/currency.py b/openbb_platform/openbb/package/currency.py index 05c7b823969..ba7d31d21cb 100644 --- a/openbb_platform/openbb/package/currency.py +++ b/openbb_platform/openbb/package/currency.py @@ -290,6 +290,11 @@ class ROUTER_currency(Container): "counter_currencies": counter_currencies, }, extra_params=kwargs, - info={"base": {"multiple_items_allowed": ["fmp", "polygon"]}}, + info={ + "base": { + "fmp": {"multiple_items_allowed": True}, + "polygon": {"multiple_items_allowed": True}, + } + }, ) ) diff --git a/openbb_platform/openbb/package/currency_price.py b/openbb_platform/openbb/package/currency_price.py index 396977d0443..251e422f05d 100644 --- a/openbb_platform/openbb/package/currency_price.py +++ b/openbb_platform/openbb/package/currency_price.py @@ -140,12 +140,10 @@ class ROUTER_currency_price(Container): extra_params=kwargs, info={ "symbol": { - "multiple_items_allowed": [ - "fmp", - "polygon", - "tiingo", - "yfinance", - ] + "fmp": {"multiple_items_allowed": True}, + "polygon": {"multiple_items_allowed": True}, + "tiingo": {"multiple_items_allowed": True}, + "yfinance": {"multiple_items_allowed": True}, } }, ) diff --git a/openbb_platform/openbb/package/economy.py b/openbb_platform/openbb/package/economy.py index 56deffca0aa..dca7a2a489c 100644 --- a/openbb_platform/openbb/package/economy.py +++ b/openbb_platform/openbb/package/economy.py @@ -237,7 +237,9 @@ class ROUTER_economy(Container): "end_date": end_date, }, extra_params=kwargs, - info={"country": {"multiple_items_allowed": ["tradingeconomics"]}}, + info={ + "country": {"tradingeconomics": {"multiple_items_allowed": True}} + }, ) ) @@ -430,7 +432,7 @@ class ROUTER_economy(Container): "country": country, }, extra_params=kwargs, - info={"country": {"multiple_items_allowed": ["econdb"]}}, + info={"country": {"econdb": {"multiple_items_allowed": True}}}, ) ) @@ -603,7 +605,7 @@ class ROUTER_economy(Container): "end_date": end_date, }, extra_params=kwargs, - info={"country": {"multiple_items_allowed": ["fred"]}}, + info={"country": {"fred": {"multiple_items_allowed": True}}}, ) ) @@ -1024,7 +1026,7 @@ class ROUTER_economy(Container): "limit": limit, }, extra_params=kwargs, - info={"symbol": {"multiple_items_allowed": ["fred"]}}, + info={"symbol": {"fred": {"multiple_items_allowed": True}}}, ) ) @@ -1154,8 +1156,8 @@ class ROUTER_economy(Container): }, extra_params=kwargs, info={ - "symbol": {"multiple_items_allowed": ["econdb"]}, - "country": {"multiple_items_allowed": ["econdb"]}, + "symbol": {"econdb": {"multiple_items_allowed": True}}, + "country": {"econdb": {"multiple_items_allowed": True}}, }, ) ) diff --git a/openbb_platform/openbb/package/equity.py b/openbb_platform/openbb/package/equity.py index 07564859dbb..c67112ac8a1 100644 --- a/openbb_platform/openbb/package/equity.py +++ b/openbb_platform/openbb/package/equity.py @@ -436,7 +436,9 @@ class ROUTER_equity(Container): extra_params=kwargs, info={ "symbol": { - "multiple_items_allowed": ["fmp", "intrinio", "yfinance"] + "fmp": {"multiple_items_allowed": True}, + "intrinio": {"multiple_items_allowed": True}, + "yfinance": {"multiple_items_allowed": True}, } }, ) diff --git a/openbb_platform/openbb/package/equity_estimates.py b/openbb_platform/openbb/package/equity_estimates.py index 36212035e8b..01b95add7a5 100644 --- a/openbb_platform/openbb/package/equity_estimates.py +++ b/openbb_platform/openbb/package/equity_estimates.py @@ -222,11 +222,11 @@ class ROUTER_equity_estimates(Container): }, extra_params=kwargs, info={ - "analyst_name": {"multiple_items_allowed": ["benzinga"]}, - "firm_name": {"multiple_items_allowed": ["benzinga"]}, - "analyst_ids": {"multiple_items_allowed": ["benzinga"]}, - "firm_ids": {"multiple_items_allowed": ["benzinga"]}, - "fields": {"multiple_items_allowed": ["benzinga"]}, + "analyst_name": {"benzinga": {"multiple_items_allowed": True}}, + "firm_name": {"benzinga": {"multiple_items_allowed": True}}, + "analyst_ids": {"benzinga": {"multiple_items_allowed": True}}, + "firm_ids": {"benzinga": {"multiple_items_allowed": True}}, + "fields": {"benzinga": {"multiple_items_allowed": True}}, }, ) ) @@ -336,7 +336,9 @@ class ROUTER_equity_estimates(Container): extra_params=kwargs, info={ "symbol": { - "multiple_items_allowed": ["fmp", "intrinio", "yfinance"] + "fmp": {"multiple_items_allowed": True}, + "intrinio": {"multiple_items_allowed": True}, + "yfinance": {"multiple_items_allowed": True}, } }, ) @@ -457,7 +459,12 @@ class ROUTER_equity_estimates(Container): "symbol": symbol, }, extra_params=kwargs, - info={"symbol": {"multiple_items_allowed": ["fmp", "intrinio"]}}, + info={ + "symbol": { + "fmp": {"multiple_items_allowed": True}, + "intrinio": {"multiple_items_allowed": True}, + } + }, ) ) @@ -580,7 +587,7 @@ class ROUTER_equity_estimates(Container): "symbol": symbol, }, extra_params=kwargs, - info={"symbol": {"multiple_items_allowed": ["intrinio"]}}, + info={"symbol": {"intrinio": {"multiple_items_allowed": True}}}, ) ) @@ -698,7 +705,7 @@ class ROUTER_equity_estimates(Container): "symbol": symbol, }, extra_params=kwargs, - info={"symbol": {"multiple_items_allowed": ["fmp"]}}, + info={"symbol": {"fmp": {"multiple_items_allowed": True}}}, ) ) @@ -854,6 +861,11 @@ class ROUTER_equity_estimates(Container): "limit": limit, }, extra_params=kwargs, - info={"symbol": {"multiple_items_allowed": ["benzinga", "fmp"]}}, + info={ + "symbol": { + "benzinga": {"multiple_items_allowed": True}, + "fmp": {"multiple_items_allowed": True}, + } + }, ) ) diff --git a/openbb_platform/openbb/package/equity_fundamental.py b/openbb_platform/openbb/package/equity_fundamental.py index 4606e106d1e..cc734d0f02a 100644 --- a/openbb_platform/openbb/package/equity_fundamental.py +++ b/openbb_platform/openbb/package/equity_fundamental.py @@ -1421,8 +1421,8 @@ class ROUTER_equity_fundamental(Container): }, extra_params=kwargs, info={ - "symbol": {"multiple_items_allowed": ["intrinio"]}, - "tag": {"multiple_items_allowed": ["intrinio"]}, + "symbol": {"intrinio": {"multiple_items_allowed": True}}, + "tag": {"intrinio": {"multiple_items_allowed": True}}, }, ) ) @@ -2165,8 +2165,8 @@ class ROUTER_equity_fundamental(Container): }, extra_params=kwargs, info={ - "symbol": {"multiple_items_allowed": ["intrinio"]}, - "tag": {"multiple_items_allowed": ["intrinio"]}, + "symbol": {"intrinio": {"multiple_items_allowed": True}}, + "tag": {"intrinio": {"multiple_items_allowed": True}}, }, ) ) @@ -2351,7 +2351,7 @@ class ROUTER_equity_fundamental(Container): "symbol": symbol, }, extra_params=kwargs, - info={"symbol": {"multiple_items_allowed": ["fmp"]}}, + info={"symbol": {"fmp": {"multiple_items_allowed": True}}}, ) ) @@ -2670,7 +2670,9 @@ class ROUTER_equity_fundamental(Container): extra_params=kwargs, info={ "symbol": { - "multiple_items_allowed": ["fmp", "intrinio", "yfinance"] + "fmp": {"multiple_items_allowed": True}, + "intrinio": {"multiple_items_allowed": True}, + "yfinance": {"multiple_items_allowed": True}, } }, ) @@ -2864,7 +2866,7 @@ class ROUTER_equity_fundamental(Container): "symbol": symbol, }, extra_params=kwargs, - info={"symbol": {"multiple_items_allowed": ["fmp"]}}, + info={"symbol": {"fmp": {"multiple_items_allowed": True}}}, ) ) diff --git a/openbb_platform/openbb/package/equity_ownership.py b/openbb_platform/openbb/package/equity_ownership.py index 45fd01edb5f..c9806627f8e 100644 --- a/openbb_platform/openbb/package/equity_ownership.py +++ b/openbb_platform/openbb/package/equity_ownership.py @@ -685,6 +685,6 @@ class ROUTER_equity_ownership(Container): "symbol": symbol, }, extra_params=kwargs, - info={"symbol": {"multiple_items_allowed": ["yfinance"]}}, + info={"symbol": {"yfinance": {"multiple_items_allowed": True}}}, ) ) diff --git a/openbb_platform/openbb/package/equity_price.py b/openbb_platform/openbb/package/equity_price.py index a174d0b9e4b..a4327717d3d 100644 --- a/openbb_platform/openbb/package/equity_price.py +++ b/openbb_platform/openbb/package/equity_price.py @@ -186,12 +186,10 @@ class ROUTER_equity_price(Container): extra_params=kwargs, info={ "symbol": { - "multiple_items_allowed": [ - "fmp", - "polygon", - "tiingo", - "yfinance", - ] + "fmp": {"multiple_items_allowed": True}, + "polygon": {"multiple_items_allowed": True}, + "tiingo": {"multiple_items_allowed": True}, + "yfinance": {"multiple_items_allowed": True}, }, "adjusted": {"deprecated": True}, "prepost": {"deprecated": True}, @@ -405,7 +403,7 @@ class ROUTER_equity_price(Container): "symbol": symbol, }, extra_params=kwargs, - info={"symbol": {"multiple_items_allowed": ["fmp"]}}, + info={"symbol": {"fmp": {"multiple_items_allowed": True}}}, ) ) @@ -579,7 +577,9 @@ class ROUTER_equity_price(Container): extra_params=kwargs, info={ "symbol": { - "multiple_items_allowed": ["fmp", "intrinio", "yfinance"] + "fmp": {"multiple_items_allowed": True}, + "intrinio": {"multiple_items_allowed": True}, + "yfinance": {"multiple_items_allowed": True}, } }, ) diff --git a/openbb_platform/openbb/package/etf.py b/openbb_platform/openbb/package/etf.py index 0c30a66ca2b..5609ba55016 100644 --- a/openbb_platform/openbb/package/etf.py +++ b/openbb_platform/openbb/package/etf.py @@ -98,7 +98,7 @@ class ROUTER_etf(Container): "symbol": symbol, }, extra_params=kwargs, - info={"symbol": {"multiple_items_allowed": ["fmp"]}}, + info={"symbol": {"fmp": {"multiple_items_allowed": True}}}, ) ) @@ -180,7 +180,7 @@ class ROUTER_etf(Container): "symbol": symbol, }, extra_params=kwargs, - info={"symbol": {"multiple_items_allowed": ["fmp"]}}, + info={"symbol": {"fmp": {"multiple_items_allowed": True}}}, ) ) @@ -350,12 +350,10 @@ class ROUTER_etf(Container): extra_params=kwargs, info={ "symbol": { - "multiple_items_allowed": [ - "fmp", - "polygon", - "tiingo", - "yfinance", - ] + "fmp": {"multiple_items_allowed": True}, + "polygon": {"multiple_items_allowed": True}, + "tiingo": {"multiple_items_allowed": True}, + "yfinance": {"multiple_items_allowed": True}, }, "adjusted": {"deprecated": True}, "prepost": {"deprecated": True}, @@ -805,7 +803,7 @@ class ROUTER_etf(Container): "symbol": symbol, }, extra_params=kwargs, - info={"symbol": {"multiple_items_allowed": ["fmp"]}}, + info={"symbol": {"fmp": {"multiple_items_allowed": True}}}, ) ) @@ -1195,7 +1193,9 @@ class ROUTER_etf(Container): extra_params=kwargs, info={ "symbol": { - "multiple_items_allowed": ["fmp", "intrinio", "yfinance"] + "fmp": {"multiple_items_allowed": True}, + "intrinio": {"multiple_items_allowed": True}, + "yfinance": {"multiple_items_allowed": True}, } }, ) @@ -1336,7 +1336,12 @@ class ROUTER_etf(Container): "symbol": symbol, }, extra_params=kwargs, - info={"symbol": {"multiple_items_allowed": ["fmp", "intrinio"]}}, + info={ + "symbol": { + "fmp": {"multiple_items_allowed": True}, + "intrinio": {"multiple_items_allowed": True}, + } + }, ) ) diff --git a/openbb_platform/openbb/package/fixedincome_corporate.py b/openbb_platform/openbb/package/fixedincome_corporate.py index 7f3a1e19957..47da6e18862 100644 --- a/openbb_platform/openbb/package/fixedincome_corporate.py +++ b/openbb_platform/openbb/package/fixedincome_corporate.py @@ -514,8 +514,8 @@ class ROUTER_fixedincome_corporate(Container): }, extra_params=kwargs, info={ - "maturity": {"multiple_items_allowed": ["fred"]}, - "category": {"multiple_items_allowed": ["fred"]}, + "maturity": {"fred": {"multiple_items_allowed": True}}, + "category": {"fred": {"multiple_items_allowed": True}}, }, ) ) diff --git a/openbb_platform/openbb/package/index.py b/openbb_platform/openbb/package/index.py index babec4f8c96..46f5881f8b4 100644 --- a/openbb_platform/openbb/package/index.py +++ b/openbb_platform/openbb/package/index.py @@ -300,12 +300,10 @@ class ROUTER_index(Container): extra_params=kwargs, info={ "symbol": { - "multiple_items_allowed": [ - "fmp", - "intrinio", - "polygon", - "yfinance", - ] + "fmp": {"multiple_items_allowed": True}, + "intrinio": {"multiple_items_allowed": True}, + "polygon": {"multiple_items_allowed": True}, + "yfinance": {"multiple_items_allowed": True}, } }, ) diff --git a/openbb_platform/openbb/package/news.py b/openbb_platform/openbb/package/news.py index d951f6be51b..b0e65cd2ab2 100644 --- a/openbb_platform/openbb/package/news.py +++ b/openbb_platform/openbb/package/news.py @@ -236,14 +236,12 @@ class ROUTER_news(Container): extra_params=kwargs, info={ "symbol": { - "multiple_items_allowed": [ - "benzinga", - "fmp", - "intrinio", - "polygon", - "tiingo", - "yfinance", - ] + "benzinga": {"multiple_items_allowed": True}, + "fmp": {"multiple_items_allowed": True}, + "intrinio": {"multiple_items_allowed": True}, + "polygon": {"multiple_items_allowed": True}, + "tiingo": {"multiple_items_allowed": True}, + "yfinance": {"multiple_items_allowed": True}, } }, ) diff --git a/openbb_platform/providers/alpha_vantage/openbb_alpha_vantage/models/equity_historical.py b/openbb_platform/providers/alpha_vantage/openbb_alpha_vantage/models/equity_historical.py index 91e20c2d726..e7b663d64bd 100644 --- a/openbb_platform/providers/alpha_vantage/openbb_alpha_vantage/models/equity_historical.py +++ b/openbb_platform/providers/alpha_vantage/openbb_alpha_vantage/models/equity_historical.py @@ -43,7 +43,7 @@ class AVEquityHistoricalQueryParams(EquityHistoricalQueryParams): Source: https://www.alphavantage.co/documentation/#time-series-data """ - __json_schema_extra__ = {"symbol": ["multiple_items_allowed"]} + __json_schema_extra__ = {"symbol": {"multiple_items_allowed": True}} interval: Literal["1m", "5m", "15m", "30m", "60m", "1d", "1W", "1M"] = Field( default="1d", diff --git a/openbb_platform/providers/alpha_vantage/openbb_alpha_vantage/models/historical_eps.py b/openbb_platform/providers/alpha_vantage/openbb_alpha_vantage/models/historical_eps.py index ccb38ec5f6f..dc1a7d23c07 100644 --- a/openbb_platform/providers/alpha_vantage/openbb_alpha_vantage/models/historical_eps.py +++ b/openbb_platform/providers/alpha_vantage/openbb_alpha_vantage/models/historical_eps.py @@ -30,7 +30,7 @@ class AlphaVantageHistoricalEpsQueryParams(HistoricalEpsQueryParams): Source: https://www.alphavantage.co/documentation/#earnings """ - __json_schema_extra__ = {"symbol": ["multiple_items_allowed"]} + __json_schema_extra__ = {"symbol": {"multiple_items_allowed": True}} period: Literal["annual", "quarter"] = Field( default="quarter", description=QUERY_DESCRIPTIONS.get("period", "") diff --git a/openbb_platform/providers/benzinga/openbb_benzinga/models/analyst_search.py b/openbb_platform/providers/benzinga/openbb_benzinga/models/analyst_search.py index c4aeba33416..f95f5345bf3 100644 --- a/openbb_platform/providers/benzinga/openbb_benzinga/models/analyst_search.py +++ b/openbb_platform/providers/benzinga/openbb_benzinga/models/analyst_search.py @@ -34,11 +34,11 @@ class BenzingaAnalystSearchQueryParams(AnalystSearchQueryParams): "limit": "pageSize", } __json_schema_extra__ = { - "analyst_name": ["multiple_items_allowed"], - "firm_name": ["multiple_items_allowed"], - "analyst_ids": ["multiple_items_allowed"], - "firm_ids": ["multiple_items_allowed"], - "fields": ["multiple_items_allowed"], + "analyst_name": {"multiple_items_allowed": True}, + "firm_name": {"multiple_items_allowed": True}, + "analyst_ids": {"multiple_items_allowed": True}, + "firm_ids": {"multiple_items_allowed": True}, + "fields": {"multiple_items_allowed": True}, } analyst_ids: Optional[str] = Field( diff --git a/openbb_platform/providers/benzinga/openbb_benzinga/models/company_news.py b/openbb_platform/providers/benzinga/openbb_benzinga/models/company_news.py index eb7723da3dd..ddeda769657 100644 --- a/openbb_platform/providers/benzinga/openbb_benzinga/models/company_news.py +++ b/openbb_platform/providers/benzinga/openbb_benzinga/models/company_news.py @@ -32,7 +32,7 @@ class BenzingaCompanyNewsQueryParams(CompanyNewsQueryParams): "updated_since": "updatedSince", "published_since": "publishedSince", } - __json_schema_extra__ = {"symbol": ["multiple_items_allowed"]} + __json_schema_extra__ = {"symbol": {"multiple_items_allowed": True}} date: Optional[dateType] = Field( default=None, description=QUERY_DESCRIPTIONS.get("date", "") @@ -152,10 +152,11 @@ class BenzingaCompanyNewsFetcher( base_url = "https://api.benzinga.com/api/v2/news" - query.sort = f"{query.sort}:{query.order}" if query.sort and query.order else "" - querystring = get_querystring( - query.model_dump(by_alias=True), ["order", "pageSize"] + model = query.model_dump(by_alias=True) + model["sort"] = ( + f"{query.sort}:{query.order}" if query.sort and query.order else "" ) + querystring = get_querystring(model, ["order", "pageSize"]) pages = math.ceil(query.limit / 100) if query.limit else 1 page_size = 100 if query.limit and query.limit > 100 else query.limit diff --git a/openbb_platform/providers/benzinga/openbb_benzinga/models/price_target.py b/openbb_platform/providers/benzinga/openbb_benzinga/models/price_target.py index d799e3410d8..49666ac18c5 100644 --- a/openbb_platform/providers/benzinga/openbb_benzinga/models/price_target.py +++ b/openbb_platform/providers/benzinga/openbb_benzinga/models/price_target.py @@ -49,7 +49,7 @@ class BenzingaPriceTargetQueryParams(PriceTargetQueryParams): "limit": "pagesize", "symbol": "parameters[tickers]", } - __json_schema_extra__ = {"symbol": ["multiple_items_allowed"]} + __json_schema_extra__ = {"symbol": {"multiple_items_allowed": True}} page: Optional[int] = Field( default=0, diff --git a/openbb_platform/providers/cboe/openbb_cboe/models/equity_historical.py b/openbb_platform/providers/cboe/openbb_cboe/models/equity_historical.py index c74afc3430a..67a7423211e 100644 --- a/openbb_platform/providers/cboe/openbb_cboe/models/equity_historical.py +++ b/openbb_platform/providers/cboe/openbb_cboe/models/equity_historical.py @@ -30,7 +30,7 @@ class CboeEquityHistoricalQueryParams(EquityHistoricalQueryParams): Source: https://www.cboe.com/ """ - __json_schema_extra__ = {"symbol": ["multiple_items_allowed"]} + __json_schema_extra__ = {"symbol": {"multiple_items_allowed": True}} interval: Literal["1m", "1d"] = Field( default="1d", @@ -141,7 +141,7 @@ class CboeEquityHistoricalFetcher( return url urls = [ - _generate_historical_prices_url(symbol, INTERVAL_DICT[query.interval]) + _generate_historical_prices_url(symbol, INTERVAL_DICT[query.interval]) # type: ignore[arg-type] for symbol in symbols ] return await amake_requests(urls, **kwargs) @@ -199,7 +199,7 @@ class CboeEquityHistoricalFetcher( (to_datetime(output["date"]) >= to_datetime(query.start_date)) & ( to_datetime(output["date"]) - <= to_datetime(query.end_date + timedelta(days=1)) + <= to_datetime(query.end_date + timedelta(days=1)) # type: ignore[operator] ) ] return [ diff --git a/openbb_platform/providers/cboe/openbb_cboe/models/equity_quote.py b/openbb_platform/providers/cboe/openbb_cboe/models/equity_quote.py index bd311c5d2d4..b62ae9f4a95 100644 --- a/openbb_platform/providers/cboe/openbb_cboe/models/equity_quote.py +++ b/openbb_platform/providers/cboe/openbb_cboe/models/equity_quote.py @@ -25,7 +25,7 @@ class CboeEquityQuoteQueryParams(EquityQuoteQueryParams): Source: https://www.cboe.com/ """ - __json_schema_extra__ = {"symbol": ["multiple_items_allowed"]} + __json_schema_extra__ = {"symbol": {"multiple_items_allowed": True}} use_cache: bool = Field( default=True, diff --git a/openbb_platform/providers/cboe/openbb_cboe/models/index_historical.py b/openbb_platform/providers/cboe/openbb_cboe/models/index_historical.py index ce468e2eafc..01340b4076e 100644 --- a/openbb_platform/providers/cboe/openbb_cboe/models/index_historical.py +++ b/openbb_platform/providers/cboe/openbb_cboe/models/index_historical.py @@ -28,7 +28,7 @@ class CboeIndexHistoricalQueryParams(IndexHistoricalQueryParams): Source: https://www.cboe.com/ """ - __json_schema_extra__ = {"symbol": ["multiple_items_allowed"]} + __json_schema_extra__ = {"symbol": {"multiple_items_allowed": True}} interval: Literal["1m", "1d"] = Field( default="1d", @@ -139,7 +139,7 @@ class CboeIndexHistoricalFetcher( ) url += f"{symbol.replace('^', '')}.json" else: - base_url: str = ( + base_url: str = ( # type: ignore[no-redef] f"https://cdn.cboe.com/api/global/delayed_quotes/charts/{interval_type}" ) url = ( @@ -152,7 +152,7 @@ class CboeIndexHistoricalFetcher( return url urls = [ - _generate_historical_prices_url(symbol, INTERVAL_DICT[query.interval]) + _generate_historical_prices_url(symbol, INTERVAL_DICT[query.interval]) # type: ignore[arg-type] for symbol in symbols ] @@ -205,7 +205,7 @@ class CboeIndexHistoricalFetcher( (to_datetime(output["date"]) >= to_datetime(query.start_date)) & ( to_datetime(output["date"]) - <= to_datetime(query.end_date + timedelta(days=1)) + <= to_datetime(query.end_date + timedelta(days=1)) # type: ignore[operator] ) ] return [ diff --git a/openbb_platform/providers/econdb/openbb_econdb/models/country_profile.py b/openbb_platform/providers/econdb/openbb_econdb/models/country_profile.py index 20d15600038..00267d8e3de 100644 --- a/openbb_platform/providers/econdb/openbb_econdb/models/country_profile.py +++ b/openbb_platform/providers/econdb/openbb_econdb/models/country_profile.py @@ -27,7 +27,7 @@ from pydantic import Field, field_validator class EconDbCountryProfileQueryParams(CountryProfileQueryParams): """Country Profile Query.""" - __json_schema_extra__ = {"country": ["multiple_items_allowed"]} + __json_schema_extra__ = {"country": {"multiple_items_allowed": True}} latest: bool = Field( default=True, diff --git a/openbb_platform/providers/econdb/openbb_econdb/models/economic_indicators.py b/openbb_platform/providers/econdb/openbb_econdb/models/economic_indicators.py index 3bea1e58cc6..d2b48bd7f99 100644 --- a/openbb_platform/providers/econdb/openbb_econdb/models/economic_indicators.py +++ b/openbb_platform/providers/econdb/openbb_econdb/models/economic_indicators.py @@ -25,8 +25,8 @@ class EconDbEconomicIndicatorsQueryParams(EconomicIndicatorsQueryParams): """EconDB Economic Indicators Query.""" __json_schema_extra__ = { - "symbol": ["multiple_items_allowed"], - "country": ["multiple_items_allowed"], + "symbol": {"multiple_items_allowed": True}, + "country": {"multiple_items_allowed": True}, } transform: Union[None, Literal["toya", "tpop", "tusd", "tpgp"]] = Field( diff --git a/openbb_platform/providers/finviz/openbb_finviz/models/equity_profile.py b/openbb_platform/providers/finviz/openbb_finviz/models/equity_profile.py index a81fe6c5085..8715c9078a3 100644 --- a/openbb_platform/providers/finviz/openbb_finviz/models/equity_profile.py +++ b/openbb_platform/providers/finviz/openbb_finviz/models/equity_profile.py @@ -21,7 +21,7 @@ class FinvizEquityProfileQueryParams(EquityInfoQueryParams): Source: https://finviz.com/screener.ashx """ - __json_schema_extra__ = {"symbol": ["multiple_items_allowed"]} + __json_schema_extra__ = {"symbol": {"multiple_items_allowed": True}} class FinvizEquityProfileData(EquityInfoData): diff --git a/openbb_platform/providers/finviz/openbb_finviz/models/key_metrics.py b/openbb_platform/providers/finviz/openbb_finviz/models/key_metrics.py index 9ff3a002ed3..7957c68d1ec 100644 --- a/openbb_platform/providers/finviz/openbb_finviz/models/key_metrics.py +++ b/openbb_platform/providers/finviz/openbb_finviz/models/key_metrics.py @@ -22,7 +22,7 @@ class FinvizKeyMetricsQueryParams(KeyMetricsQueryParams): Source: https://finviz.com/screener.ashx """ - __json_schema_extra__ = {"symbol": ["multiple_items_allowed"]} + __json_schema_extra__ = {"symbol": {"multiple_items_allowed": True}} class FinvizKeyMetricsData(KeyMetricsData): diff --git a/openbb_platform/providers/finviz/openbb_finviz/models/price_performance.py b/openbb_platform/providers/finviz/openbb_finviz/models/price_performance.py index 020c43f8852..8a9cea94b0c 100644 --- a/openbb_platform/providers/finviz/openbb_finviz/models/price_performance.py +++ b/openbb_platform/providers/finviz/openbb_finviz/models/price_performance.py @@ -21,7 +21,7 @@ class FinvizPricePerformanceQueryParams(RecentPerformanceQueryParams): Source: https://finviz.com/screener.ashx """ - __json_schema_extra__ = {"symbol": ["multiple_items_allowed"]} + __json_schema_extra__ = {"symbol": {"multiple_items_allowed": True}} class FinvizPricePerformanceData(RecentPerformanceData): diff --git a/openbb_platform/providers/finviz/openbb_finviz/models/price_target.py b/openbb_platform/providers/finviz/openbb_finviz/models/price_target.py index e33c04037dd..74792b03951 100644 --- a/openbb_platform/providers/finviz/openbb_finviz/models/price_target.py +++ b/openbb_platform/providers/finviz/openbb_finviz/models/price_target.py @@ -23,7 +23,7 @@ class FinvizPriceTargetQueryParams(PriceTargetQueryParams): Source: https://finviz.com/quote.ashx? """ - __json_schema_extra__ = {"symbol": ["multiple_items_allowed"]} + __json_schema_extra__ = {"symbol": {"multiple_items_allowed": True}} class FinvizPriceTargetData(PriceTargetData): @@ -67,12 +67,12 @@ class FinvizPriceTargetFetcher( ) -> List[Dict]: """Return the raw data from the Finviz endpoint.""" - results = [] + results: List[dict] = [] def get_one(symbol) -> List[Dict]: """Get the data for one symbol.""" price_targets = DataFrame() - result = [] + result: List[dict] = [] try: data = finvizfinance(symbol) price_targets = data.ticker_outer_ratings() @@ -100,7 +100,7 @@ class FinvizPriceTargetFetcher( result = price_targets.to_dict(orient="records") return result - symbols = query.symbol.split(",") + symbols = query.symbol.split(",") if query.symbol else [] for symbol in symbols: result = get_one(symbol) if result is not None and result != []: diff --git a/openbb_platform/providers/fmp/openbb_fmp/models/analyst_estimates.py b/openbb_platform/providers/fmp/openbb_fmp/models/analyst_estimates.py index 6d1e5c9e335..391a4080e56 100644 --- a/openbb_platform/providers/fmp/openbb_fmp/models/analyst_estimates.py +++ b/openbb_platform/providers/fmp/openbb_fmp/models/analyst_estimates.py @@ -22,7 +22,7 @@ class FMPAnalystEstimatesQueryParams(AnalystEstimatesQueryParams): Source: https://site.financialmodelingprep.com/developer/docs/analyst-estimates-api/ """ - __json_schema_extra__ = {"symbol": ["multiple_items_allowed"]} + __json_schema_extra__ = {"symbol": {"multiple_items_allowed": True}} period: Literal["quarter", "annual"] = Field( default="annual", description=QUERY_DESCRIPTIONS.get("period", "") @@ -60,7 +60,7 @@ class FMPAnalystEstimatesFetcher( symbols = query.symbol.split(",") # type: ignore - results = [] + results: List[dict] = [] async def get_one(symbol): """Get data for one symbol.""" diff --git a/openbb_platform/providers/fmp/openbb_fmp/models/company_news.py b/openbb_platform/providers/fmp/openbb_fmp/models/company_news.py index b773a0177d8..13d62a26904 100644 --- a/openbb_platform/providers/fmp/openbb_fmp/models/company_news.py +++ b/openbb_platform/providers/fmp/openbb_fmp/models/company_news.py @@ -19,7 +19,7 @@ class FMPCompanyNewsQueryParams(CompanyNewsQueryParams): Source: https://site.financialmodelingprep.com/developer/docs/stock-news-api/ """ - __json_schema_extra__ = {"symbol": ["multiple_items_allowed"]} + __json_schema_extra__ = {"symbol": {"multiple_items_allowed": True}} page: Optional[int] = Field( default=0, diff --git a/openbb_platform/providers/fmp/openbb_fmp/models/crypto_historical.py b/openbb_platform/providers/fmp/openbb_fmp/models/crypto_historical.py index 8486d46f69a..ad528255c0d 100644 --- a/openbb_platform/providers/fmp/openbb_fmp/models/crypto_historical.py +++ b/openbb_platform/providers/fmp/openbb_fmp/models/crypto_historical.py @@ -35,7 +35,7 @@ class FMPCryptoHistoricalQueryParams(CryptoHistoricalQueryParams): """ __alias_dict__ = {"start_date": "from", "end_date": "to"} - __json_schema_extra__ = {"symbol": ["multiple_items_allowed"]} + __json_schema_extra__ = {"symbol": {"multiple_items_allowed": True}} interval: Literal["1m", "5m", "15m", "30m", "1h", "4h", "1d"] = Field( default="1d", description=QUERY_DESCRIPTIONS.get("interval", "") diff --git a/openbb_platform/providers/fmp/openbb_fmp/models/currency_historical.py b/openbb_platform/providers/fmp/openbb_fmp/models/currency_historical.py index 02fceedc5ee..697c3d0395d 100644 --- a/openbb_platform/providers/fmp/openbb_fmp/models/currency_historical.py +++ b/openbb_platform/providers/fmp/openbb_fmp/models/currency_historical.py @@ -33,7 +33,7 @@ class FMPCurrencyHistoricalQueryParams(CurrencyHistoricalQueryParams): """ __alias_dict__ = {"start_date": "from", "end_date": "to"} - __json_schema_extra__ = {"symbol": ["multiple_items_allowed"]} + __json_schema_extra__ = {"symbol": {"multiple_items_allowed": True}} interval: Literal["1m", "5m", "15m", "30m", "1h", "4h", "1d"] = Field( default="1d", description=QUERY_DESCRIPTIONS.get("interval", "") diff --git a/openbb_platform/providers/fmp/openbb_fmp/models/currency_snapshots.py b/openbb_platform/providers/fmp/openbb_fmp/models/currency_snapshots.py index 6276e23ed73..dcc34f6beb4 100644 --- a/openbb_platform/providers/fmp/openbb_fmp/models/currency_snapshots.py +++ b/openbb_platform/providers/fmp/openbb_fmp/models/currency_snapshots.py @@ -25,7 +25,7 @@ class FMPCurrencySnapshotsQueryParams(CurrencySnapshotsQueryParams): Source: https://site.financialmodelingprep.com/developer/docs#exchange-prices-quote """ - __json_schema_extra__ = {"base": ["multiple_items_allowed"]} + __json_schema_extra__ = {"base": {"multiple_items_allowed": True}} class FMPCurrencySnapshotsData(CurrencySnapshotsData): diff --git a/openbb_platform/providers/fmp/openbb_fmp/models/equity_historical.py b/openbb_platform/providers/fmp/openbb_fmp/models/equity_historical.py index 5225a0daa18..fa4660c25ff 100644 --- a/openbb_platform/providers/fmp/openbb_fmp/models/equity_historical.py +++ b/openbb_platform/providers/fmp/openbb_fmp/models/equity_historical.py @@ -33,7 +33,7 @@ class FMPEquityHistoricalQueryParams(EquityHistoricalQueryParams): """ __alias_dict__ = {"start_date": "from", "end_date": "to"} - __json_schema_extra__ = {"symbol": ["multiple_items_allowed"]} + __json_schema_extra__ = {"symbol": {"multiple_items_allowed": True}} interval: Literal["1m", "5m", "15m", "30m", "1h", "4h", "1d"] = Field( default="1d", description=QUERY_DESCRIPTIONS.get("interval", "") diff --git a/openbb_platform/providers/fmp/openbb_fmp/models/equity_profile.py b/openbb_platform/providers/fmp/openbb_fmp/models/equity_profile.py index 95a460fff79..015e3ad2497 100644 --- a/openbb_platform/providers/fmp/openbb_fmp/models/equity_profile.py +++ b/openbb_platform/providers/fmp/openbb_fmp/models/equity_profile.py @@ -27,7 +27,7 @@ class FMPEquityProfileQueryParams(EquityInfoQueryParams): Source: https://site.financialmodelingprep.com/developer/docs/companies-key-stats-free-api/ """ - __json_schema_extra__ = {"symbol": ["multiple_items_allowed"]} + __json_schema_extra__ = {"symbol": {"multiple_items_allowed": True}} class FMPEquityProfileData(EquityInfoData): @@ -48,7 +48,7 @@ class FMPEquityProfileData(EquityInfoData): "long_description": "description", "first_stock_price_date": "ipoDate", } - __json_schema_extra__ = {"symbol": ["multiple_items_allowed"]} + __json_schema_extra__ = {"symbol": {"multiple_items_allowed": True}} is_etf: bool = Field(description="If the symbol is an ETF.") is_actively_trading: bool = Field(description="If the company is actively trading.") diff --git a/openbb_platform/providers/fmp/openbb_fmp/models/equity_quote.py b/openbb_platform/providers/fmp/openbb_fmp/models/equity_quote.py index 3830466770a..824c9a31eaf 100644 --- a/openbb_platform/providers/fmp/openbb_fmp/models/equity_quote.py +++ b/openbb_platform/providers/fmp/openbb_fmp/models/equity_quote.py @@ -29,7 +29,7 @@ class FMPEquityQuoteQueryParams(EquityQuoteQueryParams): Source: https://financialmodelingprep.com/developer/docs/#Stock-Historical-Price """ - __json_schema_extra__ = {"symbol": ["multiple_items_allowed"]} + __json_schema_extra__ = {"symbol": {"multiple_items_allowed": True}} class FMPEquityQuoteData(EquityQuoteData): diff --git a/openbb_platform/providers/fmp/openbb_fmp/models/equity_valuation_multiples.py b/openbb_platform/providers/fmp/openbb_fmp/models/equity_valuation_multiples.py index ea48b84b9db..5a1b05ba503 100644 --- a/openbb_platform/providers/fmp/openbb_fmp/models/equity_valuation_multiples.py +++ b/openbb_platform/providers/fmp/openbb_fmp/models/equity_valuation_multiples.py @@ -22,7 +22,7 @@ class FMPEquityValuationMultiplesQueryParams(EquityValuationMultiplesQueryParams Source: https://site.financialmodelingprep.com/developer/docs/#Company-Key-Metrics """ - __json_schema_extra__ = {"symbol": ["multiple_items_allowed"]} + __json_schema_extra__ = {"symbol": {"multiple_items_allowed": True}} class FMPEquityValuationMultiplesData(EquityValuationMultiplesData): diff --git a/openbb_platform/providers/fmp/openbb_fmp/models/etf_countries.py b/openbb_platform/providers/fmp/openbb_fmp/models/etf_countries.py index 13803e791d2..5eea8840293 100644 --- a/openbb_platform/providers/fmp/openbb_fmp/models/etf_countries.py +++ b/openbb_platform/providers/fmp/openbb_fmp/models/etf_countries.py @@ -18,7 +18,7 @@ from pandas import DataFrame class FMPEtfCountriesQueryParams(EtfCountriesQueryParams): """FMP ETF Countries Query.""" - __json_schema_extra__ = {"symbol": ["multiple_items_allowed"]} + __json_schema_extra__ = {"symbol": {"multiple_items_allowed": True}} class FMPEtfCountriesData(EtfCountriesData): diff --git a/openbb_platform/providers/fmp/openbb_fmp/models/etf_equity_exposure.py b/openbb_platform/providers/fmp/openbb_fmp/models/etf_equity_exposure.py index f204d2fa5e1..65109aef157 100644 --- a/openbb_platform/providers/fmp/openbb_fmp/models/etf_equity_exposure.py +++ b/openbb_platform/providers/fmp/openbb_fmp/models/etf_equity_exposure.py @@ -24,7 +24,7 @@ class FMPEtfEquityExposureQueryParams(EtfEquityExposureQueryParams): Source: https://site.financialmodelingprep.com/developer/docs/etf-stock-exposure-api/ """ - __json_schema_extra__ = {"symbol": ["multiple_items_allowed"]} + __json_schema_extra__ = {"symbol": {"multiple_items_allowed": True}} class FMPEtfEquityExposureData(EtfEquityExposureData): @@ -64,7 +64,7 @@ class FMPEtfEquityExposureFetcher( """Return the raw data from the FMP endpoint.""" api_key = credentials.get("fmp_api_key") if credentials else "" symbols = query.symbol.split(",") - results = [] + results: List[dict] = [] async def get_one(symbol): """Get one symbol.""" diff --git a/openbb_platform/providers/fmp/openbb_fmp/models/etf_info.py b/openbb_platform/providers/fmp/openbb_fmp/models/etf_info.py index af21d5e8f27..4475635a77f 100644 --- a/openbb_platform/providers/fmp/openbb_fmp/models/etf_info.py +++ b/openbb_platform/providers/fmp/openbb_fmp/models/etf_info.py @@ -18,7 +18,7 @@ from pydantic import Field class FMPEtfInfoQueryParams(EtfInfoQueryParams): """FMP ETF Info Query.""" - __json_schema_extra__ = {"symbol": ["multiple_items_allowed"]} + __json_schema_extra__ = {"symbol": {"multiple_items_allowed": True}} class FMPEtfInfoData(EtfInfoData): diff --git a/openbb_platform/providers/fmp/openbb_fmp/models/executive_compensation.py b/openbb_platform/providers/fmp/openbb_fmp/models/executive_compensation.py index 5914828ed02..d95e305e829 100644 --- a/openbb_platform/providers/fmp/openbb_fmp/models/executive_compensation.py +++ b/openbb_platform/providers/fmp/openbb_fmp/models/executive_compensation.py @@ -25,7 +25,7 @@ class FMPExecutiveCompensationQueryParams(ExecutiveCompensationQueryParams): Source: https://site.financialmodelingprep.com/developer/docs/executive-compensation-api/ """ - __json_schema_extra__ = {"symbol": ["multiple_items_allowed"]} + __json_schema_extra__ = {"symbol": {"multiple_items_allowed": True}} year: Optional[int] = Field(default=None, description="Year of the compensation.") @@ -86,7 +86,7 @@ class FMPExecutiveCompensationFetcher( symbols = query.symbol.split(",") - results = [] + results: List[dict] = [] async def get_one(symbol): """Get data for one symbol.""" diff --git a/openbb_platform/providers/fmp/openbb_fmp/models/forward_eps_estimates.py b/openbb_platform/providers/fmp/openbb_fmp/models/forward_eps_estimates.py index f0e2c5cdf60..8a3a714e33c 100644 --- a/openbb_platform/providers/fmp/openbb_fmp/models/forward_eps_estimates.py +++ b/openbb_platform/providers/fmp/openbb_fmp/models/forward_eps_estimates.py @@ -25,7 +25,7 @@ class FMPForwardEpsEstimatesQueryParams(ForwardEpsEstimatesQueryParams): Source: https://site.financialmodelingprep.com/developer/docs/analyst-estimates-api/ """ - __json_schema_extra__ = {"symbol": ["multiple_items_allowed"]} + __json_schema_extra__ = {"symbol": {"multiple_items_allowed": True}} __alias_dict__ = {"fiscal_period": "period"} diff --git a/openbb_platform/providers/fmp/openbb_fmp/models/index_historical.py b/openbb_platform/providers/fmp/openbb_fmp/models/index_historical.py index 33eabd6f5b3..20a5523a1e2 100644 --- a/openbb_platform/providers/fmp/openbb_fmp/models/index_historical.py +++ b/openbb_platform/providers/fmp/openbb_fmp/models/index_historical.py @@ -33,7 +33,7 @@ class FMPIndexHistoricalQueryParams(IndexHistoricalQueryParams): """ __alias_dict__ = {"start_date": "from", "end_date": "to"} - __json_schema_extra__ = {"symbol": ["multiple_items_allowed"]} + __json_schema_extra__ = {"symbol": {"multiple_items_allowed": True}} interval: Literal["1m", "5m", "15m", "30m", "1h", "4h", "1d"] = Field( default="1d", description=QUERY_DESCRIPTIONS.get("interval", "") diff --git a/openbb_platform/providers/fmp/openbb_fmp/models/key_metrics.py b/openbb_platform/providers/fmp/openbb_fmp/models/key_metrics.py index 7c8241aca9d..c47a214a786 100644 --- a/openbb_platform/providers/fmp/openbb_fmp/models/key_metrics.py +++ b/openbb_platform/providers/fmp/openbb_fmp/models/key_metrics.py @@ -27,7 +27,7 @@ class FMPKeyMetricsQueryParams(KeyMetricsQueryParams): Source: https://site.financialmodelingprep.com/developer/docs/company-key-metrics-api/ """ - __json_schema_extra__ = {"symbol": ["multiple_items_allowed"]} + __json_schema_extra__ = {"symbol": {"multiple_items_allowed": True}} with_ttm: Optional[bool] = Field( default=False, description="Include trailing twelve months (TTM) data." diff --git a/openbb_platform/providers/fmp/openbb_fmp/models/price_performance.py b/openbb_platform/providers/fmp/openbb_fmp/models/price_performance.py index aee89b084fb..adc18413151 100644 --- a/openbb_platform/providers/fmp/openbb_fmp/models/price_performance.py +++ b/openbb_platform/providers/fmp/openbb_fmp/models/price_performance.py @@ -19,7 +19,7 @@ class FMPPricePerformanceQueryParams(RecentPerformanceQueryParams): Source: https://site.financialmodelingprep.com/developer/docs/stock-split-calendar-api/ """ - __json_schema_extra__ = {"symbol": ["multiple_items_allowed"]} + __json_schema_extra__ = {"symbol": {"multiple_items_allowed": True}} class FMPPricePerformanceData(RecentPerformanceData): diff --git a/openbb_platform/providers/fmp/openbb_fmp/models/price_target.py b/openbb_platform/providers/fmp/openbb_fmp/models/price_target.py index 92589fc6c00..3b6e8481c4d 100644 --- a/openbb_platform/providers/fmp/openbb_fmp/models/price_target.py +++ b/openbb_platform/providers/fmp/openbb_fmp/models/price_target.py @@ -24,7 +24,7 @@ class FMPPriceTargetQueryParams(PriceTargetQueryParams): Source: https://site.financialmodelingprep.com/developer/docs/#Price-Target """ - __json_schema_extra__ = {"symbol": ["multiple_items_allowed"]} + __json_schema_extra__ = {"symbol": {"multiple_items_allowed": True}} with_grade: bool = Field( False, @@ -89,7 +89,7 @@ class FMPPriceTargetFetcher( symbols = query.symbol.split(",") # type: ignore - results = [] + results: List[dict] = [] async def get_one(symbol): """Get data for one symbol.""" diff --git a/openbb_platform/providers/fmp/openbb_fmp/models/price_target_consensus.py b/openbb_platform/providers/fmp/openbb_fmp/models/price_target_consensus.py index c087bed700f..0cf0f8d3c54 100644 --- a/openbb_platform/providers/fmp/openbb_fmp/models/price_target_consensus.py +++ b/openbb_platform/providers/fmp/openbb_fmp/models/price_target_consensus.py @@ -23,7 +23,7 @@ class FMPPriceTargetConsensusQueryParams(PriceTargetConsensusQueryParams): Source: https://site.financialmodelingprep.com/developer/docs/price-target-consensus-api/ """ - __json_schema_extra__ = {"symbol": ["multiple_items_allowed"]} + __json_schema_extra__ = {"symbol": {"multiple_items_allowed": True}} @field_validator("symbol", mode="before", check_fields=False) @classmethod diff --git a/openbb_platform/providers/fred/openbb_fred/models/cpi.py b/openbb_platform/providers/fred/openbb_fred/models/cpi.py index 4a86e44869f..a7c55bb9b78 100644 --- a/openbb_platform/providers/fred/openbb_fred/models/cpi.py +++ b/openbb_platform/providers/fred/openbb_fred/models/cpi.py @@ -14,7 +14,7 @@ from openbb_fred.utils.fred_helpers import all_cpi_options class FREDConsumerPriceIndexQueryParams(ConsumerPriceIndexQueryParams): """FRED Consumer Price Index Query.""" - __json_schema_extra__ = {"country": ["multiple_items_allowed"]} + __json_schema_extra__ = {"country": {"multiple_items_allowed": True}} class FREDConsumerPriceIndexData(ConsumerPriceIndexData): @@ -75,8 +75,7 @@ class FREDConsumerPriceIndexFetcher( transformed_data[item["date"]].update({country: item["value"]}) # Convert the dictionary to a list of dictionaries - transformed_data = list(transformed_data.values()) - return [ - FREDConsumerPriceIndexData.model_validate(item) for item in transformed_data + FREDConsumerPriceIndexData.model_validate(item) + for item in list(transformed_data.values()) ] diff --git a/openbb_platform/providers/fred/openbb_fred/models/series.py b/openbb_platform/providers/fred/openbb_fred/models/series.py index 36e5f911c57..bdac347325b 100644 --- a/openbb_platform/providers/fred/openbb_fred/models/series.py +++ b/openbb_platform/providers/fred/openbb_fred/models/series.py @@ -28,7 +28,7 @@ class FredSeriesQueryParams(SeriesQueryParams): "end_date": "observation_end", "transform": "units", } - __json_schema_extra__ = {"symbol": ["multiple_items_allowed"]} + __json_schema_extra__ = {"symbol": {"multiple_items_allowed": True}} frequency: Optional[ Literal[ diff --git a/openbb_platform/providers/fred/openbb_fred/models/spot.py b/openbb_platform/providers/fred/openbb_fred/models/spot.py index 4db9cebe4e0..31747a67abb 100644 --- a/openbb_platform/providers/fred/openbb_fred/models/spot.py +++ b/openbb_platform/providers/fred/openbb_fred/models/spot.py @@ -16,8 +16,8 @@ class FREDSpotRateQueryParams(SpotRateQueryParams): """FRED Spot Rate Query.""" __json_schema_extra__ = { - "maturity": ["multiple_items_allowed"], - "category": ["multiple_items_allowed"], + "maturity": {"multiple_items_allowed": True}, + "category": {"multiple_items_allowed": True}, } diff --git a/openbb_platform/providers/intrinio/openbb_intrinio/models/company_news.py b/openbb_platform/providers/intrinio/openbb_intrinio/models/company_news.py index d728cd3384d..d70a7734f75 100644 --- a/openbb_platform/providers/intrinio/openbb_intrinio/models/company_news.py +++ b/openbb_platform/providers/intrinio/openbb_intrinio/models/company_news.py @@ -29,7 +29,7 @@ class IntrinioCompanyNewsQueryParams(CompanyNewsQueryParams): "limit": "page_size", "source": "specific_source", } - __json_schema_extra__ = {"symbol": ["multiple_items_allowed"]} + __json_schema_extra__ = {"symbol": {"multiple_items_allowed": True}} source: Optional[ Literal["yahoo", "moody", "moody_us_news", "moody_us_press_releases"] @@ -182,7 +182,7 @@ class IntrinioCompanyNewsFetcher( else ["symbol", "page_size"] ) query_str = get_querystring(query.model_dump(by_alias=True), ignore) - symbols = query.symbol.split(",") + symbols = query.symbol.split(",") if query.symbol else [] news: List = [] async def callback(response, session): @@ -196,7 +196,9 @@ class IntrinioCompanyNewsFetcher( data.extend([{"symbol": symbol, **d} for d in _data]) articles = len(data) next_page = result.get("next_page") - while next_page and query.limit > articles: + # query.limit can be None... + limit = query.limit or 2500 + while next_page and limit > articles: url = f"{base_url}/{symbol}/news?{query_str}&api_key={api_key}&next_page={next_page}" result = await get_data(url, session=session, **kwargs) _data = result.get("news", []) diff --git a/openbb_platform/providers/intrinio/openbb_intrinio/models/equity_info.py b/openbb_platform/providers/intrinio/openbb_intrinio/models/equity_info.py index 21c8d7d44af..97e1f7d351c 100644 --- a/openbb_platform/providers/intrinio/openbb_intrinio/models/equity_info.py +++ b/openbb_platform/providers/intrinio/openbb_intrinio/models/equity_info.py @@ -20,7 +20,7 @@ class IntrinioEquityInfoQueryParams(EquityInfoQueryParams): Source: https://docs.intrinio.com/documentation/web_api/get_company_v2 """ - __json_schema_extra__ = {"symbol": ["multiple_items_allowed"]} + __json_schema_extra__ = {"symbol": {"multiple_items_allowed": True}} class IntrinioEquityInfoData(EquityInfoData): diff --git a/openbb_platform/providers/intrinio/openbb_intrinio/models/equity_quote.py b/openbb_platform/providers/intrinio/openbb_intrinio/models/equity_quote.py index fe8320bae10..4571a87e1f5 100644 --- a/openbb_platform/providers/intrinio/openbb_intrinio/models/equity_quote.py +++ b/openbb_platform/providers/intrinio/openbb_intrinio/models/equity_quote.py @@ -27,7 +27,7 @@ class IntrinioEquityQuoteQueryParams(EquityQuoteQueryParams): Source: https://docs.intrinio.com/documentation/web_api/get_security_realtime_price_v2 """ - __json_schema_extra__ = {"symbol": ["multiple_items_allowed"]} + __json_schema_extra__ = {"symbol": {"multiple_items_allowed": True}} symbol: str = Field( description="A Security identifier (Ticker, FIGI, ISIN, CUSIP, Intrinio ID)." diff --git a/openbb_platform/providers/intrinio/openbb_intrinio/models/etf_info.py b/openbb_platform/providers/intrinio/openbb_intrinio/models/etf_info.py index f5c275a571f..cd6fc960816 100644 --- a/openbb_platform/providers/intrinio/openbb_intrinio/models/etf_info.py +++ b/openbb_platform/providers/intrinio/openbb_intrinio/models/etf_info.py @@ -23,7 +23,7 @@ class IntrinioEtfInfoQueryParams(EtfInfoQueryParams): Source: https://docs.intrinio.com/documentation/web_api/get_etf_v2 """ - __json_schema_extra__ = {"symbol": ["multiple_items_allowed"]} + __json_schema_extra__ = {"symbol": {"multiple_items_allowed": True}} class IntrinioEtfInfoData(EtfInfoData): diff --git a/openbb_platform/providers/intrinio/openbb_intrinio/models/etf_price_performance.py b/openbb_platform/providers/intrinio/openbb_intrinio/models/etf_price_performance.py index 8ea7e5c27c0..92725910217 100644 --- a/openbb_platform/providers/intrinio/openbb_intrinio/models/etf_price_performance.py +++ b/openbb_platform/providers/intrinio/openbb_intrinio/models/etf_price_performance.py @@ -27,7 +27,7 @@ class IntrinioEtfPricePerformanceQueryParams(RecentPerformanceQueryParams): Source: https://docs.intrinio.com/documentation/web_api/get_etf_analytics_v2 """ - __json_schema_extra__ = {"symbol": ["multiple_items_allowed"]} + __json_schema_extra__ = {"symbol": {"multiple_items_allowed": True}} return_type: Literal["trailing", "calendar"] = Field( default="trailing", diff --git a/openbb_platform/providers/intrinio/openbb_intrinio/models/forward_eps_estimates.py b/openbb_platform/providers/intrinio/openbb_intrinio/models/forward_eps_estimates.py index 294428c3055..3fab49a6684 100644 --- a/openbb_platform/providers/intrinio/openbb_intrinio/models/forward_eps_estimates.py +++ b/openbb_platform/providers/intrinio/openbb_intrinio/models/forward_eps_estimates.py @@ -27,7 +27,7 @@ class IntrinioForwardEpsEstimatesQueryParams(ForwardEpsEstimatesQueryParams): https://docs.intrinio.com/documentation/web_api/get_zacks_sales_estimates_v2 """ - __json_schema_extra__ = {"symbol": ["multiple_items_allowed"]} + __json_schema_extra__ = {"symbol": {"multiple_items_allowed": True}} fiscal_year: Optional[int] = Field( default=None, diff --git a/openbb_platform/providers/intrinio/openbb_intrinio/models/forward_sales_estimates.py b/openbb_platform/providers/intrinio/openbb_intrinio/models/forward_sales_estimates.py index c57ad52cfcb..b50259f0025 100644 --- a/openbb_platform/providers/intrinio/openbb_intrinio/models/forward_sales_estimates.py +++ b/openbb_platform/providers/intrinio/openbb_intrinio/models/forward_sales_estimates.py @@ -27,7 +27,7 @@ class IntrinioForwardSalesEstimatesQueryParams(ForwardSalesEstimatesQueryParams) https://docs.intrinio.com/documentation/web_api/get_zacks_sales_estimates_v2 """ - __json_schema_extra__ = {"symbol": ["multiple_items_allowed"]} + __json_schema_extra__ = {"symbol": {"multiple_items_allowed": True}} fiscal_year: Optional[int] = Field( default=None, diff --git a/openbb_platform/providers/intrinio/openbb_intrinio/models/historical_attributes.py b/openbb_platform/providers/intrinio/openbb_intrinio/models/historical_attributes.py index 7c83c3b8d99..b9558ea19c4 100644 --- a/openbb_platform/providers/intrinio/openbb_intrinio/models/historical_attributes.py +++ b/openbb_platform/providers/intrinio/openbb_intrinio/models/historical_attributes.py @@ -29,8 +29,8 @@ class IntrinioHistoricalAttributesQueryParams(HistoricalAttributesQueryParams): __alias_dict__ = {"sort": "sort_order", "limit": "page_size", "tag_type": "type"} __json_schema_extra__ = { - "tag": ["multiple_items_allowed"], - "symbol": ["multiple_items_allowed"], + "tag": {"multiple_items_allowed": True}, + "symbol": {"multiple_items_allowed": True}, } diff --git a/openbb_platform/providers/intrinio/openbb_intrinio/models/index_historical.py b/openbb_platform/providers/intrinio/openbb_intrinio/models/index_historical.py index fc32a1aee41..33831a17568 100644 --- a/openbb_platform/providers/intrinio/openbb_intrinio/models/index_historical.py +++ b/openbb_platform/providers/intrinio/openbb_intrinio/models/index_historical.py @@ -23,7 +23,7 @@ class IntrinioIndexHistoricalQueryParams(IndexHistoricalQueryParams): """ __alias_dict__ = {"limit": "page_size", "sort": "sort_order"} - __json_schema_extra__ = {"symbol": ["multiple_items_allowed"]} + __json_schema_extra__ = {"symbol": {"multiple_items_allowed": True}} limit: Optional[int] = Field( default=10000, diff --git a/openbb_platform/providers/intrinio/openbb_intrinio/models/key_metrics.py b/openbb_platform/providers/intrinio/openbb_intrinio/models/key_metrics.py index 2dbecc4a0e3..37820cd3593 100644 --- a/openbb_platform/providers/intrinio/openbb_intrinio/models/key_metrics.py +++ b/openbb_platform/providers/intrinio/openbb_intrinio/models/key_metrics.py @@ -27,7 +27,7 @@ class IntrinioKeyMetricsQueryParams(KeyMetricsQueryParams): Source: https://data.intrinio.com/data-tags/ """ - __json_schema_extra__ = {"symbol": ["multiple_items_allowed"]} + __json_schema_extra__ = {"symbol": {"multiple_items_allowed": True}} class IntrinioKeyMetricsData(KeyMetricsData): diff --git a/openbb_platform/providers/intrinio/openbb_intrinio/models/latest_attributes.py b/openbb_platform/providers/intrinio/openbb_intrinio/models/latest_attributes.py index 55cf7bc685d..3b0296d7de7 100644 --- a/openbb_platform/providers/intrinio/openbb_intrinio/models/latest_attributes.py +++ b/openbb_platform/providers/intrinio/openbb_intrinio/models/latest_attributes.py @@ -23,8 +23,8 @@ class IntrinioLatestAttributesQueryParams(LatestAttributesQueryParams): """ __json_schema_extra__ = { - "tag": ["multiple_items_allowed"], - "symbol": ["multiple_items_allowed"], + "tag": {"multiple_items_allowed": True}, + "symbol": {"multiple_items_allowed": True}, } diff --git a/openbb_platform/providers/intrinio/openbb_intrinio/models/price_target_consensus.py b/openbb_platform/providers/intrinio/openbb_intrinio/models/price_target_consensus.py index fcf1a99c4a4..fce965c4c7f 100644 --- a/openbb_platform/providers/intrinio/openbb_intrinio/models/price_target_consensus.py +++ b/openbb_platform/providers/intrinio/openbb_intrinio/models/price_target_consensus.py @@ -27,7 +27,7 @@ class IntrinioPriceTargetConsensusQueryParams(PriceTargetConsensusQueryParams): https://docs.intrinio.com/documentation/web_api/get_zacks_sales__v2 """ - __json_schema_extra__ = {"symbol": ["multiple_items_allowed"]} + __json_schema_extra__ = {"symbol": {"multiple_items_allowed": True}} industry_group_number: Optional[int] = Field( default=None, diff --git a/openbb_platform/providers/nasdaq/openbb_nasdaq/models/economic_calendar.py b/openbb_platform/providers/nasdaq/openbb_nasdaq/models/economic_calendar.py index 34ca03ef7a5..f3422bed106 100644 --- a/openbb_platform/providers/nasdaq/openbb_nasdaq/models/economic_calendar.py +++ b/openbb_platform/providers/nasdaq/openbb_nasdaq/models/economic_calendar.py @@ -22,7 +22,7 @@ class NasdaqEconomicCalendarQueryParams(EconomicCalendarQueryParams): Source: https://www.nasdaq.com/market-activity/economic-calendar """ - __json_schema_extra__ = {"country": ["multiple_items_allowed"]} + __json_schema_extra__ = {"country": {"multiple_items_allowed": True}} country: Optional[str] = Field( default=None, diff --git a/openbb_platform/providers/nasdaq/openbb_nasdaq/models/historical_dividends.py b/openbb_platform/providers/nasdaq/openbb_nasdaq/models/historical_dividends.py index 41dfde661d9..e2efd476be0 100644 --- a/openbb_platform/providers/nasdaq/openbb_nasdaq/models/historical_dividends.py +++ b/openbb_platform/providers/nasdaq/openbb_nasdaq/models/historical_dividends.py @@ -24,7 +24,7 @@ from pydantic import Field, field_validator class NasdaqHistoricalDividendsQueryParams(HistoricalDividendsQueryParams): """Nasdaq Historical Dividends Query Params.""" - __json_schema_extra__ = {"symbol": ["multiple_items_allowed"]} + __json_schema_extra__ = {"symbol": {"multiple_items_allowed": True}} class NasdaqHistoricalDividendsData(HistoricalDividendsData): diff --git a/openbb_platform/providers/polygon/openbb_polygon/models/company_news.py b/openbb_platform/providers/polygon/openbb_polygon/models/company_news.py index b91e7f12239..d83207bc2a0 100644 --- a/openbb_platform/providers/polygon/openbb_polygon/models/company_news.py +++ b/openbb_platform/providers/polygon/openbb_polygon/models/company_news.py @@ -20,7 +20,7 @@ class PolygonCompanyNewsQueryParams(CompanyNewsQueryParams): Source: https://polygon.io/docs/stocks/get_v2_reference_news """ - __json_schema_extra__ = {"symbol": ["multiple_items_allowed"]} + __json_schema_extra__ = {"symbol": {"multiple_items_allowed": True}} __alias_dict__ = { "symbol": "ticker", "start_date": "published_utc.gte", diff --git a/openbb_platform/providers/polygon/openbb_polygon/models/crypto_historical.py b/openbb_platform/providers/polygon/openbb_polygon/models/crypto_historical.py index dc9bb95fe2b..18ea66a3f61 100644 --- a/openbb_platform/providers/polygon/openbb_polygon/models/crypto_historical.py +++ b/openbb_platform/providers/polygon/openbb_polygon/models/crypto_historical.py @@ -39,7 +39,7 @@ class PolygonCryptoHistoricalQueryParams(CryptoHistoricalQueryParams): Source: https://polygon.io/docs/crypto/get_v2_aggs_ticker__cryptoticker__range__multiplier___timespan___from___to """ - __json_schema_extra__ = {"symbol": ["multiple_items_allowed"]} + __json_schema_extra__ = {"symbol": {"multiple_items_allowed": True}} interval: str = Field( default="1d", diff --git a/openbb_platform/providers/polygon/openbb_polygon/models/currency_historical.py b/openbb_platform/providers/polygon/openbb_polygon/models/currency_historical.py index 9a4edcb98b4..9ccac0616ff 100644 --- a/openbb_platform/providers/polygon/openbb_polygon/models/currency_historical.py +++ b/openbb_platform/providers/polygon/openbb_polygon/models/currency_historical.py @@ -39,7 +39,7 @@ class PolygonCurrencyHistoricalQueryParams(CurrencyHistoricalQueryParams): Source: https://polygon.io/docs/forex/get_v2_aggs_ticker__forexticker__range__multiplier___timespan___from___to """ - __json_schema_extra__ = {"symbol": ["multiple_items_allowed"]} + __json_schema_extra__ = {"symbol": {"multiple_items_allowed": True}} interval: str = Field( default="1d", diff --git a/openbb_platform/providers/polygon/openbb_polygon/models/currency_snapshots.py b/openbb_platform/providers/polygon/openbb_polygon/models/currency_snapshots.py index 2ac7c3280e5..0815d097ccc 100644 --- a/openbb_platform/providers/polygon/openbb_polygon/models/currency_snapshots.py +++ b/openbb_platform/providers/polygon/openbb_polygon/models/currency_snapshots.py @@ -23,7 +23,7 @@ class PolygonCurrencySnapshotsQueryParams(CurrencySnapshotsQueryParams): Source: https://polygon.io/docs/forex/get_v2_snapshot_locale_global_markets_forex_tickers """ - __json_schema_extra__ = {"base": ["multiple_items_allowed"]} + __json_schema_extra__ = {"base": {"multiple_items_allowed": True}} class PolygonCurrencySnapshotsData(CurrencySnapshotsData): @@ -115,9 +115,9 @@ class PolygonCurrencySnapshotsFetcher( api_key = credentials.get("polygon_api_key") if credentials else "" url = f"https://api.polygon.io/v2/snapshot/locale/global/markets/forex/tickers?apiKey={api_key}" results = await amake_request(url, **kwargs) - if results.get("status") != "OK": - raise RuntimeError(f"Error: {results.get('status')}") - return results.get("tickers", []) + if results.get("status") != "OK": # type: ignore[union-attr] + raise RuntimeError(f"Error: {results.get('status')}") # type: ignore[union-attr] + return results.get("tickers", []) # type: ignore[union-attr] @staticmethod def transform_data( # pylint: disable=too-many-locals, too-many-statements @@ -129,7 +129,7 @@ class PolygonCurrencySnapshotsFetcher( if not data: raise EmptyDataError("No data returned.") counter_currencies = ( - query.counter_currencies.upper().split(",") + query.counter_currencies.upper().split(",") # type: ignore[union-attr] if query.counter_currencies else [] ) diff --git a/openbb_platform/providers/polygon/openbb_polygon/models/equity_historical.py b/openbb_platform/providers/polygon/openbb_polygon/models/equity_historical.py index de818d61bfe..ee30969dfb9 100644 --- a/openbb_platform/providers/polygon/openbb_polygon/models/equity_historical.py +++ b/openbb_platform/providers/polygon/openbb_polygon/models/equity_historical.py @@ -40,7 +40,7 @@ class PolygonEquityHistoricalQueryParams(EquityHistoricalQueryParams): Source: https://polygon.io/docs/stocks/getting-started """ - __json_schema_extra__ = {"symbol": ["multiple_items_allowed"]} + __json_schema_extra__ = {"symbol": {"multiple_items_allowed": True}} interval: str = Field( default="1d", diff --git a/openbb_platform/providers/polygon/openbb_polygon/models/index_historical.py b/openbb_platform/providers/polygon/openbb_polygon/models/index_historical.py index 74fa010e841..77bdf95a477 100644 --- a/openbb_platform/providers/polygon/openbb_polygon/models/index_historical.py +++ b/openbb_platform/providers/polygon/openbb_polygon/models/index_historical.py @@ -37,7 +37,7 @@ class PolygonIndexHistoricalQueryParams(IndexHistoricalQueryParams): Source: https://polygon.io/docs/indices/getting-started """ - __json_schema_extra__ = {"symbol": ["multiple_items_allowed"]} + __json_schema_extra__ = {"symbol": {"multiple_items_allowed": True}} interval: str = Field( default="1d", diff --git a/openbb_platform/providers/tiingo/openbb_tiingo/models/company_news.py b/openbb_platform/providers/tiingo/openbb_tiingo/models/company_news.py index c11e12f424d..a9aa3545f2c 100644 --- a/openbb_platform/providers/tiingo/openbb_tiingo/models/company_news.py +++ b/openbb_platform/providers/tiingo/openbb_tiingo/models/company_news.py @@ -27,7 +27,7 @@ class TiingoCompanyNewsQueryParams(CompanyNewsQueryParams): "start_date": "startDate", "end_date": "endDate", } - __json_schema_extra__ = {"symbol": ["multiple_items_allowed"]} + __json_schema_extra__ = {"symbol": {"multiple_items_allowed": True}} offset: Optional[int] = Field( default=0, description="Page offset, used in conjunction with limit." diff --git a/openbb_platform/providers/tiingo/openbb_tiingo/models/crypto_historical.py b/openbb_platform/providers/tiingo/openbb_tiingo/models/crypto_historical.py index bd70bab32cd..0df0e092c2f 100644 --- a/openbb_platform/providers/tiingo/openbb_tiingo/models/crypto_historical.py +++ b/openbb_platform/providers/tiingo/openbb_tiingo/models/crypto_historical.py @@ -35,7 +35,7 @@ class TiingoCryptoHistoricalQueryParams(CryptoHistoricalQueryParams): "end_date": "endDate", "interval": "resampleFreq", } - __json_schema_extra__ = {"symbol": ["multiple_items_allowed"]} + __json_schema_extra__ = {"symbol": {"multiple_items_allowed": True}} interval: Literal["1m", "5m", "15m", "30m", "1h", "4h", "1d"] = Field( default="1d", description=QUERY_DESCRIPTIONS.get("interval", "") @@ -125,7 +125,7 @@ class TiingoCryptoHistoricalFetcher( query_str = get_querystring( query.model_dump(by_alias=False), ["tickers", "resampleFreq"] ) - results = [] + results: List[dict] = [] async def callback(response: ClientResponse, _: Any) -> List[Dict]: result = await response.json() diff --git a/openbb_platform/providers/tiingo/openbb_tiingo/models/currency_historical.py b/openbb_platform/providers/tiingo/openbb_tiingo/models/currency_historical.py index aa0387cfd70..537db364cd4 100644 --- a/openbb_platform/providers/tiingo/openbb_tiingo/models/currency_historical.py +++ b/openbb_platform/providers/tiingo/openbb_tiingo/models/currency_historical.py @@ -35,7 +35,7 @@ class TiingoCurrencyHistoricalQueryParams(CurrencyHistoricalQueryParams): "end_date": "endDate", "interval": "resampleFreq", } - __json_schema_extra__ = {"symbol": ["multiple_items_allowed"]} + __json_schema_extra__ = {"symbol": {"multiple_items_allowed": True}} interval: Literal["1m", "5m", "15m", "30m", "1h", "4h", "1d"] = Field( default="1d", description=QUERY_DESCRIPTIONS.get("interval", "") @@ -106,7 +106,7 @@ class TiingoCurrencyHistoricalFetcher( query_str = get_querystring( query.model_dump(by_alias=False), ["tickers", "resampleFreq"] ) - results = [] + results: List[dict] = [] async def callback(response: ClientResponse, _: Any) -> List[Dict]: result = await response.json() diff --git a/openbb_platform/providers/tiingo/openbb_tiingo/models/equity_historical.py b/openbb_platform/providers/tiingo/openbb_tiingo/models/equity_historical.py index 401f1f14c01..0af3a97606d 100644 --- a/openbb_platform/providers/tiingo/openbb_tiingo/models/equity_historical.py +++ b/openbb_platform/providers/tiingo/openbb_tiingo/models/equity_historical.py @@ -36,7 +36,7 @@ class TiingoEquityHistoricalQueryParams(EquityHistoricalQueryParams): "start_date": "startDate", "end_date": "endDate", } - __json_schema_extra__ = {"symbol": ["multiple_items_allowed"]} + __json_schema_extra__ = {"symbol": {"multiple_items_allowed": True}} interval: Literal["1d", "1W", "1M", "1Y"] = Field( default="1d", description=QUERY_DESCRIPTIONS.get("interval", "") @@ -142,7 +142,7 @@ class TiingoEquityHistoricalFetcher( async def callback(response: ClientResponse, _: Any) -> List[Dict]: data = await response.json() symbol = response.url.parts[-2] - results = [] + results: List[dict] = [] if not data: _warn(f"No data found the the symbol: {symbol}") return results diff --git a/openbb_platform/providers/tmx/openbb_tmx/models/company_news.py b/openbb_platform/providers/tmx/openbb_tmx/models/company_news.py index cc8fd504cdc..b8d8664477f 100644 --- a/openbb_platform/providers/tmx/openbb_tmx/models/company_news.py +++ b/openbb_platform/providers/tmx/openbb_tmx/models/company_news.py @@ -20,7 +20,7 @@ from pydantic import Field, field_validator class TmxCompanyNewsQueryParams(CompanyNewsQueryParams): """TMX Stock News query.""" - __json_schema_extra__ = {"symbol": ["multiple_items_allowed"]} + __json_schema_extra__ = {"symbol": {"multiple_items_allowed": True}} page: Optional[int] = Field( default=1, description="The page number to start from. Use with limit." diff --git a/openbb_platform/providers/tmx/openbb_tmx/models/equity_historical.py b/openbb_platform/providers/tmx/openbb_tmx/models/equity_historical.py index 1e13cb46e2d..ca20de58589 100644 --- a/openbb_platform/providers/tmx/openbb_tmx/models/equity_historical.py +++ b/openbb_platform/providers/tmx/openbb_tmx/models/equity_historical.py @@ -44,7 +44,7 @@ class TmxEquityHistoricalQueryParams(EquityHistoricalQueryParams): source: https://money.tmx.com """ - __json_schema_extra__ = {"symbol": ["multiple_items_allowed"]} + __json_schema_extra__ = {"symbol": {"multiple_items_allowed": True}} interval: Union[ Literal["1m", "2m", "5m", "15m", "30m", "60m", "1h", "1d", "1W", "1M"], str, int diff --git a/openbb_platform/providers/tmx/openbb_tmx/models/equity_profile.py b/openbb_platform/providers/tmx/openbb_tmx/models/equity_profile.py index ddce1445ef7..de58b0daeb2 100644 --- a/openbb_platform/providers/tmx/openbb_tmx/models/equity_profile.py +++ b/openbb_platform/providers/tmx/openbb_tmx/models/equity_profile.py @@ -18,7 +18,7 @@ from pydantic import Field, model_validator class TmxEquityProfileQueryParams(EquityInfoQueryParams): """TMX Equity Profile query params.""" - __json_schema_extra__ = {"symbol": ["multiple_items_allowed"]} + __json_schema_extra__ = {"symbol": {"multiple_items_allowed": True}} class TmxEquityProfileData(EquityInfoData): diff --git a/openbb_platform/providers/tmx/openbb_tmx/models/equity_quote.py b/openbb_platform/providers/tmx/openbb_tmx/models/equity_quote.py index 17392971948..cc6034e9734 100644 --- a/openbb_platform/providers/tmx/openbb_tmx/models/equity_quote.py +++ b/openbb_platform/providers/tmx/openbb_tmx/models/equity_quote.py @@ -28,7 +28,7 @@ _warn = warnings.warn class TmxEquityQuoteQueryParams(EquityQuoteQueryParams): """TMX Equity Profile query params.""" - __json_schema_extra__ = {"symbol": ["multiple_items_allowed"]} + __json_schema_extra__ = {"symbol": {"multiple_items_allowed": True}} class TmxEquityQuoteData(EquityQuoteData): diff --git a/openbb_platform/providers/tmx/openbb_tmx/models/etf_countries.py b/openbb_platform/providers/tmx/openbb_tmx/models/etf_countries.py index 008b0d47103..c135d804732 100644 --- a/openbb_platform/providers/tmx/openbb_tmx/models/etf_countries.py +++ b/openbb_platform/providers/tmx/openbb_tmx/models/etf_countries.py @@ -20,7 +20,7 @@ _warn = warnings.warn class TmxEtfCountriesQueryParams(EtfCountriesQueryParams): """TMX ETF Countries Query Params""" - __json_schema_extra__ = {"symbol": ["multiple_items_allowed"]} + __json_schema_extra__ = {"symbol": {"multiple_items_allowed": True}} use_cache: bool = Field( default=True, diff --git a/openbb_platform/providers/tmx/openbb_tmx/models/etf_info.py b/openbb_platform/providers/tmx/openbb_tmx/models/etf_info.py index ea5963ecb78..05bcee5f898 100644 --- a/openbb_platform/providers/tmx/openbb_tmx/models/etf_info.py +++ b/openbb_platform/providers/tmx/openbb_tmx/models/etf_info.py @@ -16,7 +16,7 @@ from pydantic import Field, field_validator class TmxEtfInfoQueryParams(EtfInfoQueryParams): """TMX ETF Info Query Params""" - __json_schema_extra__ = {"symbol": ["multiple_items_allowed"]} + __json_schema_extra__ = {"symbol": {"multiple_items_allowed": True}} use_cache: bool = Field( default=True, diff --git a/openbb_platform/providers/tmx/openbb_tmx/models/price_target_consensus.py b/openbb_platform/providers/tmx/openbb_tmx/models/price_target_consensus.py index 4d304d6fbb0..bfc2ed32b26 100644 --- a/openbb_platform/providers/tmx/openbb_tmx/models/price_target_consensus.py +++ b/openbb_platform/providers/tmx/openbb_tmx/models/price_target_consensus.py @@ -18,7 +18,7 @@ from pydantic import Field, field_validator class TmxPriceTargetConsensusQueryParams(PriceTargetConsensusQueryParams): """TMX Price Target Consensus Query.""" - __json_schema_extra__ = {"symbol": ["multiple_items_allowed"]} + __json_schema_extra__ = {"symbol": {"multiple_items_allowed": True}} @field_validator("symbol", mode="before", check_fields=False) @classmethod diff --git a/openbb_platform/providers/tradier/openbb_tradier/models/equity_historical.py b/openbb_platform/providers/tradier/openbb_tradier/models/equity_historical.py index eed0d09d93a..32b5bc1c7a6 100644 --- a/openbb_platform/providers/tradier/openbb_tradier/models/equity_historical.py +++ b/openbb_platform/providers/tradier/openbb_tradier/models/equity_historical.py @@ -26,7 +26,7 @@ from pytz import timezone class TradierEquityHistoricalQueryParams(EquityHistoricalQueryParams): """Tradier Equity Historical Query.""" - __json_schema_extra__ = {"symbol": ["multiple_items_allowed"]} + __json_schema_extra__ = {"symbol": {"multiple_items_allowed": True}} interval: Literal["1m", "5m", "15m", "1d", "1W", "1M"] = Field( description=QUERY_DESCRIPTIONS.get("interval", ""), diff --git a/openbb_platform/providers/tradier/openbb_tradier/models/equity_quote.py b/openbb_platform/providers/tradier/openbb_tradier/models/equity_quote.py index d3a2abef9fa..88829f5faaa 100644 --- a/openbb_platform/providers/tradier/openbb_tradier/models/equity_quote.py +++ b/openbb_platform/providers/tradier/openbb_tradier/models/equity_quote.py @@ -24,7 +24,7 @@ from pytz import timezone class TradierEquityQuoteQueryParams(EquityQuoteQueryParams): """Tradier Equity Quote Query.""" - __json_schema_extra__ = {"symbol": ["multiple_items_allowed"]} + __json_schema_extra__ = {"symbol": {"multiple_items_allowed": True}} class TradierEquityQuoteData(EquityQuoteData): diff --git a/openbb_platform/providers/tradingeconomics/openbb_tradingeconomics/models/economic_calendar.py b/openbb_platform/providers/tradingeconomics/openbb_tradingeconomics/models/economic_calendar.py index ec3d2ffac08..25a2a045798 100644 --- a/openbb_platform/providers/tradingeconomics/openbb_tradingeconomics/models/economic_calendar.py +++ b/openbb_platform/providers/tradingeconomics/openbb_tradingeconomics/models/economic_calendar.py @@ -41,7 +41,7 @@ class TEEconomicCalendarQueryParams(EconomicCalendarQueryParams): Source: https://docs.tradingeconomics.com/economic_calendar/ """ - __json_schema_extra__ = {"country": ["multiple_items_allowed"]} + __json_schema_extra__ = {"country": {"multiple_items_allowed": True}} # TODO: Probably want to figure out the list we can use. country: Optional[str] = Field(default=None, description="Country of the event.") diff --git a/openbb_platform/providers/yfinance/openbb_yfinance/models/company_news.py b/openbb_platform/providers/yfinance/openbb_yfinance/models/company_news.py index 29209ebd5b4..a313f63ff31 100644 --- a/openbb_platform/providers/yfinance/openbb_yfinance/models/company_news.py +++ b/openbb_platform/providers/yfinance/openbb_yfinance/models/company_news.py @@ -21,7 +21,7 @@ class YFinanceCompanyNewsQueryParams(CompanyNewsQueryParams): Source: https://finance.yahoo.com/news/ """ - __json_schema_extra__ = {"symbol": ["multiple_items_allowed"]} + __json_schema_extra__ = {"symbol": {"multiple_items_allowed": True}} class YFinanceCompanyNewsData(CompanyNewsData): diff --git a/openbb_platform/providers/yfinance/openbb_yfinance/models/crypto_historical.py b/openbb_platform/providers/yfinance/openbb_yfinance/models/crypto_historical.py index e6958bcf5cb..00ca5fd7b0e 100644 --- a/openbb_platform/providers/yfinance/openbb_yfinance/models/crypto_historical.py +++ b/openbb_platform/providers/yfinance/openbb_yfinance/models/crypto_historical.py @@ -26,7 +26,7 @@ class YFinanceCryptoHistoricalQueryParams(CryptoHistoricalQueryParams): Source: https://finance.yahoo.com/crypto/ """ - __json_schema_extra__ = {"symbol": ["multiple_items_allowed"]} + __json_schema_extra__ = {"symbol": {"multiple_items_allowed": True}} interval: Literal[ "1m", diff --git a/openbb_platform/providers/yfinance/openbb_yfinance/models/currency_historical.py b/openbb_platform/providers/yfinance/openbb_yfinance/models/currency_historical.py index 1c93f165b1e..af4d3279150 100644 --- a/openbb_platform/providers/yfinance/openbb_yfinance/models/currency_historical.py +++ b/openbb_platform/providers/yfinance/openbb_yfinance/models/currency_historical.py @@ -25,7 +25,7 @@ class YFinanceCurrencyHistoricalQueryParams(CurrencyHistoricalQueryParams): Source: https://finance.yahoo.com/currencies/ """ - __json_schema_extra__ = {"symbol": ["multiple_items_allowed"]} + __json_schema_extra__ = {"symbol": {"multiple_items_allowed": True}} interval: Literal[ "1m", diff --git a/openbb_platform/providers/yfinance/openbb_yfinance/models/equity_historical.py b/openbb_platform/providers/yfinance/openbb_yfinance/models/equity_historical.py index bf9dceecdb5..c7e5a2239db 100644 --- a/openbb_platform/providers/yfinance/openbb_yfinance/models/equity_historical.py +++ b/openbb_platform/providers/yfinance/openbb_yfinance/models/equity_historical.py @@ -27,7 +27,7 @@ class YFinanceEquityHistoricalQueryParams(EquityHistoricalQueryParams): Source: https://finance.yahoo.com/ """ - __json_schema_extra__ = {"symbol": ["multiple_items_allowed"]} + __json_schema_extra__ = {"symbol": {"multiple_items_allowed": True}} interval: Literal[ "1m", diff --git a/openbb_platform/providers/yfinance/openbb_yfinance/models/equity_profile.py b/openbb_platform/providers/yfinance/openbb_yfinance/models/equity_profile.py index d74ffc2e352..9f5aab829e7 100644 --- a/openbb_platform/providers/yfinance/openbb_yfinance/models/equity_profile.py +++ b/openbb_platform/providers/yfinance/openbb_yfinance/models/equity_profile.py @@ -24,7 +24,7 @@ _warn = warnings.warn class YFinanceEquityProfileQueryParams(EquityInfoQueryParams): """YFinance Equity Profile Query.""" - __json_schema_extra__ = {"symbol": ["multiple_items_allowed"]} + __json_schema_extra__ = {"symbol": {"multiple_items_allowed": True}} class YFinanceEquityProfileData(EquityInfoData): diff --git a/openbb_platform/providers/yfinance/openbb_yfinance/models/equity_quote.py b/openbb_platform/providers/yfinance/openbb_yfinance/models/equity_quote.py index a8a88b96e6c..0e704cb2b5e 100644 --- a/openbb_platform/providers/yfinance/openbb_yfinance/models/equity_quote.py +++ b/openbb_platform/providers/yfinance/openbb_yfinance/models/equity_quote.py @@ -19,7 +19,7 @@ _warn = warnings.warn class YFinanceEquityQuoteQueryParams(EquityQuoteQueryParams): """YFinance Equity Quote Query.""" - __json_schema_extra__ = {"symbol": ["multiple_items_allowed"]} + __json_schema_extra__ = {"symbol": {"multiple_items_allowed": True}} class YFinanceEquityQuoteData(EquityQuoteData): diff --git a/openbb_platform/providers/yfinance/openbb_yfinance/models/etf_info.py b/openbb_platform/providers/yfinance/openbb_yfinance/models/etf_info.py index 639b01e6aaa..02eabd1304c 100644 --- a/openbb_platform/providers/yfinance/openbb_yfinance/models/etf_info.py +++ b/openbb_platform/providers/yfinance/openbb_yfinance/models/etf_info.py @@ -21,7 +21,7 @@ _warn = warnings.warn class YFinanceEtfInfoQueryParams(EtfInfoQueryParams): """YFinance ETF Info Query.""" - __json_schema_extra__ = {"symbol": ["multiple_items_allowed"]} + __json_schema_extra__ = {"symbol": {"multiple_items_allowed": True}} class YFinanceEtfInfoData(EtfInfoData): diff --git a/openbb_platform/providers/yfinance/openbb_yfinance/models/futures_historical.py b/openbb_platform/providers/yfinance/openbb_yfinance/models/futures_historical.py index 55637fde0b7..f7715d2dcd6 100644 --- a/openbb_platform/providers/yfinance/openbb_yfinance/models/futures_historical.py +++ b/openbb_platform/providers/yfinance/openbb_yfinance/models/futures_historical.py @@ -26,7 +26,7 @@ class YFinanceFuturesHistoricalQueryParams(FuturesHistoricalQueryParams): Source: https://finance.yahoo.com/crypto/ """ - __json_schema_extra__ = {"symbol": ["multiple_items_allowed"]} + __json_schema_extra__ = {"symbol": {"multiple_items_allowed": True}} interval: Literal[ "1m", diff --git a/openbb_platform/providers/yfinance/openbb_yfinance/models/index_historical.py b/openbb_platform/providers/yfinance/openbb_yfinance/models/index_historical.py index ea1ea0d9fbb..187ec915f7b 100644 --- a/openbb_platform/providers/yfinance/openbb_yfinance/models/index_historical.py +++ b/openbb_platform/providers/yfinance/openbb_yfinance/models/index_historical.py @@ -29,7 +29,7 @@ class YFinanceIndexHistoricalQueryParams(IndexHistoricalQueryParams): Source: https://finance.yahoo.com/world-indices """ - __json_schema_extra__ = {"symbol": ["multiple_items_allowed"]} + __json_schema_extra__ = {"symbol": {"multiple_items_allowed": True}} interval: Literal[ "1m", diff --git a/openbb_platform/providers/yfinance/openbb_yfinance/models/key_metrics.py b/openbb_platform/providers/yfinance/openbb_yfinance/models/key_metrics.py index 3dbff8487aa..a1617c3ece4 100644 --- a/openbb_platform/providers/yfinance/openbb_yfinance/models/key_metrics.py +++ b/openbb_platform/providers/yfinance/openbb_yfinance/models/key_metrics.py @@ -19,7 +19,7 @@ _warn = warnings.warn class YFinanceKeyMetricsQueryParams(KeyMetricsQueryParams): """YFinance Key Metrics Query.""" - __json_schema_extra__ = {"symbol": ["multiple_items_allowed"]} + __json_schema_extra__ = {"symbol": {"multiple_items_allowed": True}} class YFinanceKeyMetricsData(KeyMetricsData): diff --git a/openbb_platform/providers/yfinance/openbb_yfinance/models/market_indices.py b/openbb_platform/providers/yfinance/openbb_yfinance/models/market_indices.py index 163856a5cd3..46197749982 100644 --- a/openbb_platform/providers/yfinance/openbb_yfinance/models/market_indices.py +++ b/openbb_platform/providers/yfinance/openbb_yfinance/models/market_indices.py @@ -27,7 +27,7 @@ class YFinanceMarketIndicesQueryParams(MarketIndicesQueryParams): Source: https://finance.yahoo.com/world-indices """ - __json_schema_extra__ = {"symbol": ["multiple_items_allowed"]} + __json_schema_extra__ = {"symbol": {"multiple_items_allowed": True}} interval: Optional[INTERVALS] = Field(default="1d", description="Data granularity.") period: Optional[PERIODS] = Field( @@ -61,7 +61,7 @@ class YFinanceMarketIndicesFetcher( if params.get("end_date") is None: transformed_params["end_date"] = now - tickers = params.get("symbol").lower().split(",") + tickers = params.get("symbol", "").lower().split(",") new_tickers = [] for ticker in tickers: @@ -123,7 +123,7 @@ class YFinanceMarketIndicesFetcher( data = data[ (data.index >= to_datetime(query.start_date)) - & (data.index <= to_datetime(query.end_date + timedelta(days=days))) + & (data.index <= to_datetime(query.end_date + timedelta(days=days))) # type: ignore[operator] ] data.reset_index(inplace=True) diff --git a/openbb_platform/providers/yfinance/openbb_yfinance/models/price_target_consensus.py b/openbb_platform/providers/yfinance/openbb_yfinance/models/price_target_consensus.py index 15d628580fd..3ee2e7d8f37 100644 --- a/openbb_platform/providers/yfinance/openbb_yfinance/models/price_target_consensus.py +++ b/openbb_platform/providers/yfinance/openbb_yfinance/models/price_target_consensus.py @@ -19,7 +19,7 @@ _warn = warnings.warn class YFinancePriceTargetConsensusQueryParams(PriceTargetConsensusQueryParams): """YFinance Price Target Consensus Query.""" - __json_schema_extra__ = {"symbol": ["multiple_items_allowed"]} + __json_schema_extra__ = {"symbol": {"multiple_items_allowed": True}} @field_validator("symbol", mode="before", check_fields=False) @classmethod diff --git a/openbb_platform/providers/yfinance/openbb_yfinance/models/share_statistics.py b/openbb_platform/providers/yfinance/openbb_yfinance/models/share_statistics.py index 11a789596da..7261f480816 100644 --- a/openbb_platform/providers/yfinance/openbb_yfinance/models/share_statistics.py +++ b/openbb_platform/providers/yfinance/openbb_yfinance/models/share_statistics.py @@ -23,7 +23,7 @@ _warn = warnings.warn class YFinanceShareStatisticsQueryParams(ShareStatisticsQueryParams): """YFinance Share Statistics Query.""" - __json_schema_extra__ = {"symbol": ["multiple_items_allowed"]} + __json_schema_extra__ = {"symbol": {"multiple_items_allowed": True}} class YFinanceShareStatisticsData(ShareStatisticsData): diff --git a/website/generate_platform_v4_markdown.py b/website/generate_platform_v4_markdown.py index 083d14e0a3e..4f6111140fc 100644 --- a/website/generate_platform_v4_markdown.py +++ b/website/generate_platform_v4_markdown.py @@ -5,7 +5,7 @@ import re import shutil import subprocess from pathlib import Path -from typing import Dict, List +from typing import Dict, List, Optional from openbb_core.provider import standard_models from poetry.core.constraints.version import Version, VersionConstraint, parse_constraint @@ -141,7 +141,7 @@ def create_reference_markdown_intro( def create_reference_markdown_tabular_section( - parameters: Dict[str, List[Dict[str, str]]], heading: str + parameters: Dict[str, List[Dict[str, Optional[str]]]], heading: str ) -> str: """Create the tabular section for the markdown file. @@ -158,45 +158,41 @@ def create_reference_markdown_tabular_section( Tabular section for the markdown file """ - standard_params_list = [] tables_list = [] # params_list is a list of dictionaries containing the # information for all the parameters of the provider. for provider, params_list in parameters.items(): - # Exclude the standard parameters from the table - filtered_params = [ - {k: v for k, v in params.items() if k != "standard"} - for params in params_list - ] + + if provider != "standard": + result = {v.get("name"): v for v in parameters["standard"]} + provider_params = {v.get("name"): v for v in params_list} + result.update(provider_params) + params = [{**{"name": k}, **v} for k, v in result.items()] + else: + params = params_list # Exclude default and optional columns in the Data section - if heading == "Data": - filtered_params = [ - {k: v for k, v in params.items() if k not in ["default", "optional"]} - for params in filtered_params + filtered = ( + [ + {k: v for k, v in p.items() if k not in ["default", "optional"]} + for p in params ] - - if provider == "standard": - standard_params_list = filtered_params - else: - filtered_params = standard_params_list + filtered_params + if heading == "Data" + else params + ) # Parameter information for every provider is extracted from the dictionary # and joined to form a row of the table. # A `|` is added at the start and end of the row to create the table cell. - params_table_rows = [ - f"| {' | '.join(map(str, params.values()))} |" for params in filtered_params - ] - # All rows are joined to form the table. - params_table_rows_str = "\n".join(params_table_rows) + rows = "\n".join([f"| {' | '.join(map(str, p.values()))} |" for p in filtered]) if heading == "Parameters": tables_list.append( f"\n\n\n" "| Name | Type | Description | Default | Optional |\n" "| ---- | ---- | ----------- | ------- | -------- |\n" - f"{params_table_rows_str}\n" + f"{rows}\n" "\n" ) elif heading == "Data": @@ -204,7 +200,7 @@ def create_reference_markdown_tabular_section( f"\n\n\n" "| Name | Type | Description |\n" "| ---- | ---- | ----------- |\n" - f"{params_table_rows_str}\n" + f"{rows}\n" "\n" ) From 9bdc0f140744a6c58ae0695b60abcc332028c219 Mon Sep 17 00:00:00 2001 From: Danglewood <85772166+deeleeramone@users.noreply.github.com> Date: Thu, 9 May 2024 12:57:06 -0700 Subject: [PATCH 2/3] fix fmp (#6383) Co-authored-by: Igor Radovanovic <74266147+IgorWounds@users.noreply.github.com> --- .../openbb_fmp/models/crypto_historical.py | 2 +- .../openbb_fmp/models/currency_historical.py | 5 +-- .../test_fmp_crypto_historical_fetcher.yaml | 4 +-- .../test_fmp_currency_historical_fetcher.yaml | 31 ++++++++++--------- 4 files changed, 20 insertions(+), 22 deletions(-) diff --git a/openbb_platform/providers/fmp/openbb_fmp/models/crypto_historical.py b/openbb_platform/providers/fmp/openbb_fmp/models/crypto_historical.py index ad528255c0d..9b94a92727b 100644 --- a/openbb_platform/providers/fmp/openbb_fmp/models/crypto_historical.py +++ b/openbb_platform/providers/fmp/openbb_fmp/models/crypto_historical.py @@ -100,7 +100,7 @@ class FMPCryptoHistoricalFetcher( url_params = f"{symbol}?{query_str}&apikey={api_key}" url = f"{base_url}/historical-chart/{interval}/{url_params}" if interval == "1day": - url = f"{base_url}/historical-price-full/crypto/{url_params}" + url = f"{base_url}/historical-price-full/{url_params}" return url symbols = query.symbol.split(",") diff --git a/openbb_platform/providers/fmp/openbb_fmp/models/currency_historical.py b/openbb_platform/providers/fmp/openbb_fmp/models/currency_historical.py index 697c3d0395d..58565d1edeb 100644 --- a/openbb_platform/providers/fmp/openbb_fmp/models/currency_historical.py +++ b/openbb_platform/providers/fmp/openbb_fmp/models/currency_historical.py @@ -98,7 +98,7 @@ class FMPCurrencyHistoricalFetcher( url_params = f"{symbol}?{query_str}&apikey={api_key}" url = f"{base_url}/historical-chart/{interval}/{url_params}" if interval == "1day": - url = f"{base_url}/historical-price-full/forex/{url_params}" + url = f"{base_url}/historical-price-full/{url_params}" return url symbols = query.symbol.split(",") @@ -108,11 +108,8 @@ class FMPCurrencyHistoricalFetcher( async def get_one(symbol): """Get data for one symbol.""" - url = get_url_params(symbol) - data = [] - response = await amake_request(url, **kwargs) if isinstance(response, dict) and response.get("Error Message"): diff --git a/openbb_platform/providers/fmp/tests/record/http/test_fmp_fetchers/test_fmp_crypto_historical_fetcher.yaml b/openbb_platform/providers/fmp/tests/record/http/test_fmp_fetchers/test_fmp_crypto_historical_fetcher.yaml index 7d0757a1590..bb4feb0994a 100644 --- a/openbb_platform/providers/fmp/tests/record/http/test_fmp_fetchers/test_fmp_crypto_historical_fetcher.yaml +++ b/openbb_platform/providers/fmp/tests/record/http/test_fmp_fetchers/test_fmp_crypto_historical_fetcher.yaml @@ -9,7 +9,7 @@ interactions: Connection: - keep-alive method: GET - uri: https://financialmodelingprep.com/api/v3/historical-price-full/crypto/BTCUSD?apikey=MOCK_API_KEY&from=2023-01-01&interval=1d&to=2023-01-10 + uri: https://financialmodelingprep.com/api/v3/historical-price-full/BTCUSD?apikey=MOCK_API_KEY&from=2023-01-01&interval=1d&to=2023-01-10 response: body: string: !!binary | @@ -48,7 +48,7 @@ interactions: Content-Type: - application/json; charset=utf-8 Date: - - Thu, 29 Feb 2024 04:42:50 GMT + - Thu, 09 May 2024 15:33:03 GMT Etag: - W/"ee3-iGBRI0WlQUT/ED3Q3GcS73lQbMw" Server: diff --git a/openbb_platform/providers/fmp/tests/record/http/test_fmp_fetchers/test_fmp_currency_historical_fetcher.yaml b/openbb_platform/providers/fmp/tests/record/http/test_fmp_fetchers/test_fmp_currency_historical_fetcher.yaml index 756dd1d3460..4b14b56c092 100644 --- a/openbb_platform/providers/fmp/tests/record/http/test_fmp_fetchers/test_fmp_currency_historical_fetcher.yaml +++ b/openbb_platform/providers/fmp/tests/record/http/test_fmp_fetchers/test_fmp_currency_historical_fetcher.yaml @@ -9,22 +9,23 @@ interactions: Connection: - keep-alive method: GET - uri: https://financialmodelingprep.com/api/v3/historical-price-full/forex/EURUSD?apikey=MOCK_API_KEY&from=2023-01-01&interval=1d&to=2023-01-10 + uri: https://financialmodelingprep.com/api/v3/historical-price-full/EURUSD?apikey=MOCK_API_KEY&from=2023-01-01&interval=1d&to=2023-01-10 response: body: string: !!binary | - H4sIAAAAAAAAA5WWPW/bMBCG9/wKwbNt3PFbWdsuXVq0TZeig2ILsQvbCvwVBEH+eynWFY/KSWY8 - eLj3fBQfv3rJl5uimByet/fNZnJbTD7dfbv7/nEybaur9eHY7NeLqlV++UpRvIRvry2rY932CxBy - BjhDCL8JWvNY77yGc7DSia68Wj+sLmVrZFfeNE+XqlBdcbFpDvWlbLTu6tXyzwciSYmu087N5rQN - igOHcYHTzv/qdDjWy58DHYtVtXto6zAHELYvfK33i3p3DLrQSkT9/FQ9Xh4l7qe6rwPKz9XuVO2f - C4RpIeSkN/TLud7/WG+7Vdu5oeN1Ok4aSp60iJQIaV1ypJEFLV3sTUEbbWT8IzvQon3suCwDuteR - gAbtegIFDVqBQmXexxrKDNb/R+fhdhxuY4hZCW4TyXa0Ddk/pS2GbU0kAlsLG7fOwk46EtgWsCdQ - 2EZb8i/lkXYZpMPcPMyGxaw4yh4+Q1mx6UF7U8pa+A+DeZQwDxfHjIymxMg+j63JYBvm5rHVHFst - /MuSCVc5EXsTunFnvcQAI+MOiYmtAxg3cdJBOaMaMTHOJZfLMT/eUtbXKaPMDGXF2hd0XJ8glgxi - jZK4iNoUhxhrZRwXFOiV0eOv19ExnrW+cm/yOkL2DbY0louKMdDqCuiwbhicB1uyflY6bonC1swJ - qAfSAoYy2VhLTs3IWpSqjKM41mlHkhu67Kc1DQ7t3673WlpetzSEuXmgBetqS040AtoxZ59G3tRq - 8OyDkty/ImdpaJ5wnNOOxNMoccTTOGdvdGOYRYahMfc+h+x9zt9DGciWu1/QF5Y61kTb9c1MpI6x - 9XeiUcRpQ5oawvTzJEkNobTlII8dgpgBGcLgf5z99++b178DE4NG0AwAAA== + H4sIAAAAAAAAA42WTW/bMAyG7/0VRs5JIerL0q7bLrts2NZdhh3cxGgyJHGRjxZF0f8+WUtNSmEc + 5ZADSVPWw1ev9XpTVZP9y+a+W08+VJPPd9/vfnyaTPvocrU/dLvVvOkzv0Okql7jf8gtmkPb10sh + 1UzADER8Jua6x3YbcnAraiX9EF6uHpancG3VEF53z6eoNHqIztfdvj3Fja2HeLP4+/FC6qlbHzd9 + QjpwHuPHbXjouD+0i18XKubLZvvQx8WtCPtxWeJbu5u320PMSwm1wSWfm8fTm+gaH1s3922k+aXZ + HpvdSwViWkk1yfp+fWp3P1ebYeG+dax4m47DFp6FLckrENjGI1aEDYCTobDpxDLYNDXAVtpasGOw + s4oEtjAwAlvo2mgh8PUJb0UUlOMWvgD3e/My4o4jbpWXHHErcLsDcassCocSp2PLiNMUEjdGezFK + PK1IiDuXj4ISd0rW5EQNuK3HOZ3jdgW4Y+cy1pZlrVEGiNpaHACS1qyP0NqUs5Hhdw4aQ5yF8Hhh + zDwgYESORMwjbG0B29i3jK3h2BoJLFxNLO0drna8cSRnIcWbpIhx+HAkRmWcVlDOAPVl0HAbzI0M + G0GbWpKTecbaXGcNsXUZa83qWAD3SbQKGJc2oFnYycByLZMUgV0Lj8RY2EnFAHsWD68wWQZph4Lw + iUE3JrRtTfZ0RltfoR1X7luX0VassjW5IFDa5LuDtLXAbVBp05Fl0qYppO2MIK042mlFYiHG5N5C + PcRIpciSCNuNObS6rmwRO5exlqyyrWZZO8WxBs+adDKwTNmau+z1JAHVeYE15Po96QtG/HoWfCR4 + IHfbs0Jh+Jy2LFA2xN5luIHF7T1r2p677lnt2ctHMrNM2jQ14A4o/aiy04LURhTpyNiIklpxrm1r + N3bZgwLaIvb+Tzv8/7l5+wf35VDF+AwAAA== headers: Access-Control-Allow-Credentials: - 'true' @@ -44,9 +45,9 @@ interactions: Content-Type: - application/json; charset=utf-8 Date: - - Thu, 29 Feb 2024 04:42:50 GMT + - Thu, 09 May 2024 15:33:04 GMT Etag: - - W/"cd0-Rv/ywzhqPUdb7KJ/ZDpUXIC8K1A" + - W/"cf8-QiT4ARSPwS2WpuJ8xk9gvh9vqrg" Server: - nginx/1.18.0 (Ubuntu) Transfer-Encoding: From 83476ada465dbb3fd249922859ef11621a3e313e Mon Sep 17 00:00:00 2001 From: Henrique Joaquim Date: Thu, 9 May 2024 23:55:54 +0100 Subject: [PATCH 3/3] [Feature] Update chart creation so it doesn't break the command execution (#6382) * chart execution to not break the whole call * pylint: disable=broad-exception-caught --------- Co-authored-by: Danglewood <85772166+deeleeramone@users.noreply.github.com> --- .../core/openbb_core/app/command_runner.py | 50 +++++++++++-------- 1 file changed, 29 insertions(+), 21 deletions(-) diff --git a/openbb_platform/core/openbb_core/app/command_runner.py b/openbb_platform/core/openbb_core/app/command_runner.py index 4d9985a2172..cf74f75c87a 100644 --- a/openbb_platform/core/openbb_core/app/command_runner.py +++ b/openbb_platform/core/openbb_core/app/command_runner.py @@ -304,31 +304,38 @@ class StaticCommandRunner: **kwargs, ) -> None: """Create a chart from the command output.""" - if "charting" not in obbject.accessors: - raise OpenBBError( - "Charting is not installed. Please install `openbb-charting`." - ) - chart_params = {} - extra_params = kwargs.get("extra_params", {}) + try: + if "charting" not in obbject.accessors: + raise OpenBBError( + "Charting is not installed. Please install `openbb-charting`." + ) + chart_params = {} + extra_params = kwargs.get("extra_params", {}) - if hasattr(extra_params, "__dict__") and hasattr(extra_params, "chart_params"): - chart_params = kwargs["extra_params"].__dict__.get("chart_params", {}) - elif isinstance(extra_params, dict) and "chart_params" in extra_params: - chart_params = kwargs["extra_params"].get("chart_params", {}) + if hasattr(extra_params, "__dict__") and hasattr( + extra_params, "chart_params" + ): + chart_params = kwargs["extra_params"].__dict__.get("chart_params", {}) + elif isinstance(extra_params, dict) and "chart_params" in extra_params: + chart_params = kwargs["extra_params"].get("chart_params", {}) - if "chart_params" in kwargs and kwargs["chart_params"] is not None: - chart_params.update(kwargs.pop("chart_params", {})) + if "chart_params" in kwargs and kwargs["chart_params"] is not None: + chart_params.update(kwargs.pop("chart_params", {})) - if ( - "kwargs" in kwargs - and "chart_params" in kwargs["kwargs"] - and kwargs["kwargs"].get("chart_params") is not None - ): - chart_params.update(kwargs.pop("kwargs", {}).get("chart_params", {})) + if ( + "kwargs" in kwargs + and "chart_params" in kwargs["kwargs"] + and kwargs["kwargs"].get("chart_params") is not None + ): + chart_params.update(kwargs.pop("kwargs", {}).get("chart_params", {})) - if chart_params: - kwargs.update(chart_params) - obbject.charting.show(render=False, **kwargs) + if chart_params: + kwargs.update(chart_params) + obbject.charting.show(render=False, **kwargs) + except Exception as e: # pylint: disable=broad-exception-caught + if Env().DEBUG_MODE: + raise OpenBBError(e) from e + warn(str(e), OpenBBWarning) # pylint: disable=R0913, R0914 @classmethod @@ -449,6 +456,7 @@ class StaticCommandRunner: except Exception as e: if Env().DEBUG_MODE: raise OpenBBError(e) from e + warn(str(e), OpenBBWarning) return obbject