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

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

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).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #973      +/-   ##
==========================================
- Coverage   87.24%   87.22%   -0.03%     
==========================================
  Files           9        9              
  Lines        4948     4938      -10     
==========================================
- Hits         4317     4307      -10     
  Misses        631      631              

☔ 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?

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