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

Out of the box crypto report #3794

Merged
merged 8 commits into from
Dec 16, 2022
Merged

Conversation

hjoaquim
Copy link
Contributor

@hjoaquim hjoaquim commented Dec 16, 2022

Fixes problems associated with the lack of API keys.
Template reports should work out of the box for every environment/install method.

Fix #3783

@hjoaquim hjoaquim added notebookreports Notebook reports crypto Crypto related labels Dec 16, 2022
@hjoaquim hjoaquim self-assigned this Dec 16, 2022
@reviewpad reviewpad bot added the feat S Small T-Shirt size Feature label Dec 16, 2022
@jmaslek
Copy link
Collaborator

jmaslek commented Dec 16, 2022

Testing out, I get an error in cell 8 which is

news = openbb.crypto.dd.news(symbol=ticker).head(10)

if (isinstance(news,pd.DataFrame) and not news.empty) and news:
    news = news.set_index("published_at")
    news.sort_index()
    news["link"] = news["link"].apply(lambda x: f'<a href="{x}">{x}</a>')
    news
else:
    news = pd.DataFrame()

error:

ValueError: The truth value of a DataFrame is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all().

The not news.empy and news are redundant

@jmaslek
Copy link
Collaborator

jmaslek commented Dec 16, 2022

After fixing the news thing, I still get the same error in get_historical_data:

try:
    historical_data = get_historical_data(ticker, dates)
except Exception as e:
    raise KeyboardInterrupt

Its a KeyError here:

KeyError: 'Close'

The above exception was the direct cause of the following exception:

@jmaslek
Copy link
Collaborator

jmaslek commented Dec 16, 2022

Actually the issue in the load is that the default values, CCXT and binance, do not have BTC/USDT or BTC/USD

@jmaslek
Copy link
Collaborator

jmaslek commented Dec 16, 2022

According to @jose-donato, binance is blocked in the US, so this is a me error lol. Should probably change the source in the report

@hjoaquim
Copy link
Contributor Author

@jmaslek by bad, I messed up the logic - it's fixed now.

@hjoaquim
Copy link
Contributor Author

That makes sense, I was wondering why I didn't have that error

@hjoaquim
Copy link
Contributor Author

@jmaslek changed the load source to use YahooFinance

@reviewpad reviewpad bot added feat M Medium T-Shirt size feature and removed feat S Small T-Shirt size Feature labels Dec 16, 2022
@jmaslek
Copy link
Collaborator

jmaslek commented Dec 16, 2022

@hjoaquim Nice. Now me being in the us is breaking at In[26]:

# last trades
trades = openbb.crypto.dd.trades(symbol=ticker, exchange_id="binance", to_symbol="USDT")
if (isinstance(trades,pd.DataFrame) and not trades.empty) or (not isinstance(trades,pd.DataFrame) and trades):
    trades = trades.set_index("Date")
    trades
else:
    trades = pd.DataFrame()

@hjoaquim
Copy link
Contributor Author

@jmaslek quick solution would be to change country 😆
Pushed another change trying to remove binance everywhere

Copy link
Collaborator

@jmaslek jmaslek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

works now in the US!

@jmaslek jmaslek merged commit af7334a into OpenBB-finance:main Dec 16, 2022
@hjoaquim hjoaquim deleted the fix_reports branch December 17, 2022 09:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
crypto Crypto related feat M Medium T-Shirt size feature notebookreports Notebook reports
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug] Crypto Report with BTC
2 participants