Skip to content

Commit a9aec9f

Browse files
authored
Merge pull request #6618 from OpenBB-finance/release/4.3.1
[Release] Merge Release/4.3.1 Into Main
2 parents fe649ac + 0eeff8b commit a9aec9f

File tree

347 files changed

+79448
-36497
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

347 files changed

+79448
-36497
lines changed

.devcontainer/devcontainer.json

-13
This file was deleted.

.github/workflows/general-linting.yml

+1
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ jobs:
6363
# Run linters for openbb_platform | cli
6464
if [ -n "${{ env.diff_files }}" ]; then
6565
black --diff --check ${{ env.diff_files }}
66+
mypy ${{ env.diff_files }} --ignore-missing-imports --scripts-are-modules --check-untyped-defs
6667
pydocstyle ${{ env.diff_files }}
6768
pylint ${{ env.diff_files }}
6869
ruff check ${{ env.diff_files }}

.github/workflows/gh-branch-name-check.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ jobs:
6060
if: steps.check-comment.outputs.commentExists == 'false'
6161
run: |
6262
reason="${{ steps.check-develop-branch.outputs.reason }}${{ steps.check-main-branch.outputs.reason }}"
63-
gh pr comment ${{ github.event.pull_request.number }} --body "$reason Please review our [branch naming guidelines](https://github.com/OpenBB-finance/OpenBB/blob/develop/CONTRIBUTING.md#branch-naming-conventions)."
63+
gh pr comment ${{ github.event.pull_request.number }} --body "$reason Please review our [branch naming guidelines](https://docs.openbb.co/platform/developer_guide/github#branch-naming-conventions)."
6464
env:
6565
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6666

README.md

+3
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,10 @@ Offers access to equity, options, crypto, forex, macro economy, fixed income, an
2121

2222
Sign up to the [OpenBB Hub](https://my.openbb.co/login) to get the most out of the OpenBB ecosystem.
2323

24+
We have also open source an AI financial analyst agent that can access all the data within OpenBB, and that repo can be found [here](https://github.com/OpenBB-finance/openbb-agents).
25+
2426
---
27+
2528
If you are looking for the first AI financial terminal for professionals, the OpenBB Terminal Pro can be found at [pro.openbb.co](https://pro.openbb.co)
2629

2730
<a href="https://pro.openbb.co">

assets/extensions/provider.json

+7
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,13 @@
137137
"website": "https://intrinio.com",
138138
"instructions": "Go to: https://intrinio.com/starter-plan\n\n![Intrinio](https://user-images.githubusercontent.com/85772166/219207556-fcfee614-59f1-46ae-bff4-c63dd2f6991d.png)\n\nAn API key will be issued with a subscription. Find the token value within the account dashboard."
139139
},
140+
{
141+
"packageName": "openbb-multpl",
142+
"optional": true,
143+
"description": "Public broad-market data published to https://multpl.com.",
144+
"credentials": [],
145+
"website": "https://www.multpl.com/"
146+
},
140147
{
141148
"packageName": "openbb-nasdaq",
142149
"optional": true,

cli/openbb_cli/argparse_translator/argparse_translator.py

+7-5
Original file line numberDiff line numberDiff line change
@@ -400,22 +400,23 @@ def execute_func(
400400
"""
401401
kwargs = self._unflatten_args(vars(parsed_args))
402402
kwargs = self._update_with_custom_types(kwargs)
403-
404403
provider = kwargs.get("provider")
405-
provider_args = []
404+
provider_args: List = []
406405
if provider and provider in self.provider_parameters:
407406
provider_args = self.provider_parameters[provider]
408407
else:
409408
for args in self.provider_parameters.values():
410409
provider_args.extend(args)
411410

412-
# remove kwargs that doesn't match the signature or provider parameters
411+
# remove kwargs not matching the signature, provider parameters, or are empty.
413412
kwargs = {
414413
key: value
415414
for key, value in kwargs.items()
416-
if key in self.signature.parameters or key in provider_args
415+
if (
416+
(key in self.signature.parameters or key in provider_args)
417+
and (value or value is False)
418+
)
417419
}
418-
419420
return self.func(**kwargs)
420421

421422
def parse_args_and_execute(self) -> Any:
@@ -426,6 +427,7 @@ def parse_args_and_execute(self) -> Any:
426427
Any: The return value of the original function.
427428
"""
428429
parsed_args = self._parser.parse_args()
430+
429431
return self.execute_func(parsed_args)
430432

431433
def translate(self) -> Callable:

cli/openbb_cli/controllers/base_platform_controller.py

+2
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,8 @@ def method(self, other_args: List[str], translator=translator):
232232
fig = obbject.chart.fig if obbject.chart else None
233233
if not export:
234234
obbject.show()
235+
elif session.settings.USE_INTERACTIVE_DF and not export:
236+
obbject.charting.table()
235237
else:
236238
if isinstance(df.columns, pd.RangeIndex):
237239
df.columns = [str(i) for i in df.columns]

cli/openbb_cli/controllers/utils.py

+7-25
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,8 @@
1616
import numpy as np
1717
import pandas as pd
1818
import requests
19-
from openbb import obb
20-
from openbb_charting.core.backend import create_backend, get_backend
2119
from openbb_cli.config.constants import AVAILABLE_FLAIRS, ENV_FILE_SETTINGS
2220
from openbb_cli.session import Session
23-
from openbb_core.app.model.charts.charting_settings import ChartingSettings
2421
from openbb_core.app.model.obbject import OBBject
2522
from pytz import all_timezones, timezone
2623
from rich.table import Table
@@ -303,20 +300,6 @@ def return_colored_value(value: str):
303300
return f"{value}"
304301

305302

306-
def _get_backend():
307-
"""Get the Platform charting backend."""
308-
try:
309-
return get_backend()
310-
except ValueError:
311-
# backend might not be created yet
312-
charting_settings = ChartingSettings(
313-
system_settings=obb.system, user_settings=obb.user # type: ignore
314-
)
315-
create_backend(charting_settings)
316-
get_backend().start(debug=charting_settings.debug_mode)
317-
return get_backend()
318-
319-
320303
# pylint: disable=too-many-arguments
321304
def print_rich_table( # noqa: PLR0912
322305
df: pd.DataFrame,
@@ -385,7 +368,7 @@ def print_rich_table( # noqa: PLR0912
385368
isinstance(df[col].iloc[x], pd.Timestamp)
386369
for x in range(min(10, len(df)))
387370
):
388-
df[col] = pd.to_numeric(df[col], errors="ignore")
371+
df[col] = df[col].apply(pd.to_numeric)
389372
except (ValueError, TypeError):
390373
df[col] = df[col].astype(str)
391374

@@ -396,7 +379,7 @@ def _get_headers(_headers: Union[List[str], pd.Index]) -> List[str]:
396379
output = list(_headers)
397380
if len(output) != len(df.columns):
398381
raise ValueError("Length of headers does not match length of DataFrame.")
399-
return output
382+
return output # type: ignore
400383

401384
if session.settings.USE_INTERACTIVE_DF:
402385
df_outgoing = df.copy()
@@ -414,10 +397,7 @@ def _get_headers(_headers: Union[List[str], pd.Index]) -> List[str]:
414397
if col == "":
415398
df_outgoing = df_outgoing.rename(columns={col: " "})
416399

417-
# ensure everything on the dataframe is a string
418-
df_outgoing = df_outgoing.applymap(str)
419-
420-
_get_backend().send_table(
400+
session._backend.send_table( # type: ignore # pylint: disable=protected-access
421401
df_table=df_outgoing,
422402
title=title,
423403
theme=session.user.preferences.table_style,
@@ -1014,12 +994,14 @@ def handle_obbject_display(
1014994
if obbject.chart:
1015995
obbject.show(**kwargs)
1016996
else:
1017-
obbject.charting.to_chart(**kwargs)
997+
obbject.charting.to_chart(**kwargs) # type: ignore
1018998
if export:
1019-
fig = obbject.chart.fig
999+
fig = obbject.chart.fig # type: ignore
10201000
df = obbject.to_dataframe()
10211001
except Exception as e:
10221002
session.console.print(f"Failed to display chart: {e}")
1003+
elif session.settings.USE_INTERACTIVE_DF:
1004+
obbject.charting.table() # type: ignore
10231005
else:
10241006
df = obbject.to_dataframe()
10251007
print_rich_table(

cli/openbb_cli/session.py

+19
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@
55
from typing import Optional
66

77
from openbb import obb
8+
from openbb_charting.core.backend import create_backend, get_backend
89
from openbb_core.app.model.abstract.singleton import SingletonMeta
10+
from openbb_core.app.model.charts.charting_settings import ChartingSettings
911
from openbb_core.app.model.user_settings import UserSettings as User
1012
from prompt_toolkit import PromptSession
1113

@@ -17,11 +19,26 @@
1719
from openbb_cli.models.settings import Settings
1820

1921

22+
def _get_backend():
23+
"""Get the Platform charting backend."""
24+
try:
25+
return get_backend()
26+
except ValueError:
27+
# backend might not be created yet
28+
charting_settings = ChartingSettings(
29+
system_settings=obb.system, user_settings=obb.user # type: ignore
30+
)
31+
create_backend(charting_settings)
32+
get_backend().start(debug=charting_settings.debug_mode) # type: ignore
33+
return get_backend()
34+
35+
2036
class Session(metaclass=SingletonMeta):
2137
"""Session class."""
2238

2339
def __init__(self):
2440
"""Initialize session."""
41+
2542
self._obb = obb
2643
self._settings = Settings()
2744
self._style = Style(
@@ -34,6 +51,8 @@ def __init__(self):
3451
self._prompt_session = self._get_prompt_session()
3552
self._obbject_registry = Registry()
3653

54+
self._backend = _get_backend()
55+
3756
@property
3857
def user(self) -> User:
3958
"""Get platform user."""

0 commit comments

Comments
 (0)