diff options
author | Diogo Sousa <montezdesousa@gmail.com> | 2023-10-12 13:36:14 +0100 |
---|---|---|
committer | Diogo Sousa <montezdesousa@gmail.com> | 2023-10-12 13:36:14 +0100 |
commit | 8a30a44555d97132f6bddcbc4a4facdd97ecc591 (patch) | |
tree | fb62488bbbddf3a69988c56babfe5d3c6cd2a4d2 | |
parent | d5240df83aa0dd272778734a38bf073adc9e8757 (diff) |
avoid name collision with validator
-rw-r--r-- | openbb_platform/openbb/package/crypto.py | 4 | ||||
-rw-r--r-- | openbb_platform/openbb/package/economy.py | 14 | ||||
-rw-r--r-- | openbb_platform/openbb/package/fixedincome.py | 20 | ||||
-rw-r--r-- | openbb_platform/openbb/package/forex.py | 6 | ||||
-rw-r--r-- | openbb_platform/openbb/package/news.py | 4 | ||||
-rw-r--r-- | openbb_platform/openbb/package/stocks.py | 10 | ||||
-rw-r--r-- | openbb_platform/openbb/package/stocks_ca.py | 4 | ||||
-rw-r--r-- | openbb_platform/openbb/package/stocks_fa.py | 58 | ||||
-rw-r--r-- | openbb_platform/openbb/package/stocks_options.py | 4 | ||||
-rw-r--r-- | openbb_platform/platform/core/openbb_core/app/static/package_builder.py | 4 |
10 files changed, 64 insertions, 64 deletions
diff --git a/openbb_platform/openbb/package/crypto.py b/openbb_platform/openbb/package/crypto.py index 667afce8601..ea2a9ede960 100644 --- a/openbb_platform/openbb/package/crypto.py +++ b/openbb_platform/openbb/package/crypto.py @@ -6,7 +6,7 @@ from typing import List, Literal, Optional, Union from openbb_core.app.model.custom_parameter import OpenBBCustomParameter from openbb_core.app.model.obbject import OBBject from openbb_core.app.static.container import Container -from openbb_core.app.static.decorators import validate +from openbb_core.app.static.decorators import validate as _validate from openbb_core.app.static.filters import filter_inputs from openbb_provider.abstract.data import Data from typing_extensions import Annotated @@ -20,7 +20,7 @@ class ROUTER_crypto(Container): def __repr__(self) -> str: return self.__doc__ or "" - @validate + @_validate def load( self, symbol: Annotated[ diff --git a/openbb_platform/openbb/package/economy.py b/openbb_platform/openbb/package/economy.py index 9ce17082a84..10d4f0f63da 100644 --- a/openbb_platform/openbb/package/economy.py +++ b/openbb_platform/openbb/package/economy.py @@ -6,7 +6,7 @@ from typing import List, Literal, Optional, Union from openbb_core.app.model.custom_parameter import OpenBBCustomParameter from openbb_core.app.model.obbject import OBBject from openbb_core.app.static.container import Container -from openbb_core.app.static.decorators import validate +from openbb_core.app.static.decorators import validate as _validate from openbb_core.app.static.filters import filter_inputs from openbb_provider.abstract.data import Data from typing_extensions import Annotated @@ -25,7 +25,7 @@ class ROUTER_economy(Container): def __repr__(self) -> str: return self.__doc__ or "" - @validate + @_validate def available_indices( self, provider: Optional[Literal["fmp"]] = None, **kwargs ) -> OBBject[List[Data]]: @@ -77,7 +77,7 @@ class ROUTER_economy(Container): **inputs, ) - @validate + @_validate def const( self, index: Annotated[ @@ -148,7 +148,7 @@ class ROUTER_economy(Container): **inputs, ) - @validate + @_validate def cpi( self, countries: Annotated[ @@ -298,7 +298,7 @@ class ROUTER_economy(Container): **inputs, ) - @validate + @_validate def fred_index( self, symbol: Annotated[ @@ -384,7 +384,7 @@ class ROUTER_economy(Container): **inputs, ) - @validate + @_validate def index( self, symbol: Annotated[ @@ -496,7 +496,7 @@ class ROUTER_economy(Container): **inputs, ) - @validate + @_validate def risk( self, provider: Optional[Literal["fmp"]] = None, **kwargs ) -> OBBject[List[Data]]: diff --git a/openbb_platform/openbb/package/fixedincome.py b/openbb_platform/openbb/package/fixedincome.py index 30c849d4f05..92fd23decce 100644 --- a/openbb_platform/openbb/package/fixedincome.py +++ b/openbb_platform/openbb/package/fixedincome.py @@ -6,7 +6,7 @@ from typing import List, Literal, Optional, Union from openbb_core.app.model.custom_parameter import OpenBBCustomParameter from openbb_core.app.model.obbject import OBBject from openbb_core.app.static.container import Container -from openbb_core.app.static.decorators import validate +from openbb_core.app.static.decorators import validate as _validate from openbb_core.app.static.filters import filter_inputs from openbb_provider.abstract.data import Data from typing_extensions import Annotated @@ -28,7 +28,7 @@ class ROUTER_fixedincome(Container): def __repr__(self) -> str: return self.__doc__ or "" - @validate + @_validate def ameribor( self, start_date: Annotated[ @@ -101,7 +101,7 @@ class ROUTER_fixedincome(Container): **inputs, ) - @validate + @_validate def estr( self, start_date: Annotated[ @@ -175,7 +175,7 @@ class ROUTER_fixedincome(Container): **inputs, ) - @validate + @_validate def fed( self, start_date: Annotated[ @@ -249,7 +249,7 @@ class ROUTER_fixedincome(Container): **inputs, ) - @validate + @_validate def iorb( self, start_date: Annotated[ @@ -321,7 +321,7 @@ class ROUTER_fixedincome(Container): **inputs, ) - @validate + @_validate def projections( self, provider: Optional[Literal["fred"]] = None, **kwargs ) -> OBBject[List[Data]]: @@ -386,7 +386,7 @@ class ROUTER_fixedincome(Container): **inputs, ) - @validate + @_validate def sofr( self, start_date: Annotated[ @@ -456,7 +456,7 @@ class ROUTER_fixedincome(Container): **inputs, ) - @validate + @_validate def sonia( self, start_date: Annotated[ @@ -529,7 +529,7 @@ class ROUTER_fixedincome(Container): **inputs, ) - @validate + @_validate def treasury( self, start_date: Annotated[ @@ -619,7 +619,7 @@ class ROUTER_fixedincome(Container): **inputs, ) - @validate + @_validate def ycrv( self, date: Annotated[ diff --git a/openbb_platform/openbb/package/forex.py b/openbb_platform/openbb/package/forex.py index 7f1f5037846..9c569b536b7 100644 --- a/openbb_platform/openbb/package/forex.py +++ b/openbb_platform/openbb/package/forex.py @@ -6,7 +6,7 @@ from typing import List, Literal, Optional, Union from openbb_core.app.model.custom_parameter import OpenBBCustomParameter from openbb_core.app.model.obbject import OBBject from openbb_core.app.static.container import Container -from openbb_core.app.static.decorators import validate +from openbb_core.app.static.decorators import validate as _validate from openbb_core.app.static.filters import filter_inputs from openbb_provider.abstract.data import Data from typing_extensions import Annotated @@ -21,7 +21,7 @@ class ROUTER_forex(Container): def __repr__(self) -> str: return self.__doc__ or "" - @validate + @_validate def load( self, symbol: Annotated[ @@ -133,7 +133,7 @@ class ROUTER_forex(Container): **inputs, ) - @validate + @_validate def pairs( self, provider: Optional[Literal["fmp", "intrinio", "polygon"]] = None, **kwargs ) -> OBBject[List[Data]]: diff --git a/openbb_platform/openbb/package/news.py b/openbb_platform/openbb/package/news.py index ec843f8f4dc..8c67d7f89c3 100644 --- a/openbb_platform/openbb/package/news.py +++ b/openbb_platform/openbb/package/news.py @@ -5,7 +5,7 @@ from typing import List, Literal, Optional from openbb_core.app.model.custom_parameter import OpenBBCustomParameter from openbb_core.app.model.obbject import OBBject from openbb_core.app.static.container import Container -from openbb_core.app.static.decorators import validate +from openbb_core.app.static.decorators import validate as _validate from openbb_core.app.static.filters import filter_inputs from openbb_provider.abstract.data import Data from typing_extensions import Annotated @@ -19,7 +19,7 @@ class ROUTER_news(Container): def __repr__(self) -> str: return self.__doc__ or "" - @validate + @_validate def globalnews( self, limit: Annotated[ diff --git a/openbb_platform/openbb/package/stocks.py b/openbb_platform/openbb/package/stocks.py index 6c1ca9eab63..ce3a483b0c1 100644 --- a/openbb_platform/openbb/package/stocks.py +++ b/openbb_platform/openbb/package/stocks.py @@ -7,7 +7,7 @@ from annotated_types import Ge from openbb_core.app.model.custom_parameter import OpenBBCustomParameter from openbb_core.app.model.obbject import OBBject from openbb_core.app.static.container import Container -from openbb_core.app.static.decorators import validate +from openbb_core.app.static.decorators import validate as _validate from openbb_core.app.static.filters import filter_inputs from openbb_provider.abstract.data import Data from typing_extensions import Annotated @@ -39,7 +39,7 @@ class ROUTER_stocks(Container): return stocks_fa.ROUTER_stocks_fa(command_runner=self._command_runner) - @validate + @_validate def load( self, symbol: Annotated[ @@ -169,7 +169,7 @@ class ROUTER_stocks(Container): **inputs, ) - @validate + @_validate def multiples( self, symbol: Annotated[ @@ -349,7 +349,7 @@ class ROUTER_stocks(Container): **inputs, ) - @validate + @_validate def news( self, symbols: Annotated[ @@ -484,7 +484,7 @@ class ROUTER_stocks(Container): return stocks_options.ROUTER_stocks_options(command_runner=self._command_runner) - @validate + @_validate def quote( self, symbol: Annotated[ diff --git a/openbb_platform/openbb/package/stocks_ca.py b/openbb_platform/openbb/package/stocks_ca.py index ce7535a919e..3f998c03357 100644 --- a/openbb_platform/openbb/package/stocks_ca.py +++ b/openbb_platform/openbb/package/stocks_ca.py @@ -5,7 +5,7 @@ from typing import List, Literal, Optional, Union from openbb_core.app.model.custom_parameter import OpenBBCustomParameter from openbb_core.app.model.obbject import OBBject from openbb_core.app.static.container import Container -from openbb_core.app.static.decorators import validate +from openbb_core.app.static.decorators import validate as _validate from openbb_core.app.static.filters import filter_inputs from openbb_provider.abstract.data import Data from typing_extensions import Annotated @@ -19,7 +19,7 @@ class ROUTER_stocks_ca(Container): def __repr__(self) -> str: return self.__doc__ or "" - @validate + @_validate def peers( self, symbol: Annotated[ diff --git a/openbb_platform/openbb/package/stocks_fa.py b/openbb_platform/openbb/package/stocks_fa.py index 1f20200a10d..aeef0cf2c24 100644 --- a/openbb_platform/openbb/package/stocks_fa.py +++ b/openbb_platform/openbb/package/stocks_fa.py @@ -6,7 +6,7 @@ from typing import List, Literal, Optional, Union from openbb_core.app.model.custom_parameter import OpenBBCustomParameter from openbb_core.app.model.obbject import OBBject from openbb_core.app.static.container import Container -from openbb_core.app.static.decorators import validate +from openbb_core.app.static.decorators import validate as _validate from openbb_core.app.static.filters import filter_inputs from openbb_provider.abstract.data import Data from typing_extensions import Annotated @@ -47,7 +47,7 @@ class ROUTER_stocks_fa(Container): def __repr__(self) -> str: return self.__doc__ or "" - @validate + @_validate def balance( self, symbol: Annotated[ @@ -266,7 +266,7 @@ class ROUTER_stocks_fa(Container): **inputs, ) - @validate + @_validate def balance_growth( self, symbol: Annotated[ @@ -410,7 +410,7 @@ class ROUTER_stocks_fa(Container): **inputs, ) - @validate + @_validate def cal( self, start_date: Annotated[ @@ -490,7 +490,7 @@ class ROUTER_stocks_fa(Container): **inputs, ) - @validate + @_validate def cash( self, symbol: Annotated[ @@ -689,7 +689,7 @@ class ROUTER_stocks_fa(Container): **inputs, ) - @validate + @_validate def cash_growth( self, symbol: Annotated[ @@ -815,7 +815,7 @@ class ROUTER_stocks_fa(Container): **inputs, ) - @validate + @_validate def comp( self, symbol: Annotated[ @@ -894,7 +894,7 @@ class ROUTER_stocks_fa(Container): **inputs, ) - @validate + @_validate def comsplit( self, start_date: Annotated[ @@ -968,7 +968,7 @@ class ROUTER_stocks_fa(Container): **inputs, ) - @validate + @_validate def divs( self, symbol: Annotated[ @@ -1035,7 +1035,7 @@ class ROUTER_stocks_fa(Container): **inputs, ) - @validate + @_validate def earning( self, symbol: Annotated[ @@ -1113,7 +1113,7 @@ class ROUTER_stocks_fa(Container): **inputs, ) - @validate + @_validate def emp( self, symbol: Annotated[ @@ -1184,7 +1184,7 @@ class ROUTER_stocks_fa(Container): **inputs, ) - @validate + @_validate def est( self, symbol: Annotated[ @@ -1295,7 +1295,7 @@ class ROUTER_stocks_fa(Container): **inputs, ) - @validate + @_validate def filings( self, symbol: Annotated[ @@ -1373,7 +1373,7 @@ class ROUTER_stocks_fa(Container): **inputs, ) - @validate + @_validate def income( self, symbol: Annotated[ @@ -1572,7 +1572,7 @@ class ROUTER_stocks_fa(Container): **inputs, ) - @validate + @_validate def income_growth( self, symbol: Annotated[ @@ -1697,7 +1697,7 @@ class ROUTER_stocks_fa(Container): **inputs, ) - @validate + @_validate def ins( self, symbol: Annotated[ @@ -1819,7 +1819,7 @@ class ROUTER_stocks_fa(Container): **inputs, ) - @validate + @_validate def ins_own( self, symbol: Annotated[ @@ -1959,7 +1959,7 @@ class ROUTER_stocks_fa(Container): **inputs, ) - @validate + @_validate def metrics( self, symbol: Annotated[ @@ -2150,7 +2150,7 @@ class ROUTER_stocks_fa(Container): **inputs, ) - @validate + @_validate def mgmt( self, symbol: Annotated[ @@ -2217,7 +2217,7 @@ class ROUTER_stocks_fa(Container): **inputs, ) - @validate + @_validate def overview( self, symbol: Annotated[ @@ -2342,7 +2342,7 @@ class ROUTER_stocks_fa(Container): **inputs, ) - @validate + @_validate def own( self, symbol: Annotated[ @@ -2487,7 +2487,7 @@ class ROUTER_stocks_fa(Container): **inputs, ) - @validate + @_validate def pt( self, symbol: Annotated[ @@ -2550,7 +2550,7 @@ class ROUTER_stocks_fa(Container): **inputs, ) - @validate + @_validate def pta( self, symbol: Annotated[ @@ -2633,7 +2633,7 @@ class ROUTER_stocks_fa(Container): **inputs, ) - @validate + @_validate def ratios( self, symbol: Annotated[ @@ -2816,7 +2816,7 @@ class ROUTER_stocks_fa(Container): **inputs, ) - @validate + @_validate def revgeo( self, symbol: Annotated[ @@ -2897,7 +2897,7 @@ class ROUTER_stocks_fa(Container): **inputs, ) - @validate + @_validate def revseg( self, symbol: Annotated[ @@ -2968,7 +2968,7 @@ class ROUTER_stocks_fa(Container): **inputs, ) - @validate + @_validate def shrs( self, symbol: Annotated[ @@ -3033,7 +3033,7 @@ class ROUTER_stocks_fa(Container): **inputs, ) - @validate + @_validate def split( self, symbol: Annotated[ @@ -3094,7 +3094,7 @@ class ROUTER_stocks_fa(Container): **inputs, ) - @validate + @_validate def transcript( self, symbol: Annotated[ diff --git a/openbb_platform/openbb/package/stocks_options.py b/openbb_platform/openbb/package/stocks_options.py index 4c8fc8a0f6c..d8873f0642e 100644 --- a/openbb_platform/openbb/package/stocks_options.py +++ b/openbb_platform/openbb/package/stocks_options.py @@ -5,7 +5,7 @@ from typing import List, Literal, Optional, Union from openbb_core.app.model.custom_parameter import OpenBBCustomParameter from openbb_core.app.model.obbject import OBBject from openbb_core.app.static.container import Container -from openbb_core.app.static.decorators import validate +from openbb_core.app.static.decorators import validate as _validate from openbb_core.app.static.filters import filter_inputs from openbb_provider.abstract.data import Data from typing_extensions import Annotated @@ -19,7 +19,7 @@ class ROUTER_stocks_options(Container): def __repr__(self) -> str: return self.__doc__ or "" - @validate + @_validate def chains( self, symbol: Annotated[ diff --git a/openbb_platform/platform/core/openbb_core/app/static/package_builder.py b/openbb_platform/platform/core/openbb_core/app/static/package_builder.py index 7f610b76359..cc280f5b9f7 100644 --- a/openbb_platform/platform/core/openbb_core/app/static/package_builder.py +++ b/openbb_platform/platform/core/openbb_core/app/static/package_builder.py @@ -262,7 +262,7 @@ class ImportDefinition: else: code += "\nfrom typing_extensions import Annotated" code += "\nfrom openbb_core.app.utils import df_to_basemodel" - code += "\nfrom openbb_core.app.static.decorators import validate\n" + code += "\nfrom openbb_core.app.static.decorators import validate as _validate\n" code += "\nfrom openbb_core.app.static.filters import filter_inputs\n" code += "\nfrom openbb_provider.abstract.data import Data" if path.startswith("/qa"): @@ -727,7 +727,7 @@ class MethodDefinition: if "pandas.DataFrame" in func_params else "" ) - code = f"\n @validate{args}" + code = f"\n @_validate{args}" code += f"\n def {func_name}(self, {func_params}) -> {func_returns}:\n" return code |