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

Add boolean type to Series.in/2 #475

Merged
merged 1 commit into from
Jan 17, 2023

Conversation

miXwui
Copy link
Contributor

@miXwui miXwui commented Jan 17, 2023

This PR fixes the inability to compare two series with boolean type for Series.in/2.

Addition to: #420

Comparing two series of boolean types like so:

left = Explorer.Series.from_list([true, false])
right = Explorer.Series.from_list([false, false, false, true])
Explorer.Series.in(left, right)

Resulted in:

** (ErlangError) Erlang error: :nif_panicked
    (explorer 0.5.0) Explorer.PolarsBackend.Native.s_in(#Inspect.Error<
  got FunctionClauseError with message:

      """
      no function clause matching in Explorer.PolarsBackend.Shared.apply_series/3
      """

  while inspecting:

      %{
        __struct__: Explorer.PolarsBackend.Series,
        resource: #Reference<0.82471402.537788432.41151>
      }

Whereas now it correctly results in:

#Explorer.Series<
  Polars[2]
  boolean [true, true]
>

Please let me know if I should add some extra tests (I'm not sure if it'll be unnecessary noise and to where exactly).

Thanks!

@philss
Copy link
Member

philss commented Jan 17, 2023

Please let me know if I should add some extra tests (I'm not sure if it'll be unnecessary noise and to where exactly).

We could add some tests to the series_test.exs file, but since there is none, let's merge this.

Thank you! 💜

@philss philss merged commit 92c1e52 into elixir-explorer:main Jan 17, 2023
@miXwui miXwui deleted the mwu/add-bool-to-series-in branch January 18, 2023 23:23
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

Successfully merging this pull request may close these issues.

2 participants