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

Deprecate the Parameter attribute pickle_default_value #1019

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

maximlt
Copy link
Member

@maximlt maximlt commented Feb 11, 2025

Closes #1007

@maximlt maximlt marked this pull request as draft February 11, 2025 20:45
Copy link

codecov bot commented Feb 11, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 87.26%. Comparing base (031a4f4) to head (0e7430e).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1019   +/-   ##
=======================================
  Coverage   87.25%   87.26%           
=======================================
  Files           9        9           
  Lines        4928     4930    +2     
=======================================
+ Hits         4300     4302    +2     
  Misses        628      628           

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

@maximlt
Copy link
Member Author

maximlt commented Feb 11, 2025

Draft for now as I'd like:

@jbednar
Copy link
Member

jbednar commented Feb 12, 2025

I think the problem that pickle_default_value was meant to address would still apply in 2025, in that pickling a value that is dependent on a particular run on a particular system can cause problems when unpickling, but if it's not been supported for some time, may as well worry about this issue next time it comes up in actual practice.

@maximlt
Copy link
Member Author

maximlt commented Feb 13, 2025

Yes, I agree that it sounds like it might be useful. But in practice, it seems like it was never implemented in Param, and no one reported setting pickle_default_value=False has no effect. So I agree that we can worry about it when this comes up again. In fact, deprecating it might lead someone to come here and ask for that feature to be implemented.

In the meantime, I'd like to push adding a metadata slot to Parameters (#898). I think that would allow users to implement their own special Parameter handling without having to create their own Parameter class (I've had the need a few times to label Parameters differently in a class and abused precedence).

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.

Deprecate the Parameter attribute pickle_default_value?
2 participants