这是indexloc提供的服务,不要输入任何密码
Skip to content

Bug fixing #3680

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

Merged
merged 7 commits into from
Dec 2, 2022
Merged

Bug fixing #3680

merged 7 commits into from
Dec 2, 2022

Conversation

jmaslek
Copy link
Contributor

@jmaslek jmaslek commented Dec 1, 2022

Fixes #3670 (Also changes the sdk function slightly)

Fixes #3674

@jmaslek jmaslek added the bug Bugs and bug fixes label Dec 1, 2022
@reviewpad reviewpad bot added the feat S label Dec 1, 2022
@reviewpad reviewpad bot added the feat M label Dec 1, 2022
@montezdesousa
Copy link
Contributor

I'm getting this warning when inputting a date that is not available, in this case 2022-12-01 onwards. In this case we should fallback to the last available as before imo

Screenshot 2022-12-02 at 09 34 33

@jmaslek
Copy link
Contributor Author

jmaslek commented Dec 2, 2022

I'm getting this warning when inputting a date that is not available, in this case 2022-12-01 onwards. In this case we should fallback to the last available as before imo

Screenshot 2022-12-02 at 09 34 33

I silenced that warning by changing the fred model:

Screenshot 2022-12-02 at 8 54 51 AM

However I am noticing some weird things. If I specify a date, I always get the most recent it looks like?

    if date not in df.index:
        date_of_yield = df.index[-1].strftime("%Y-%m-%d")
        rates = pd.DataFrame(df.iloc[-1, :].values, columns=["Rate"])

This does what you suggest by getting the closest date, and there is the following block in the model which I think is causing the problems of not getting the most recent:

    if date is None:
        date = (datetime.now() - timedelta(days=7)).strftime("%Y-%m-%d")

Will push some better logic later today. Also open to thoughts

@jmaslek
Copy link
Contributor Author

jmaslek commented Dec 2, 2022

@montezdesousa I have the following. Without a date argument, it passes the last date data is available:
Screenshot 2022-12-02 at 9 51 43 AM

If I enter a weekend, it gets the next day:
Screenshot 2022-12-02 at 9 52 59 AM

And if I enter the future, new message:

2022 Dec 02, 09:52 (🦋) /economy/ $ ycrv -d 2040-10-10

Date cannot be today or in the future
Yield data not found for 2040-10-10.

@montezdesousa
Copy link
Contributor

@montezdesousa I have the following. Without a date argument, it passes the last date data is available: Screenshot 2022-12-02 at 9 51 43 AM

If I enter a weekend, it gets the next day: Screenshot 2022-12-02 at 9 52 59 AM

And if I enter the future, new message:

2022 Dec 02, 09:52 (🦋) /economy/ $ ycrv -d 2040-10-10

Date cannot be today or in the future
Yield data not found for 2040-10-10.

oof, sorry I must be looking to wrong branch, this ok in yours

@montezdesousa
Copy link
Contributor

Seems to work fine for me
Screenshot 2022-12-02 at 17 41 32

@montezdesousa montezdesousa self-requested a review December 2, 2022 17:46
@jmaslek jmaslek merged commit f47d150 into OpenBB-finance:main Dec 2, 2022
@jmaslek jmaslek deleted the bugsv0 branch December 2, 2022 19:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bugs and bug fixes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[IMPROVE] fred search should allow multiple words [Bug] economy/ycrv is broken and has issues giving data from other countries
2 participants