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

improve deprecation error messages #715

Merged
merged 1 commit into from
Dec 4, 2023
Merged

improve deprecation error messages #715

merged 1 commit into from
Dec 4, 2023

Conversation

jmoralez
Copy link
Member

The deprecation message for not providing a df to one of the methods that needs it always referenced the constructor, but they'll also be printed if someone reuses a dataset built with another method, e.g. the following code

sf = StatsForecast(models, freq)
sf.fit(df=df)
sf.forecast(h=2)

would show the deprecation warning about providing the df to the constructor, even though it wasn't provided to it. This changes the message slightly to suggest that the df may come from either the constructor or a previous method.

Also now raises an informative error if the df wasn't provided at all, e.g. the following code

sf = StatsForecast(models, freq)
sf.fit()

would raise a confusing error about the StatsForecast object not having a ga attribute. This now asks for the df argument to be provided.

Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

Copy link
Member

@AzulGarza AzulGarza left a comment

Choose a reason for hiding this comment

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

LGTM :)

@jmoralez jmoralez merged commit 1fc40f9 into main Dec 4, 2023
16 checks passed
@jmoralez jmoralez deleted the improve-err-msgs branch December 4, 2023 20:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants