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

Address deprecations: remove _param_watchers, raise RuntimeError on unsafe ops during init, and failed validation of a parameter default after inheritance #973

Merged
merged 5 commits into from
Nov 26, 2024

Conversation

maximlt
Copy link
Member

@maximlt maximlt commented Nov 6, 2024

This PR touches these deprecated features that are now emitted at the FutureWarning level:

Warning Description Action
ParamFutureWarning since 2.0.0 Parameterized namespace / instance._param_watchers (getter and setter): use instead the property inst.param.watchers Removed
ParamFutureWarning since 2.0.0 Warn on failed validation of the default value of a Parameter after the inheritance mechanism has completed raises RuntimeError
ParamFutureWarning since 2.0.0 Running unsafe instance.param.objects(instance=True) during Parameterized instance initialization, instead run it after having called super().__init__(**params) raises RuntimeError
ParamFutureWarning since 2.0.0 Running unsafe instance.param.trigger(<>) during Parameterized instance initialization, instead run it after having called super().__init__(**params) raises RuntimeError
ParamFutureWarning since 2.0.0 Running unsafe instance.param.watch(callback, "<param_name>") during Parameterized instance initialization, instead run it after having called super().__init__(**params) raises RuntimeError

Copy link

codecov bot commented Nov 6, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 87.22%. Comparing base (71e8e47) to head (289bbc6).
Report is 4 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #973      +/-   ##
==========================================
- Coverage   87.26%   87.22%   -0.05%     
==========================================
  Files           9        9              
  Lines        4948     4938      -10     
==========================================
- Hits         4318     4307      -11     
- Misses        630      631       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@hoxbro hoxbro left a comment

Choose a reason for hiding this comment

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

LGTM.

I can see we in panel have some compatibility code around _param_watchers. This compatibility code could be removed, right?

@maximlt maximlt merged commit 08dd44d into main Nov 26, 2024
16 checks passed
@maximlt maximlt deleted the remove_deprecated_features_at_futurewarning branch November 26, 2024 15:38
@maximlt
Copy link
Member Author

maximlt commented Nov 26, 2024

I can see we in panel have some compatibility code around _param_watchers. This compatibility code could be removed, right?

holoviz/panel#7527

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 this pull request may close these issues.

2 participants