diff --git a/.github/workflows/general-linting.yml b/.github/workflows/general-linting.yml index d6d51d4e1f43..82821ca64250 100644 --- a/.github/workflows/general-linting.yml +++ b/.github/workflows/general-linting.yml @@ -45,7 +45,7 @@ jobs: if: github.event_name == 'pull_request' run: | # "Checking PR diff" - echo "diff_files=$(git diff --diff-filter=d --name-only origin/${{ github.base_ref }}...${{ github.head_ref }} | grep 'openbb_platform/.*\.py$|cli/.*\.py$' | grep -v 'openbb_platform/openbb/package' | grep -v 'integration' | grep -v 'tests' | xargs)" >> $GITHUB_ENV + echo "diff_files=$(git diff --diff-filter=d --name-only origin/${{ github.base_ref }}...${{ github.head_ref }} | grep -E '^(openbb_platform|cli)/.*\.py$' | grep -v 'openbb_platform/openbb/package' | grep -v 'integration' | grep -v 'tests' | xargs)" >> $GITHUB_ENV echo $diff_files - uses: actions/cache@v3 diff --git a/openbb_platform/core/tests/api/test_rest_api.py b/openbb_platform/core/tests/api/test_rest_api.py new file mode 100644 index 000000000000..51b06d60a762 --- /dev/null +++ b/openbb_platform/core/tests/api/test_rest_api.py @@ -0,0 +1,8 @@ +"""Test rest_api.py.""" + +from openbb_core.api.rest_api import app + + +def test_openapi(): + """Test openapi schema generation.""" + assert app.openapi() diff --git a/openbb_platform/extensions/derivatives/pyproject.toml b/openbb_platform/extensions/derivatives/pyproject.toml index c5fb85186b22..c83acbe4e1ef 100644 --- a/openbb_platform/extensions/derivatives/pyproject.toml +++ b/openbb_platform/extensions/derivatives/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "openbb-derivatives" -version = "1.2.3" +version = "1.2.4" description = "Derivatives 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 c1b63983a7ac..0b18132eb397 100644 --- a/openbb_platform/openbb/assets/reference.json +++ b/openbb_platform/openbb/assets/reference.json @@ -1,5 +1,5 @@ { - "openbb": "4.2.2", + "openbb": "4.2.3", "info": { "title": "OpenBB Platform (Python)", "description": "Investment research for everyone, anywhere.", @@ -9,7 +9,7 @@ "commodity@1.1.3", "crypto@1.2.3", "currency@1.2.3", - "derivatives@1.2.3", + "derivatives@1.2.4", "economy@1.2.3", "equity@1.2.3", "etf@1.2.3", @@ -24,7 +24,7 @@ "federal_reserve@1.2.3", "fmp@1.2.3", "fred@1.2.3", - "intrinio@1.2.3", + "intrinio@1.2.4", "oecd@1.2.3", "polygon@1.2.3", "sec@1.2.3", @@ -1216,7 +1216,7 @@ }, { "name": "option_type", - "type": "Literal[None, Union[ForwardRef('call'), ForwardRef('put')]]", + "type": "Literal['call', 'put']", "description": "The option type, call or put, 'None' is both (default).", "default": null, "optional": true, diff --git a/openbb_platform/openbb/package/__extensions__.py b/openbb_platform/openbb/package/__extensions__.py index c4501dad7dbf..c01bc54a306e 100644 --- a/openbb_platform/openbb/package/__extensions__.py +++ b/openbb_platform/openbb/package/__extensions__.py @@ -23,7 +23,7 @@ class Extensions(Container): - commodity@1.1.3 - crypto@1.2.3 - currency@1.2.3 - - derivatives@1.2.3 + - derivatives@1.2.4 - economy@1.2.3 - equity@1.2.3 - etf@1.2.3 @@ -37,7 +37,7 @@ class Extensions(Container): - federal_reserve@1.2.3 - fmp@1.2.3 - fred@1.2.3 - - intrinio@1.2.3 + - intrinio@1.2.4 - oecd@1.2.3 - polygon@1.2.3 - sec@1.2.3 diff --git a/openbb_platform/openbb/package/derivatives_options.py b/openbb_platform/openbb/package/derivatives_options.py index 31fac5248b62..269a05c86a78 100644 --- a/openbb_platform/openbb/package/derivatives_options.py +++ b/openbb_platform/openbb/package/derivatives_options.py @@ -43,7 +43,7 @@ def chains( The provider to use, by default None. If None, the priority list configured in the settings is used. Default priority: intrinio, yfinance. date : Optional[datetime.date] The end-of-day date for options chains data. (provider: intrinio) - option_type : Literal[None, Union[ForwardRef('call'), ForwardRef('put')]] + option_type : Optional[Literal['call', 'put']] The option type, call or put, 'None' is both (default). (provider: intrinio) moneyness : Literal['otm', 'itm', 'all'] Return only contracts that are in or out of the money, default is 'all'. Parameter is ignored when a date is supplied. (provider: intrinio) 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 aebfcbd9c1f2..c466d04711bb 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 @@ -35,7 +35,7 @@ class IntrinioForwardEpsEstimatesQueryParams(ForwardEpsEstimatesQueryParams): description="The future fiscal year to retrieve estimates for." + " When no symbol and year is supplied the current calendar year is used.", ) - fiscal_period: Union[Literal["fy", "q1", "q2", "q3", "q4"], None] = Field( + fiscal_period: Optional[Literal["fy", "q1", "q2", "q3", "q4"]] = Field( default=None, description="The future fiscal period to retrieve estimates for.", ) @@ -44,7 +44,7 @@ class IntrinioForwardEpsEstimatesQueryParams(ForwardEpsEstimatesQueryParams): description="The future calendar year to retrieve estimates for." + " When no symbol and year is supplied the current calendar year is used.", ) - calendar_period: Union[Literal["q1", "q2", "q3", "q4"], None] = Field( + calendar_period: Optional[Literal["q1", "q2", "q3", "q4"]] = Field( default=None, description="The future calendar period to retrieve estimates for.", ) 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 d68223a42b68..54cac4dacc35 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 @@ -35,7 +35,7 @@ class IntrinioForwardSalesEstimatesQueryParams(ForwardSalesEstimatesQueryParams) description="The future fiscal year to retrieve estimates for." + " When no symbol and year is supplied the current calendar year is used.", ) - fiscal_period: Union[Literal["fy", "q1", "q2", "q3", "q4"], None] = Field( + fiscal_period: Optional[Literal["fy", "q1", "q2", "q3", "q4"]] = Field( default=None, description="The future fiscal period to retrieve estimates for.", ) @@ -44,7 +44,7 @@ class IntrinioForwardSalesEstimatesQueryParams(ForwardSalesEstimatesQueryParams) description="The future calendar year to retrieve estimates for." + " When no symbol and year is supplied the current calendar year is used.", ) - calendar_period: Union[Literal["q1", "q2", "q3", "q4"], None] = Field( + calendar_period: Optional[Literal["q1", "q2", "q3", "q4"]] = Field( default=None, description="The future calendar period to retrieve estimates for.", ) diff --git a/openbb_platform/providers/intrinio/openbb_intrinio/models/options_chains.py b/openbb_platform/providers/intrinio/openbb_intrinio/models/options_chains.py index e36828e8aee0..9632bff82814 100644 --- a/openbb_platform/providers/intrinio/openbb_intrinio/models/options_chains.py +++ b/openbb_platform/providers/intrinio/openbb_intrinio/models/options_chains.py @@ -6,7 +6,7 @@ datetime, timedelta, ) -from typing import Any, Dict, List, Literal, Optional, Union +from typing import Any, Dict, List, Literal, Optional from warnings import warn from dateutil import parser @@ -47,7 +47,7 @@ class IntrinioOptionsChainsQueryParams(OptionsChainsQueryParams): date: Optional[dateType] = Field( default=None, description="The end-of-day date for options chains data." ) - option_type: Literal[None, Union["call", "put"]] = Field( + option_type: Optional[Literal["call", "put"]] = Field( default=None, description="The option type, call or put, 'None' is both (default).", json_schema_extra={"choices": ["call", "put"]}, @@ -233,7 +233,7 @@ async def callback(response: ClientResponse, _: Any) -> list: # If the EOD chains are not available for the given date, try the previous day if not results and query.date is not None: date = get_weekday(date - timedelta(days=1)).strftime("%Y-%m-%d") - urls = await get_urls(date) + urls = await get_urls(date.strftime("%Y-%m-%d")) results = await amake_requests(urls, response_callback=callback, **kwargs) if not results: diff --git a/openbb_platform/providers/intrinio/pyproject.toml b/openbb_platform/providers/intrinio/pyproject.toml index b2531ba4550f..ab15cfd6d2ca 100644 --- a/openbb_platform/providers/intrinio/pyproject.toml +++ b/openbb_platform/providers/intrinio/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "openbb-intrinio" -version = "1.2.3" +version = "1.2.4" description = "Intrinio extension for OpenBB" authors = ["OpenBB Team "] license = "AGPL-3.0-only"