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

Make DataFrame respect allow_None=True #405

Closed
poplarShift opened this issue Apr 30, 2020 · 1 comment · Fixed by #473
Closed

Make DataFrame respect allow_None=True #405

poplarShift opened this issue Apr 30, 2020 · 1 comment · Fixed by #473
Labels
type-bug Bug report
Milestone

Comments

@poplarShift
Copy link

poplarShift commented Apr 30, 2020

Carrying this over from #404.

Should we validate the provided default? Currently, param is e.g. ok with param.Number(default=None, bounds=(1, 100)) but will throw an error at param.DataFrame(default=None, rows=(1, 10)).

Param usually sets allow_None=True if the default is set to None, under the assumption that the Parameterized class author clearly thus intends None to be valid for this Parameter. If param.DataFrame does not do that, I would be happy for such code to be added to param.DataFrame (and to these new classes) to do that; it seems like a reasonable thing to do for the convenience of authors.

It seems like DataFrame sets the allow_None flag accordingly but does not take it into account in _validate.

@jbednar
Copy link
Member

jbednar commented Apr 30, 2020

Ah, that makes sense. Definitely a bug in param.Dataframe, then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type-bug Bug report
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants