diff options
author | Danglewood <85772166+deeleeramone@users.noreply.github.com> | 2024-05-15 00:37:36 -0700 |
---|---|---|
committer | Danglewood <85772166+deeleeramone@users.noreply.github.com> | 2024-05-15 00:37:36 -0700 |
commit | 20069e17887910b5e9c4b138d43a5c89ff555420 (patch) | |
tree | c7ebcd39419681a714e9d3e057b291d26f776e7a | |
parent | d80f84be99fd55e912ccb3838974ec2b3c546829 (diff) |
country not a standard param
5 files changed, 190 insertions, 190 deletions
diff --git a/openbb_platform/core/openbb_core/provider/standard_models/yield_curve.py b/openbb_platform/core/openbb_core/provider/standard_models/yield_curve.py index 6621b68bc6e..97909e40804 100644 --- a/openbb_platform/core/openbb_core/provider/standard_models/yield_curve.py +++ b/openbb_platform/core/openbb_core/provider/standard_models/yield_curve.py @@ -16,9 +16,6 @@ from openbb_core.provider.utils.descriptions import ( class YieldCurveQueryParams(QueryParams): """Yield Curve Query.""" - country: Optional[str] = Field( - default=None, description=QUERY_DESCRIPTIONS.get("country", "") - ) date: Optional[str] = Field( default=None, description=QUERY_DESCRIPTIONS.get("date", "") diff --git a/openbb_platform/obbject_extensions/charting/openbb_charting/charting_router.py b/openbb_platform/obbject_extensions/charting/openbb_charting/charting_router.py index 7923027d450..a2d780b4e92 100644 --- a/openbb_platform/obbject_extensions/charting/openbb_charting/charting_router.py +++ b/openbb_platform/obbject_extensions/charting/openbb_charting/charting_router.py @@ -1400,7 +1400,7 @@ def fixedincome_government_yield_curve( # noqa: PLR0912 ) country = f"United States {curve_type}" elif provider == "econdb": - country = kwargs["standard_params"].get("country") + country = getattr(kwargs["extra_params"], "country", "") country = country.replace("_", " ").title() if country else "United States" country = country + " " if country else "" title = kwargs.get("title", "") diff --git a/openbb_platform/openbb/assets/reference.json b/openbb_platform/openbb/assets/reference.json index 0347b95a417..2d3a028cfca 100644 --- a/openbb_platform/openbb/assets/reference.json +++ b/openbb_platform/openbb/assets/reference.json @@ -2415,203 +2415,203 @@ "default": null, "optional": true, "choices": [ - "spain", - "jordan", - "taiwan", - "romania", + "fiji", + "benin", "mozambique", + "bolivia", + "somalia", + "united_arab_emirates", + "qatar", + "italy", + "mauritius", + "yemen", + "new_zealand", + "papua_new_guinea", + "burundi", "mongolia", + "central_african_republic", + "south_korea", + "oman", + "solomon_islands", + "sierra_leone", + "tunisia", "iraq", - "new_zealand", - "italy", + "congo", "faroe_islands", - "hungary", - "ireland", - "republic_of_the_congo", - "ghana", - "el_salvador", - "gambia", + "nigeria", + "seychelles", + "japan", + "sudan", + "united_kingdom", "tonga", - "malaysia", - "eritrea", - "honduras", - "barbados", - "euro_area", - "portugal", - "burundi", - "united_arab_emirates", - "georgia", - "ukraine", + "grenada", + "hungary", + "libya", "zimbabwe", - "paraguay", - "central_african_republic", - "angola", + "palestine", + "kenya", + "uganda", + "kuwait", + "turkmenistan", + "belarus", + "bermuda", "netherlands", - "suriname", - "somalia", - "albania", - "ecuador", - "belize", - "serbia", - "dominican_republic", - "rwanda", - "algeria", - "bahrain", - "seychelles", - "bosnia_and_herzegovina", - "bulgaria", - "yemen", - "finland", - "iceland", + "djibouti", + "ghana", + "taiwan", + "paraguay", + "equatorial_guinea", + "luxembourg", + "puerto_rico", + "kyrgyzstan", + "comoros", "chad", - "uzbekistan", - "canada", - "myanmar", - "bermuda", - "macao", + "guyana", + "north_macedonia", + "zambia", + "sao_tome_and_principe", + "monaco", + "vietnam", + "greece", + "jordan", + "thailand", + "india", + "el_salvador", + "tajikistan", + "liberia", + "rwanda", + "serbia", + "switzerland", + "russia", + "slovakia", + "lithuania", + "saudi_arabia", + "ecuador", + "malta", "east_timor", - "sweden", + "myanmar", + "niger", + "algeria", + "liechtenstein", "guinea", - "tanzania", - "luxembourg", - "malta", - "jamaica", - "tunisia", - "mexico", - "brunei", - "iran", - "lithuania", - "cyprus", - "botswana", - "bahamas", - "colombia", - "philippines", - "cameroon", - "sao_tome_and_principe", - "kyrgyzstan", - "dominica", - "china", - "moldova", - "cape_verde", "germany", + "kazakhstan", "aruba", + "south_sudan", + "mali", "cuba", - "benin", + "gabon", + "botswana", + "uzbekistan", + "brunei", + "poland", + "ireland", "togo", - "lebanon", - "mauritania", - "ethiopia", - "morocco", - "maldives", - "guatemala", - "singapore", - "chile", - "uruguay", - "belarus", - "brazil", - "kosovo", - "liberia", - "monaco", - "venezuela", - "austria", - "congo", - "sudan", - "qatar", - "azerbaijan", - "indonesia", - "equatorial_guinea", "andorra", - "papua_new_guinea", - "ivory_coast", - "armenia", - "oman", - "latvia", - "pakistan", - "uganda", - "north_macedonia", - "grenada", - "turkmenistan", - "nigeria", - "trinidad_and_tobago", - "samoa", + "iceland", + "mexico", "nicaragua", - "malawi", - "liechtenstein", - "gabon", - "afghanistan", - "south_sudan", - "antigua_and_barbuda", - "namibia", - "bangladesh", - "libya", - "mali", - "panama", - "comoros", - "new_caledonia", - "niger", - "puerto_rico", - "isle_of_man", - "mauritius", - "south_africa", - "swaziland", - "djibouti", - "tajikistan", - "peru", - "thailand", - "turkey", + "brazil", + "dominica", "haiti", + "spain", + "israel", + "montenegro", + "syria", + "sweden", + "france", "hong_kong", + "singapore", + "mauritania", + "malaysia", + "denmark", "madagascar", - "kenya", - "sierra_leone", - "north_korea", - "syria", - "costa_rica", - "bolivia", - "lesotho", - "palestine", - "kazakhstan", - "slovenia", - "united_states", - "australia", - "united_kingdom", - "norway", - "guyana", - "switzerland", + "malawi", + "swaziland", + "trinidad_and_tobago", + "armenia", + "georgia", + "ethiopia", + "tanzania", + "honduras", "laos", + "vanuatu", + "azerbaijan", + "indonesia", + "angola", + "jamaica", + "egypt", + "republic_of_the_congo", + "gambia", + "philippines", + "barbados", + "isle_of_man", + "cameroon", + "macao", + "venezuela", + "cambodia", + "maldives", + "guinea_bissau", "czech_republic", - "saudi_arabia", - "fiji", + "colombia", + "panama", + "lesotho", + "cape_verde", + "costa_rica", + "austria", + "morocco", + "euro_area", + "croatia", + "bulgaria", + "norway", "belgium", - "egypt", + "canada", "bhutan", - "cambodia", - "israel", + "latvia", + "peru", + "guatemala", + "australia", + "bahamas", + "suriname", + "cyprus", + "slovenia", + "uruguay", + "chile", + "samoa", + "ukraine", + "moldova", + "united_states", "senegal", - "vietnam", - "sri_lanka", - "cayman_islands", - "kuwait", - "slovakia", + "belize", + "namibia", + "north_korea", + "finland", + "china", + "bangladesh", "burkina_faso", - "russia", - "solomon_islands", - "argentina", - "estonia", - "india", + "albania", + "eritrea", + "afghanistan", + "bosnia_and_herzegovina", + "portugal", + "south_africa", "kiribati", - "croatia", - "guinea_bissau", - "south_korea", - "zambia", - "japan", - "france", - "montenegro", - "poland", - "denmark", + "cayman_islands", + "ivory_coast", + "iran", + "argentina", "nepal", - "vanuatu", - "greece" + "sri_lanka", + "estonia", + "pakistan", + "antigua_and_barbuda", + "turkey", + "lebanon", + "kosovo", + "romania", + "bahrain", + "new_caledonia", + "dominican_republic" ] }, { @@ -28713,18 +28713,10 @@ "message": null }, "description": "Get yield curve data by country and date.", - "examples": "\nExamples\n--------\n\n```python\nfrom openbb import obb\nobb.fixedincome.government.yield_curve(provider='federal_reserve')\nobb.fixedincome.government.yield_curve(date='2023-05-01,2024-05-01', provider='fmp')\nobb.fixedincome.government.yield_curve(date='2023-05-01', country='united_kingdom', provider='econdb')\nobb.fixedincome.government.yield_curve(provider='fred', yield_curve_type=real, date='2023-05-01,2024-05-01')\n```\n\n", + "examples": "\nExamples\n--------\n\n```python\nfrom openbb import obb\nobb.fixedincome.government.yield_curve(provider='federal_reserve')\nobb.fixedincome.government.yield_curve(date='2023-05-01,2024-05-01', provider='fmp')\nobb.fixedincome.government.yield_curve(date='2023-05-01', country=united_kingdom, provider='econdb')\nobb.fixedincome.government.yield_curve(provider='fred', yield_curve_type=real, date='2023-05-01,2024-05-01')\n```\n\n", "parameters": { "standard": [ { - "name": "country", - "type": "str", - "description": "The country to get data.", - "default": null, - "optional": true, - "choices": null - }, - { "name": "date", "type": "Union[Union[str, str], List[Union[str, str]]]", "description": "A specific date to get data for. By default is the current data. Multiple items allowed for provider(s): econdb, federal_reserve, fmp, fred.", @@ -28747,7 +28739,21 @@ "description": "The country to get data.", "default": "united_states", "optional": true, - "choices": null + "choices": [ + "australia", + "canada", + "china", + "hong_kong", + "india", + "japan", + "russia", + "saudi_arabia", + "south_africa", + "south_korea", + "taiwan", + "united_kingdom", + "united_states" + ] }, { "name": "use_cache", diff --git a/openbb_platform/openbb/package/fixedincome_government.py b/openbb_platform/openbb/package/fixedincome_government.py index 3e72f5387ac..a825712b124 100644 --- a/openbb_platform/openbb/package/fixedincome_government.py +++ b/openbb_platform/openbb/package/fixedincome_government.py @@ -220,9 +220,6 @@ class ROUTER_fixedincome_government(Container): @validate def yield_curve( self, - country: Annotated[ - Optional[str], OpenBBField(description="The country to get data.") - ] = None, date: Annotated[ Union[str, None, List[Optional[str]]], OpenBBField( @@ -241,14 +238,14 @@ class ROUTER_fixedincome_government(Container): Parameters ---------- - country : Optional[str] - The country to get data. date : Union[str, None, List[Optional[str]]] A specific date to get data for. By default is the current data. Multiple comma separated items allowed for provider(s): econdb, federal_reserve, fmp, fred. provider : Optional[Literal['econdb', 'federal_reserve', 'fmp', 'fred']] The provider to use for the query, by default None. If None, the provider specified in defaults is selected or 'econdb' if there is no default. + country : Literal['australia', 'canada', 'china', 'hong_kong', 'india', 'japan', 'russia', 'saudi_arabia', 'south_africa', 'south_korea', 'taiwan', 'united_kingdom', 'united_states'] + The country to get data. (provider: econdb) use_cache : bool If true, cache the request for four hours. (provider: econdb) yield_curve_type : Literal['nominal', 'real', 'breakeven', 'corporate_spot', 'corporate_par'] @@ -297,7 +294,6 @@ class ROUTER_fixedincome_government(Container): ) }, standard_params={ - "country": country, "date": date, }, extra_params=kwargs, diff --git a/openbb_platform/providers/econdb/openbb_econdb/models/yield_curve.py b/openbb_platform/providers/econdb/openbb_econdb/models/yield_curve.py index 0bd95e05e75..ec8093b26ae 100644 --- a/openbb_platform/providers/econdb/openbb_econdb/models/yield_curve.py +++ b/openbb_platform/providers/econdb/openbb_econdb/models/yield_curve.py @@ -28,6 +28,7 @@ class EconDbYieldCurveQueryParams(YieldCurveQueryParams): country: Literal[COUNTRIES] = Field( default="united_states", description=QUERY_DESCRIPTIONS.get("country", ""), + json_schema_extra={"choices": DAILY_COUNTRIES}, ) use_cache: bool = Field( default=True, |