Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug fix] - explicit multiple items docstring #6127

Merged
merged 7 commits into from
Feb 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions openbb_platform/core/openbb_core/app/provider_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,13 +219,13 @@ def _create_field(

additional_description = ""
if (extra := field.json_schema_extra) and (
multiple := extra.get("multiple_items_allowed")
multiple := extra.get("multiple_items_allowed") # type: ignore
):
if provider_name:
additional_description += " Multiple items allowed."
else:
additional_description += (
" Multiple items allowed: " + ", ".join(multiple) + "."
" Multiple items allowed for provider(s): " + ", ".join(multiple) + "." # type: ignore
)

provider_field = (
Expand Down
4 changes: 2 additions & 2 deletions openbb_platform/openbb/package/crypto_price.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def historical(
symbol: Annotated[
Union[str, List[str]],
OpenBBCustomParameter(
description="Symbol to get data for. Can use CURR1-CURR2 or CURR1CURR2 format. Multiple items allowed: fmp, polygon, yfinance."
description="Symbol to get data for. Can use CURR1-CURR2 or CURR1CURR2 format. Multiple items allowed for provider(s): fmp, polygon, yfinance."
),
],
start_date: Annotated[
Expand All @@ -49,7 +49,7 @@ def historical(
Parameters
----------
symbol : Union[str, List[str]]
Symbol to get data for. Can use CURR1-CURR2 or CURR1CURR2 format. Multiple items allowed: fmp, polygon, yfinance.
Symbol to get data for. Can use CURR1-CURR2 or CURR1CURR2 format. Multiple items allowed for provider(s): fmp, polygon, yfinance.
start_date : Union[datetime.date, None, str]
Start date of the data, in YYYY-MM-DD format.
end_date : Union[datetime.date, None, str]
Expand Down
4 changes: 2 additions & 2 deletions openbb_platform/openbb/package/currency_price.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def historical(
symbol: Annotated[
Union[str, List[str]],
OpenBBCustomParameter(
description="Symbol to get data for. Can use CURR1-CURR2 or CURR1CURR2 format. Multiple items allowed: polygon, yfinance."
description="Symbol to get data for. Can use CURR1-CURR2 or CURR1CURR2 format. Multiple items allowed for provider(s): polygon, yfinance."
),
],
start_date: Annotated[
Expand Down Expand Up @@ -56,7 +56,7 @@ def historical(
Parameters
----------
symbol : Union[str, List[str]]
Symbol to get data for. Can use CURR1-CURR2 or CURR1CURR2 format. Multiple items allowed: polygon, yfinance.
Symbol to get data for. Can use CURR1-CURR2 or CURR1CURR2 format. Multiple items allowed for provider(s): polygon, yfinance.
start_date : Union[datetime.date, None, str]
Start date of the data, in YYYY-MM-DD format.
end_date : Union[datetime.date, None, str]
Expand Down
2 changes: 1 addition & 1 deletion openbb_platform/openbb/package/derivatives_options.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ def chains(
close_ask_time : Optional[datetime]
The time of the ask closing price for the option that day.
prev_close : Optional[float]

The previous close price.
change : Optional[float]
The change in the price of the option.
change_percent : Optional[float]
Expand Down
14 changes: 7 additions & 7 deletions openbb_platform/openbb/package/economy.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ def cpi(
country: Annotated[
Union[str, List[str]],
OpenBBCustomParameter(
description="The country to get data. Multiple items allowed: fred."
description="The country to get data. Multiple items allowed for provider(s): fred."
),
],
units: Annotated[
Expand Down Expand Up @@ -279,7 +279,7 @@ def cpi(
Parameters
----------
country : Union[str, List[str]]
The country to get data. Multiple items allowed: fred.
The country to get data. Multiple items allowed for provider(s): fred.
units : Literal['growth_previous', 'growth_same', 'index_2015']
The unit of measurement for the data.
Options:
Expand Down Expand Up @@ -359,7 +359,7 @@ def fred_regional(
symbol: Annotated[
Union[str, List[str]],
OpenBBCustomParameter(
description="Symbol to get data for. Multiple items allowed: fred."
description="Symbol to get data for. Multiple items allowed for provider(s): fred."
),
],
start_date: Annotated[
Expand Down Expand Up @@ -388,7 +388,7 @@ def fred_regional(
Parameters
----------
symbol : Union[str, List[str]]
Symbol to get data for. Multiple items allowed: fred.
Symbol to get data for. Multiple items allowed for provider(s): fred.
start_date : Union[datetime.date, None, str]
Start date of the data, in YYYY-MM-DD format.
end_date : Union[datetime.date, None, str]
Expand Down Expand Up @@ -470,7 +470,7 @@ def fred_regional(
The date of the data.
region : Optional[str]
The name of the region. (provider: fred)
code : Optional[Union[str, int]]
code : Optional[Union[int, str]]
The code of the region. (provider: fred)
value : Optional[Union[float, int]]
The obersvation value. The units are defined in the search results by series ID. (provider: fred)
Expand Down Expand Up @@ -636,7 +636,7 @@ def fred_series(
symbol: Annotated[
Union[str, List[str]],
OpenBBCustomParameter(
description="Symbol to get data for. Multiple items allowed: fred."
description="Symbol to get data for. Multiple items allowed for provider(s): fred."
),
],
start_date: Annotated[
Expand All @@ -663,7 +663,7 @@ def fred_series(
Parameters
----------
symbol : Union[str, List[str]]
Symbol to get data for. Multiple items allowed: fred.
Symbol to get data for. Multiple items allowed for provider(s): fred.
start_date : Union[datetime.date, None, str]
Start date of the data, in YYYY-MM-DD format.
end_date : Union[datetime.date, None, str]
Expand Down
6 changes: 3 additions & 3 deletions openbb_platform/openbb/package/equity.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ def market_snapshots(
close : Optional[float]
The close price.
prev_close : Optional[float]
The previous closing price of the stock.
The previous close price.
change : Optional[float]
The change in price.
change_percent : Optional[float]
Expand Down Expand Up @@ -229,7 +229,7 @@ def profile(
symbol: Annotated[
Union[str, List[str]],
OpenBBCustomParameter(
description="Symbol to get data for. Multiple items allowed: fmp, intrinio, yfinance."
description="Symbol to get data for. Multiple items allowed for provider(s): fmp, intrinio, yfinance."
),
],
provider: Optional[Literal["fmp", "intrinio", "yfinance"]] = None,
Expand All @@ -240,7 +240,7 @@ def profile(
Parameters
----------
symbol : Union[str, List[str]]
Symbol to get data for. Multiple items allowed: fmp, intrinio, yfinance.
Symbol to get data for. Multiple items allowed for provider(s): fmp, intrinio, yfinance.
provider : Optional[Literal['fmp', 'intrinio', 'yfinance']]
The provider to use for the query, by default None.
If None, the provider specified in defaults is selected or 'fmp' if there is
Expand Down
8 changes: 4 additions & 4 deletions openbb_platform/openbb/package/equity_estimates.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ def consensus(
symbol: Annotated[
Union[str, List[str]],
OpenBBCustomParameter(
description="Symbol to get data for. Multiple items allowed: yfinance."
description="Symbol to get data for. Multiple items allowed for provider(s): yfinance."
),
],
provider: Optional[Literal["fmp", "yfinance"]] = None,
Expand All @@ -210,7 +210,7 @@ def consensus(
Parameters
----------
symbol : Union[str, List[str]]
Symbol to get data for. Multiple items allowed: yfinance.
Symbol to get data for. Multiple items allowed for provider(s): yfinance.
provider : Optional[Literal['fmp', 'yfinance']]
The provider to use for the query, by default None.
If None, the provider specified in defaults is selected or 'fmp' if there is
Expand Down Expand Up @@ -403,7 +403,7 @@ def price_target(
symbol: Annotated[
Union[str, None, List[str]],
OpenBBCustomParameter(
description="Symbol to get data for. Multiple items allowed: benzinga."
description="Symbol to get data for. Multiple items allowed for provider(s): benzinga."
),
] = None,
limit: Annotated[
Expand All @@ -418,7 +418,7 @@ def price_target(
Parameters
----------
symbol : Union[str, None, List[str]]
Symbol to get data for. Multiple items allowed: benzinga.
Symbol to get data for. Multiple items allowed for provider(s): benzinga.
limit : int
The number of data entries to return.
provider : Optional[Literal['benzinga', 'fmp']]
Expand Down
Loading
Loading