From 8806cfaf7c49116f33bf18bc4d7d2fac5da6cf8f Mon Sep 17 00:00:00 2001 From: Danglewood <85772166+deeleeramone@users.noreply.github.com> Date: Tue, 11 Feb 2025 13:26:47 -0800 Subject: [PATCH] deprecate functions --- .../extensions/fixedincome/pyproject.toml | 2 +- openbb_platform/openbb/assets/reference.json | 82 +--------------- .../openbb/package/__extensions__.py | 2 +- .../openbb/package/fixedincome_government.py | 94 +------------------ openbb_platform/poetry.lock | 8 +- openbb_platform/pyproject.toml | 2 +- 6 files changed, 9 insertions(+), 181 deletions(-) diff --git a/openbb_platform/extensions/fixedincome/pyproject.toml b/openbb_platform/extensions/fixedincome/pyproject.toml index 1cb98a99900..f83d05f4586 100644 --- a/openbb_platform/extensions/fixedincome/pyproject.toml +++ b/openbb_platform/extensions/fixedincome/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "openbb-fixedincome" -version = "1.4.0" +version = "1.4.1" description = "Fixed income extension for OpenBB" authors = ["OpenBB Team "] license = "AGPL-3.0-only" diff --git a/openbb_platform/openbb/assets/reference.json b/openbb_platform/openbb/assets/reference.json index 47a6df9e6a0..54cd9d4ea86 100644 --- a/openbb_platform/openbb/assets/reference.json +++ b/openbb_platform/openbb/assets/reference.json @@ -13,7 +13,7 @@ "economy@1.4.0", "equity@1.4.0", "etf@1.4.0", - "fixedincome@1.4.0", + "fixedincome@1.4.1", "index@1.4.0", "news@1.4.0", "regulators@1.4.0" @@ -38325,86 +38325,6 @@ }, "model": "YieldCurve" }, - "/fixedincome/government/us_yield_curve": { - "deprecated": { - "flag": true, - "message": "This endpoint will be removed in a future version. Use, `/fixedincome/government/yield_curve`, instead. Deprecated in OpenBB Platform V4.2 to be removed in V4.4." - }, - "description": "US Yield Curve. Get United States yield curve.", - "examples": "\nExamples\n--------\n\n```python\nfrom openbb import obb\nobb.fixedincome.government.us_yield_curve(provider='fred')\nobb.fixedincome.government.us_yield_curve(inflation_adjusted=True, provider='fred')\n```\n\n", - "parameters": { - "standard": [ - { - "name": "date", - "type": "Union[date, str]", - "description": "A specific date to get data for. Defaults to the most recent FRED entry.", - "default": null, - "optional": true, - "choices": null - }, - { - "name": "inflation_adjusted", - "type": "bool", - "description": "Get inflation adjusted rates.", - "default": false, - "optional": true, - "choices": null - } - ], - "fred": [] - }, - "returns": { - "OBBject": [ - { - "name": "results", - "type": "List[USYieldCurve]", - "description": "Serializable results." - }, - { - "name": "provider", - "type": "Optional[Literal['fred']]", - "description": "Provider name." - }, - { - "name": "warnings", - "type": "Optional[List[Warning_]]", - "description": "List of warnings." - }, - { - "name": "chart", - "type": "Optional[Chart]", - "description": "Chart object." - }, - { - "name": "extra", - "type": "Dict[str, Any]", - "description": "Extra info." - } - ] - }, - "data": { - "standard": [ - { - "name": "maturity", - "type": "float", - "description": "Maturity of the treasury rate in years.", - "default": "", - "optional": false, - "choices": null - }, - { - "name": "rate", - "type": "float", - "description": "Associated rate given in decimal form (0.05 is 5%)", - "default": "", - "optional": false, - "choices": null - } - ], - "fred": [] - }, - "model": "USYieldCurve" - }, "/fixedincome/government/treasury_rates": { "deprecated": { "flag": null, diff --git a/openbb_platform/openbb/package/__extensions__.py b/openbb_platform/openbb/package/__extensions__.py index 8b4c795a8bf..64c7e100383 100644 --- a/openbb_platform/openbb/package/__extensions__.py +++ b/openbb_platform/openbb/package/__extensions__.py @@ -28,7 +28,7 @@ Extensions: - economy@1.4.0 - equity@1.4.0 - etf@1.4.0 - - fixedincome@1.4.0 + - fixedincome@1.4.1 - index@1.4.0 - news@1.4.0 - regulators@1.4.0 diff --git a/openbb_platform/openbb/package/fixedincome_government.py b/openbb_platform/openbb/package/fixedincome_government.py index 023694a40ea..02a2ccb04cd 100644 --- a/openbb_platform/openbb/package/fixedincome_government.py +++ b/openbb_platform/openbb/package/fixedincome_government.py @@ -2,22 +2,19 @@ import datetime from typing import List, Literal, Optional, Union -from warnings import simplefilter, warn -from openbb_core.app.deprecation import OpenBBDeprecationWarning from openbb_core.app.model.field import OpenBBField from openbb_core.app.model.obbject import OBBject from openbb_core.app.static.container import Container from openbb_core.app.static.utils.decorators import exception_handler, validate from openbb_core.app.static.utils.filters import filter_inputs -from typing_extensions import Annotated, deprecated +from typing_extensions import Annotated class ROUTER_fixedincome_government(Container): """/fixedincome/government tips_yields treasury_rates - us_yield_curve yield_curve """ @@ -244,95 +241,6 @@ class ROUTER_fixedincome_government(Container): ) ) - @exception_handler - @validate - @deprecated( - "This endpoint will be removed in a future version. Use, `/fixedincome/government/yield_curve`, instead. Deprecated in OpenBB Platform V4.2 to be removed in V4.4.", - category=OpenBBDeprecationWarning, - ) - def us_yield_curve( - self, - date: Annotated[ - Union[datetime.date, None, str], - OpenBBField( - description="A specific date to get data for. Defaults to the most recent FRED entry." - ), - ] = None, - inflation_adjusted: Annotated[ - Optional[bool], OpenBBField(description="Get inflation adjusted rates.") - ] = False, - provider: Annotated[ - Optional[Literal["fred"]], - OpenBBField( - description="The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: fred." - ), - ] = None, - **kwargs - ) -> OBBject: - """US Yield Curve. Get United States yield curve. - - Parameters - ---------- - date : Union[date, None, str] - A specific date to get data for. Defaults to the most recent FRED entry. - inflation_adjusted : Optional[bool] - Get inflation adjusted rates. - provider : Optional[Literal['fred']] - The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: fred. - - Returns - ------- - OBBject - results : List[USYieldCurve] - Serializable results. - provider : Optional[Literal['fred']] - Provider name. - warnings : Optional[List[Warning_]] - List of warnings. - chart : Optional[Chart] - Chart object. - extra : Dict[str, Any] - Extra info. - - USYieldCurve - ------------ - maturity : float - Maturity of the treasury rate in years. - rate : float - Associated rate given in decimal form (0.05 is 5%) - - Examples - -------- - >>> from openbb import obb - >>> obb.fixedincome.government.us_yield_curve(provider='fred') - >>> obb.fixedincome.government.us_yield_curve(inflation_adjusted=True, provider='fred') - """ # noqa: E501 - - simplefilter("always", DeprecationWarning) - warn( - "This endpoint will be removed in a future version. Use, `/fixedincome/government/yield_curve`, instead. Deprecated in OpenBB Platform V4.2 to be removed in V4.4.", - category=DeprecationWarning, - stacklevel=2, - ) - - return self._run( - "/fixedincome/government/us_yield_curve", - **filter_inputs( - provider_choices={ - "provider": self._get_provider( - provider, - "fixedincome.government.us_yield_curve", - ("fred",), - ) - }, - standard_params={ - "date": date, - "inflation_adjusted": inflation_adjusted, - }, - extra_params=kwargs, - ) - ) - @exception_handler @validate def yield_curve( diff --git a/openbb_platform/poetry.lock b/openbb_platform/poetry.lock index f5f50023cc9..cb2b8de3ceb 100644 --- a/openbb_platform/poetry.lock +++ b/openbb_platform/poetry.lock @@ -2141,15 +2141,15 @@ openbb-core = ">=1.4.0,<2.0.0" [[package]] name = "openbb-fixedincome" -version = "1.4.0" +version = "1.4.1" description = "Fixed income extension for OpenBB" optional = false python-versions = "<4.0,>=3.9" groups = ["main"] markers = "python_version <= \"3.11\" or python_version >= \"3.12\"" files = [ - {file = "openbb_fixedincome-1.4.0-py3-none-any.whl", hash = "sha256:bd9683ac6d66b4a9cd3b0923e96175752ef7925e69ccfd4e6f4e715fad01b52f"}, - {file = "openbb_fixedincome-1.4.0.tar.gz", hash = "sha256:626d65d9aa288bd4db10e808c24bddd737c3fa36b8c8e8f5462cb8f947d15a86"}, + {file = "openbb_fixedincome-1.4.1-py3-none-any.whl", hash = "sha256:5c076a04bd77ba7a2e622c319255259fb447b2ce34d08419ebf2c6380e155336"}, + {file = "openbb_fixedincome-1.4.1.tar.gz", hash = "sha256:7f1825b92bd6fe100363a2c6f5ee47f23d6617db24db28ed182ce08ccd447d37"}, ] [package.dependencies] @@ -4494,4 +4494,4 @@ wsj = ["openbb-wsj"] [metadata] lock-version = "2.1" python-versions = ">=3.9,<3.13" -content-hash = "8c97bee090d707e03d4c60fc1cb423091ec4e7c3f31c61bc96cc6201c11ee1c5" +content-hash = "839a0dbd464af812510f2ec177aeeb9377d33f04162760139b30bd271a716746" diff --git a/openbb_platform/pyproject.toml b/openbb_platform/pyproject.toml index be4dae91dae..3615960dc40 100644 --- a/openbb_platform/pyproject.toml +++ b/openbb_platform/pyproject.toml @@ -36,7 +36,7 @@ openbb-derivatives = "^1.4.0" openbb-economy = "^1.4.0" openbb-equity = "^1.4.0" openbb-etf = "^1.4.0" -openbb-fixedincome = "^1.4.0" +openbb-fixedincome = "^1.4.1" openbb-index = "^1.4.0" openbb-news = "^1.4.0" openbb-regulators = "^1.4.0"