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

Improvement in config_regressors Null Check in df_utils.py to Prevent AttributeError #1535

Closed
1 task done
Chrystiano opened this issue Feb 15, 2024 · 3 comments · Fixed by #1536
Closed
1 task done

Comments

@Chrystiano
Copy link

Prerequisites

  • I have done all of the following:
    • Reproduced the problem in a new virtualenv with only neuralprophet installed, directly from GitHub.
    • Checked the Answered Questions on the Github Discussion board and found no solution to my issue.
    • Verified that my issue isn't already filed under existing issues.
    • Considered posting a question but determined my issue is a bug that needs addressing.

Describe the bug

An AttributeError occurs when config_regressors is None, specifically in df_utils.py at line 991, when attempting to access regressors attribute of a NoneType object in configurations using future regressors.

To Reproduce

  1. Install NeuralProphet from GitHub in a new virtual environment.
  2. With a DataFrame that includes a future regressor column 'temperature'. (https://neuralprophet.com/tutorials/tutorial06.html#Tutorial-6:-Future-regressors)
  3. Setting the model to include a future regressor with add_future_regressor('temperature').
  4. After running m.fit(df) followed by m.predict(df).
  5. Encountered AttributeError: 'NoneType' object has no attribute 'regressors'.

Expected behavior

Expected the model to handle future regressors gracefully without throwing an error, even when config_regressors is not explicitly defined for some paths through the data.

What actually happens

The error occurs consistently when predicting with future regressors without prior validation of config_regressors.

Environment

  • Python environment: Python 3.11.5, in a standalone venv with only neuralprophet installed.
  • NeuralProphet version: 1.0.0rc7.

Additional context

The issue can be mitigated by checking if config_regressors is not None before attempting to access its regressors attribute, ensuring robust error handling and preventing runtime errors.

@ourownstory
Copy link
Owner

Thank you @Chrystiano for providing a clear issue description. I will look into this.

@ourownstory
Copy link
Owner

This bug was introduced in #1008

@ourownstory
Copy link
Owner

@Chrystiano fixed in #1536. Will be merged shortly and will create new RC with fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants