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

as.data.table of empty ParamSet should have same columns as for non-empty ParamSet #342

Open
mb706 opened this issue Mar 7, 2021 · 0 comments

Comments

@mb706
Copy link
Contributor

mb706 commented Mar 7, 2021

> as.data.table(ps(x = p_lgl()))
   id    class lower upper      levels nlevels is_bounded special_vals        default storage_type tags
1:  x ParamLgl    NA    NA  TRUE,FALSE       2       TRUE    <list[0]> <NoDefault[3]>      logical     
> as.data.table(ps())
Null data.table (0 rows and 0 cols)

The result should ideally be the same as

> as.data.table(ps(x = p_lgl()))[0]
Empty data.table (0 rows and 11 cols): id,class,lower,upper,levels,nlevels...

This makes it easier to work with data.tables without having to check the edge-case on the user's side.

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

No branches or pull requests

1 participant