Skip to content

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

Merged
maximlt merged 5 commits into
mainfrom
remove_deprecated_features_at_futurewarning
Nov 26, 2024
Merged

maximlt merged 5 commits into
mainfrom
remove_deprecated_features_at_futurewarning

Conversation

@maximlt

@maximlt maximlt commented Nov 6, 2024 •

Copy link
Copy Markdown
Member

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

@codecov

codecov Bot commented Nov 6, 2024 •

Copy link
Copy Markdown

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.

@maximlt
maximlt requested review from hoxbro and philippjfr November 18, 2024 08:12

@hoxbro hoxbro left a comment

Copy link
Copy Markdown
Member

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
@maximlt
maximlt deleted the remove_deprecated_features_at_futurewarning branch November 26, 2024 15:38
@maximlt

maximlt commented Nov 26, 2024

Copy link
Copy Markdown
Member Author

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