elixir-explorer / explorer

Series (one-dimensional) and dataframes (two-dimensional) for fast and elegant data exploration in Elixir
https://hexdocs.pm/explorer
MIT License
1.12k stars 123 forks source link

Discrepancy between typespec for Series.cast/2 (parameter dtype) and implementation #958

Closed sesamzoo closed 2 months ago

sesamzoo commented 3 months ago

At least in/until version 0.9.0, the typespec of Series.cast/2 allows the type dtype() for its dtype parameter.

The dtype() spec doesn't include :integer.

:integer is used in one of the examples in the documentation and actually works.

I haven't checked for any other cases.

philss commented 3 months ago

Yeah, you are rignt. I think we should accept dtype() | dtype_alias() - the last one could be integer_dtype_alias() | float_dtype_alias(). WDYT?

PRs are welcome :)