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

Release 3.2.1 #5289

Merged
merged 61 commits into from
Aug 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
a0ff0d4
Merge pull request #5251 from OpenBB-finance/fix/reports
jmaslek Jul 24, 2023
3af4be3
fix headTitle (#5253)
deeleeramone Jul 25, 2023
aca982e
fix duplicated table (#5252)
deeleeramone Jul 25, 2023
41d1359
Check token expiration before request (#5255)
montezdesousa Jul 26, 2023
73348c0
Fix issue where incorrect key for biztoc prints exception (#5257)
jmaslek Jul 27, 2023
dc30ab3
Hotfix/ locking when deploying streamlit app (#5261)
tehcoderer Jul 29, 2023
d212a8e
hotfix/gdp-units - better GDP units (#5262)
deeleeramone Jul 31, 2023
3b5fc53
Adds details/image for installing C++ Build Tools (#5268)
deeleeramone Aug 1, 2023
ae91a3f
Hotfix `economy/overview` rates displaying as dates (#5269)
tehcoderer Aug 1, 2023
0753719
Move hub api keys ts (#5267)
montezdesousa Aug 1, 2023
373c4f1
Update all_api_keys.json (#5277)
DidierRLopes Aug 3, 2023
d575c5d
Fwd P/E regex fix (#5273)
deeleeramone Aug 3, 2023
f1eee44
Feature/options_views: Add a Variety of Views/Charts to Extend the Op…
deeleeramone Aug 3, 2023
564d08e
add `--india` flag to `stocks/load` (#5281)
the-praxs Aug 4, 2023
2798508
fix databento (#5287)
jmaslek Aug 7, 2023
19e6b61
Fixed the get routines to meet the new backend standard (#5271)
colin99d Aug 7, 2023
3d579ca
3.2 -> 3.2.1
jmaslek Aug 7, 2023
d3b3990
Update changelogs
jmaslek Aug 7, 2023
71122ee
fix vsurf labels
jmaslek Aug 7, 2023
32c3a5d
Remove deprecated argument from yfinance dl
jmaslek Aug 7, 2023
7978cef
Fix #5272
jmaslek Aug 7, 2023
ee76e95
deprecate econometrics/season
jmaslek Aug 7, 2023
47c9086
fix: #5263 #5264 (#5290)
tehcoderer Aug 7, 2023
5759eba
Fix #5258
jmaslek Aug 7, 2023
dfd8e7c
Merge branch 'develop' into release/3.2.1
jmaslek Aug 7, 2023
fcde988
Update finvizfinance version to fix #5158
jmaslek Aug 7, 2023
be96f3b
Add historical futures docstring
jmaslek Aug 7, 2023
32f1b79
fix lint
jmaslek Aug 7, 2023
74a7fcb
fix conflict docstrings (#5293)
tehcoderer Aug 8, 2023
ed78b5e
Merge branch 'develop' into release/3.2.1
jmaslek Aug 8, 2023
1523f3f
Feature/news sentiment (#5274)
Sai-132 Aug 8, 2023
2362885
Merge branch 'develop' into release/3.2.1
jmaslek Aug 8, 2023
e122a0b
fix wsb/deprecate spacc
jmaslek Aug 8, 2023
fc2b690
Merge remote-tracking branch 'upstream/release/3.2.1' into release/3.2.1
jmaslek Aug 8, 2023
673b22f
fix sdk
jmaslek Aug 8, 2023
d3f4752
Allow the exe command to run URLs (#5295)
colin99d Aug 9, 2023
10031fe
Merge branch 'develop' into release/3.2.1
jmaslek Aug 9, 2023
581fd94
hotfix/options-hist: Fixes `options/hist` to display date column when…
deeleeramone Aug 9, 2023
f4cdc3d
Merge branch 'develop' into release/3.2.1
jmaslek Aug 9, 2023
47092a2
autocomplete
jmaslek Aug 9, 2023
6cf0939
hotfix/ `/stocks/fa/pt` show all price targets on hover (#5305)
tehcoderer Aug 10, 2023
8b1fded
Merge branch 'develop' into release/3.2.1
jmaslek Aug 10, 2023
02732e9
rename -v -> -d in forecast/season
jmaslek Aug 10, 2023
2178a67
Merge remote-tracking branch 'upstream/release/3.2.1' into release/3.2.1
jmaslek Aug 10, 2023
f822b0a
Update README.md
DidierRLopes Aug 13, 2023
db746aa
Silly (#5313)
DidierRLopes Aug 13, 2023
0121012
--debug points to dev env (#5316)
DidierRLopes Aug 14, 2023
3d6ad59
few more updates (#5317)
DidierRLopes Aug 14, 2023
3e48648
small fixy (#5318)
DidierRLopes Aug 14, 2023
c40c3f7
Creates a "--dev" flag that points to dev backend for testing with hu…
DidierRLopes Aug 14, 2023
5ddeb8f
Fix regex (#5320)
DidierRLopes Aug 14, 2023
c000c6e
Merge branch 'release/3.2.1' into hotfix/macro-routines-to-hub
jmaslek Aug 14, 2023
2c44cae
add back --url auto complete
jmaslek Aug 14, 2023
99a5459
mypy
jmaslek Aug 14, 2023
889a986
pylint + test
jmaslek Aug 14, 2023
3ee60e0
Merge pull request #5312 from OpenBB-finance/hotfix/macro-routines-to…
jmaslek Aug 14, 2023
f4460fb
tests
jmaslek Aug 14, 2023
2b2ccac
more tests
jmaslek Aug 14, 2023
c6b0bfe
hotfix/simplify-regex (#5324)
DidierRLopes Aug 15, 2023
a2d0c57
update changelog
jmaslek Aug 15, 2023
6a3aeb5
Merge branch 'main' into release/3.2.1
jmaslek Aug 16, 2023
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
5 changes: 0 additions & 5 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,16 @@ tag-template: 'v$NEXT_MINOR_VERSION'
exclude-contributors:
- 'jmaslek'
- 'DidierRLopes'
- 'JerBouma'
- 'deeleeramone'
- 'hjoaquim'
- 'jose-donato'
- 'luqmanbello'
- 'martinb-bb'
- 'montezdesousa'
- 'tehcoderer'
- 'Chavithra'
- 'colin99d'
- 'northern-64bit'
- 'piiq'
- 'andrewkenreich'
- 'IgorWounds'
- 'jerryduluk'
- 'minhhoang1023'

template: |
Expand Down
12 changes: 12 additions & 0 deletions .github/workflows/linting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,3 +63,15 @@ jobs:
uses: docker://avtodev/markdown-lint:v1
with:
args: "./*.md ./changelogs/*.md ./openbb_terminal/**/*.md ./discordbot/**/*.md"

json-yaml-validate:
name: JSON Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: json-yaml-validate
id: json-yaml-validate
uses: GrantBirki/json-yaml-validate@v2.0.0
with:
exclude_file: json_validate_exclude.txt
3 changes: 3 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -1212,6 +1212,9 @@ In order to do that, you'll simply need to choose from one the following files:
1. [local_credentials.json](openbb_terminal/miscellaneous/models/local_credentials.json) --> credentials that should only be stored locally and not pushed to the [OpenBB Hub](https://my.openbb.co/) like brokerage keys or other very sensitive or personal to the user.
2. [hub_credentials.json](openbb_terminal/miscellaneous/models/hub_credentials.json) --> credentials that should be stored in the [OpenBB Hub](https://my.openbb.co/) like API keys to access your favorite providers.

Then just update [all_api_keys.json](openbb_terminal/miscellaneous/models/all_api_keys.json) with the instructions to get
the api key from the data source website. Make sure that this file has the correct `.json` format, otherwise the API keys page in the Hub will break (e.g. in json the last element key-value pair shouldn't be followed by a comma, and the last object in a list of dictionaries should also not be followed by a comma).

> Note: By differentiating between local and hub credentials, we can ensure that the user's credentials are not pushed to the [OpenBB Hub](https://my.openbb.co/) and are only stored locally. This does not mean that the credentials are not secure in the OpenBB Hub, but rather that the user can choose to store them locally if they wish.

### Setting and checking API key
Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,9 @@ Any of our social media platforms: [openbb.co/links](https://openbb.co/links)

## 6. Star History

This is a proxy of our growth and that we are just getting started. But for more metrics important to us check [openbb.co/open](https://openbb.co/open).
This is a proxy of our growth and that we are just getting started.

But for more metrics important to us check [openbb.co/open](https://openbb.co/open).

[![Star History Chart](https://api.star-history.com/svg?repos=openbb-finance/OpenBBTerminal&type=Date)](https://star-history.com/#openbb-finance/OpenBBTerminal&Date)

Expand Down
2 changes: 1 addition & 1 deletion build/docker/compose.env
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
OPENBBTERMINAL_DOCKER_REGISTRY="ghcr.io"
OPENBBTERMINAL_DOCKER_RELEASE_VERSION="3.2.0"
OPENBBTERMINAL_DOCKER_RELEASE_VERSION="3.2.1"
6 changes: 3 additions & 3 deletions build/nsis/setup.nsi
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
!define NAME "OpenBB Terminal"
!define COMPANY "OpenBB"
!define APPFILE "OpenBBTerminal.exe"
!define VERSION "3.2.0"
!define VERSION "3.2.1"
!define SLUG "${NAME} v${VERSION}"

;--------------------------------
Expand All @@ -20,8 +20,8 @@
VIAddVersionKey Comments "An installer for OpenBB Terminal. For additional details, visit OpenBB.co"
VIAddVersionKey CompanyName OpenBB.co
VIAddVersionKey FileDescription "OpenBB Terminal Program"
VIAddVersionKey FileVersion 3.2.0.0
VIAddVersionKey ProductVersion 3.2.0.0
VIAddVersionKey FileVersion 3.2.1.0
VIAddVersionKey ProductVersion 3.2.1.0
VIAddVersionKey InternalName "OpenBB Terminal"

;--------------------------------
Expand Down
4 changes: 2 additions & 2 deletions build/pyinstaller/version.rc
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ VSVersionInfo(
[StringStruct('Comments', 'The OpenBB Terminal. For additional details, visit OpenBB.co'),
StringStruct('CompanyName', 'OpenBB'),
StringStruct('FileDescription', 'OpenBB Terminal Program'),
StringStruct('FileVersion', '3.2.0.0'),
StringStruct('FileVersion', '3.2.1.0'),
StringStruct('InternalName', 'OpenBB Terminal'),
StringStruct('ProductName', 'OpenBB Terminal'),
StringStruct('ProductVersion', '3.2.0.0')])
StringStruct('ProductVersion', '3.2.1.0')])
]),
VarFileInfo([VarStruct('Translation', [1033, 1200])])
]
Expand Down
23 changes: 15 additions & 8 deletions frontend-components/tables/src/components/Table/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,8 @@ export default function Table({
: columns[0];
const indexValue = indexLabel ? row[indexLabel] : null;
const value = row[column];
const only_numbers = value?.toString().replace(/[^0-9]/g, "") ?? "";
const only_numbers =
value?.toString()?.split(".")?.[0]?.replace(/[^0-9]/g, "") ?? "";
const probablyDate =
only_numbers?.length >= 4 &&
(includesDateNames(column) ||
Expand All @@ -197,7 +198,11 @@ export default function Table({
indexValue.toLowerCase().includes("hour") ||
indexValue.toLowerCase().includes("minute"))));

if (probablyDate && isoYearRegex.test(value?.toString()))
if (
probablyDate &&
value?.length === 4 &&
isoYearRegex.test(value?.toString())
)
return value;

if (probablyDate) {
Expand All @@ -219,7 +224,8 @@ export default function Table({
const indexValue = indexLabel ? row.original[indexLabel] : null;
const value = row.original[column];
const valueType = typeof value;
const only_numbers = value?.toString().replace(/[^0-9]/g, "") ?? "";
const only_numbers =
value?.toString()?.split(".")?.[0]?.replace(/[^0-9]/g, "") ?? "";
const probablyDate =
only_numbers?.length >= 4 &&
(includesDateNames(column) ||
Expand All @@ -246,14 +252,15 @@ export default function Table({
</a>
);
}
if (probablyDate && isoYearRegex.test(value?.toString())) {
return <p>{value}</p>;
}

if (
probablyDate &&
!isNaN(new Date(value).getTime()) &&
!isoYearRegex.test(value?.toString())
value?.length === 4 &&
isoYearRegex.test(value?.toString())
) {
return <p>{value}</p>;
}
if (probablyDate && !isNaN(new Date(value).getTime())) {
if (typeof value === "string") {
const date = value.split("T")[0];
const time = value.split("T")[1]?.split(".")[0];
Expand Down
3 changes: 3 additions & 0 deletions json_validate_exclude.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
tests/
openbb_terminal/miscellaneous/gpt_index/index_0.4.json
.devcontainer/devcontainer.json
43 changes: 28 additions & 15 deletions openbb_terminal/account/account_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import logging
from pathlib import Path
from typing import Dict, List, Optional
from uuid import UUID

from openbb_terminal.account.account_view import (
display_default_routines,
Expand Down Expand Up @@ -55,12 +56,12 @@ def __init__(self, queue: Optional[List[str]] = None):
"""Constructor"""
super().__init__(queue)
self.LOCAL_ROUTINES: Dict[str, Path] = {}
self.REMOTE_CHOICES: List[str] = []
self.REMOTE_CHOICES: Dict[str, UUID] = {}

self.DEFAULT_ROUTINES: List[Dict[str, str]] = self.fetch_default_routines()
self.DEFAULT_CHOICES: List[str] = [
r["name"] for r in self.DEFAULT_ROUTINES if "name" in r
]
self.DEFAULT_CHOICES: Dict[str, None] = {
r["name"]: None for r in self.DEFAULT_ROUTINES if "name" in r
}

if session and get_current_user().preferences.USE_PROMPT_TOOLKIT:
self.choices: dict = self.choices_default
Expand All @@ -75,7 +76,11 @@ def update_runtime_choices(self):
{c: {} for c in self.LOCAL_ROUTINES}
)
self.choices["download"]["--name"].update(
{c: {} for c in self.DEFAULT_CHOICES + self.REMOTE_CHOICES}
{
c: {}
for c in list(self.DEFAULT_CHOICES.keys())
+ list(self.REMOTE_CHOICES.keys())
}
)
self.choices["delete"]["--name"].update(
{c: {} for c in self.REMOTE_CHOICES}
Expand Down Expand Up @@ -250,10 +255,12 @@ def call_list(self, other_args: List[str]):
auth_header=get_current_user().profile.get_auth_header(),
page=ns_parser.page,
size=ns_parser.size,
base_url=Hub.BackendEnvironment.BASE_URL,
)
df, page, pages = get_personal_routines_info(response)
if not df.empty:
self.REMOTE_CHOICES += list(df["name"])
temp_dict = dict(zip(df["name"], df["uuid"]))
self.REMOTE_CHOICES = {**self.REMOTE_CHOICES, **temp_dict}
self.update_runtime_choices()
display_personal_routines(df, page, pages)
else:
Expand Down Expand Up @@ -350,6 +357,7 @@ def call_upload(self, other_args: List[str]):
"routine": routine,
"tags": tags,
"public": ns_parser.public,
"base_url": Hub.BackendEnvironment.BASE_URL,
}
response = Hub.upload_routine(**kwargs) # type: ignore

Expand All @@ -366,7 +374,8 @@ def call_upload(self, other_args: List[str]):
console.print("[info]Aborted.[/info]")

if response and response.status_code == 200:
self.REMOTE_CHOICES.append(name)
the_uuid = response.json()["uuid"]
self.REMOTE_CHOICES[name] = the_uuid
self.update_runtime_choices()

# store data in list with "personal/default" to identify data's routine type
Expand Down Expand Up @@ -401,12 +410,14 @@ def call_download(self, other_args: List[str]):
data = []
name = " ".join(ns_parser.name)
# Personal routines
response = Hub.download_routine(
auth_header=get_current_user().profile.get_auth_header(),
name=name,
)
if response and response.status_code == 200:
data = [response.json(), "personal"]
if name in self.REMOTE_CHOICES:
response = Hub.download_routine(
auth_header=get_current_user().profile.get_auth_header(),
uuid=self.REMOTE_CHOICES[name],
base_url=Hub.BackendEnvironment.BASE_URL,
)
if response and response.status_code == 200:
data = [response.json(), "personal"]
# Default routine
elif name in self.DEFAULT_CHOICES:
data = [
Expand Down Expand Up @@ -490,14 +501,15 @@ def call_delete(self, other_args: List[str]):
if i.lower() in ["y", "yes"]:
response = Hub.delete_routine(
auth_header=get_current_user().profile.get_auth_header(),
name=name,
uuid=self.REMOTE_CHOICES[name],
base_url=Hub.BackendEnvironment.BASE_URL,
)
if (
response
and response.status_code == 200
and name in self.REMOTE_CHOICES
):
self.REMOTE_CHOICES.remove(name)
self.REMOTE_CHOICES.pop(name)
self.update_runtime_choices()
else:
console.print("[info]Aborted.[/info]")
Expand Down Expand Up @@ -543,6 +555,7 @@ def call_generate(self, other_args: List[str]) -> None:

response = Hub.generate_personal_access_token(
auth_header=get_current_user().profile.get_auth_header(),
base_url=Hub.BackendEnvironment.BASE_URL,
days=ns_parser.days,
)
if response and response.status_code == 200:
Expand Down
43 changes: 35 additions & 8 deletions openbb_terminal/account/account_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,34 @@
from openbb_terminal.rich_config import console


def clean_df(df: pd.DataFrame) -> pd.DataFrame:
"""
Cleans the dataframe before displaying it.

Parameters
----------
df : pd.DataFrame
The dataframe to clean.

Returns
-------
pd.DataFrame
The cleaned dataframe.
"""
df["updated_date"] = pd.to_datetime(df["updated_date"])
df["updated_date"] = df["updated_date"].dt.strftime("%Y-%m-%d %H:%M:%S")
df.replace(to_replace=[None], value="-", inplace=True)
to_rename = {
"name": "Name",
"description": "Description",
"version": "Version",
"updated_date": "Last Update",
}
df = df.rename(columns=to_rename)
df = df[["Name", "Description", "Version", "Last Update"]]
return df


def display_personal_routines(df: pd.DataFrame, page: int, pages: int):
"""Display the routines.

Expand All @@ -20,18 +48,17 @@ def display_personal_routines(df: pd.DataFrame, page: int, pages: int):
title = f"Personal routines - page {page}"
if pages:
title += f" of {pages}"
df = clean_df(df)

df["updated_date"] = pd.to_datetime(df["updated_date"])
df["updated_date"] = df["updated_date"].dt.strftime("%Y-%m-%d %H:%M:%S")
df.replace(to_replace=[None], value="-", inplace=True)
print_rich_table(
df=df,
title=title,
headers=["Name", "Description", "Version", "Last update"],
headers=list(df.columns),
show_index=True,
index_name="#",
)
except Exception:
except Exception as exc:
print(exc)
console.print("Failed to display personal routines.")


Expand All @@ -44,9 +71,9 @@ def display_default_routines(df: pd.DataFrame):
The default routines list.
"""
try:
df["date_updated"] = pd.to_datetime(df["date_updated"])
df["date_updated"] = df["date_updated"].dt.strftime("%Y-%m-%d %H:%M:%S")
df.replace(to_replace=[None], value="-", inplace=True)
df = df.rename(columns={"date_updated": "updated_date"})
print(df)
df = clean_df(df)
print_rich_table(
df=df,
title="Default routines",
Expand Down
11 changes: 6 additions & 5 deletions openbb_terminal/common/behavioural_analysis/reddit_view.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""Reddit View."""
__docformat__ = "numpy"

import io
import logging
import os
import textwrap
Expand Down Expand Up @@ -212,10 +213,10 @@ def display_wsb_community(limit: int = 10, new: bool = False):
Flag to sort by new instead of hot, by default False
"""
subs = reddit_model.get_wsb_community(limit, new)
# I am not proud of this, but it works to eliminate the max recursion bug
subs = pd.read_csv(io.StringIO(subs.to_csv()), index_col=0).fillna("-")
if not subs.empty:
# for sub in subs.iterrows():
# print_reddit_post(sub)
print(print_rich_table(subs))
print_rich_table(subs)


@log_start_end(log=logger)
Expand Down Expand Up @@ -282,8 +283,8 @@ def display_redditsent(
Optionally specify the name of the sheet the data is exported to.
export: str
Format to export data
external_axes: Optional[List[plt.Axes]]
If supplied, expect 1 external axis
external_axes : bool, optional
Whether to return the figure object or not, by default False
"""
fig = OpenBBFigure()

Expand Down
Loading