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

Incorrect typespec return value for Dataframe.dtypes #1002

Closed mooreryan closed 1 month ago

mooreryan commented 1 month ago

Here is the spec for the Dataframe.dtypes function:

https://github.com/elixir-explorer/explorer/blob/ca2ca1f80e4cb994f3182e8d59e9608bad95385e/lib/explorer/data_frame.ex#L2051

Here is the spec for the dtypes field in the DataFrame struct:

https://github.com/elixir-explorer/explorer/blob/ca2ca1f80e4cb994f3182e8d59e9608bad95385e/lib/explorer/data_frame.ex#L262

Given that (and the function's actual behavior), the spec for Dataframe.dtypes should probably be something like this:

@spec dtypes(df :: DataFrame.t()) :: %{String.t() => Explorer.Series.dtype()} 
josevalim commented 1 month ago

Yes, please do send a PR!