-
-
Notifications
You must be signed in to change notification settings - Fork 74
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
Add mechanism to specify that a parameter must be set? #1
Comments
Not currently supported directly. You could approximate it by making the default value be None and adding an explicit test to the object's constructor to raise an exception if the value is still None after the super()'s constructor is called. |
Ahh. I'm currently very much hit by this lack of functionality in my daily work. See https://discourse.holoviz.org/t/how-to-make-parameter-values-mandatory/5124. I had forgotten about this issue. I can also see I've requested this functionality before in @philippjfr suggested on Discourse to add a |
It's not clear in this thread if the functionality has been implemented or what the api will look like. Is there a roadmap to enable a Thanks team, looks like an intricate part of param. |
Hi @LinuxIsCool, This feature hasn't yet been merged into Param and I'm not sure yet about the right API. Marc indeed opened a PR to add a We have decided not to include this feature in Param 2.0 just for the sole purpose to reduce its scope and get it released, it's been long enough in the making! |
Right; this feature has been waiting on 2.0 to be released so that it does not conflict with other APIs we've added, but we should be able to add this in a fast followon after 2.0 is released. We're on release candidate 6 now, I think, so very close! |
Now that 2.0 has been released and out for a while, is there any possibility this will be looked into again? Attempting to adopt Param/Panel in a project I'm using has been a bit difficult after coming from the extensive validation possibilities of Pydantic, and enforcing things like required params would help ease some of that. I saw #724, where implementation was still being discussed, and perhaps that's easier to settle after Param 2's release? |
Is it possible to make a Parameter that has to be set? I.e. if not specified on instance creation, an exception will be raised?
The text was updated successfully, but these errors were encountered: