From 0bc83bf8f9408976153476a2ae550c582e7003c3 Mon Sep 17 00:00:00 2001 From: greetingsfellowhumans Date: Sun, 5 Jul 2026 11:52:06 -0700 Subject: [PATCH 1/9] Fix wrong type being passed into Shared.dtype_error/3 --- lib/explorer/series.ex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/explorer/series.ex b/lib/explorer/series.ex index 3b979d4ed..8276dc1b1 100644 --- a/lib/explorer/series.ex +++ b/lib/explorer/series.ex @@ -1143,7 +1143,7 @@ defmodule Explorer.Series do do: apply_series(series, :strftime, [format_string]) def strftime(%Series{dtype: dtype}, _format_string), - do: dtype_error("strftime/2", dtype, :datetime_like) + do: dtype_error("strftime/2", dtype, [:datetime_like]) @doc """ Clip (or clamp) the values in a series. From fdd92d40d10d5dabf8c14e3d2487be03b8cba9fa Mon Sep 17 00:00:00 2001 From: greetingsfellowhumans Date: Sun, 5 Jul 2026 12:03:01 -0700 Subject: [PATCH 2/9] Remove impossible clause --- lib/explorer/backend/lazy_series.ex | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/explorer/backend/lazy_series.ex b/lib/explorer/backend/lazy_series.ex index 26ee1080f..fe9aa1453 100644 --- a/lib/explorer/backend/lazy_series.ex +++ b/lib/explorer/backend/lazy_series.ex @@ -822,7 +822,6 @@ defmodule Explorer.Backend.LazySeries do when op in [:first, :last, :sum, :min, :max, :product], do: series.dtype - defp dtype_for_agg_operation(op, _) when op in [:all?, :any?], do: :boolean defp dtype_for_agg_operation(:mode, series), do: {:list, series.dtype} defp dtype_for_agg_operation(_, _), do: {:f, 64} From c4a2293259d61bcb867767b87a274f1c56744097 Mon Sep 17 00:00:00 2001 From: greetingsfellowhumans Date: Sun, 5 Jul 2026 12:04:35 -0700 Subject: [PATCH 3/9] Fix non-existant type spec --- lib/explorer/backend/data_frame.ex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/explorer/backend/data_frame.ex b/lib/explorer/backend/data_frame.ex index 5dd78c83d..f6fb8c249 100644 --- a/lib/explorer/backend/data_frame.ex +++ b/lib/explorer/backend/data_frame.ex @@ -168,7 +168,7 @@ defmodule Explorer.Backend.DataFrame do @callback lazy(df) :: df @callback collect(df) :: df @callback from_tabular(Table.Reader.t(), io_dtypes) :: df - @callback from_series([{binary(), Series.t()}]) :: df + @callback from_series([{binary(), series()}]) :: df @callback to_rows(df, atom_keys? :: boolean()) :: [map()] @callback to_rows_stream(df, atom_keys? :: boolean(), chunk_size :: integer()) :: Enumerable.t() From 711ef982eee1626b7cb9af9bb83b46a61d8dc44d Mon Sep 17 00:00:00 2001 From: greetingsfellowhumans Date: Sun, 5 Jul 2026 13:20:12 -0700 Subject: [PATCH 4/9] Remove superflous function clauses --- lib/explorer/polars_backend/expression.ex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/explorer/polars_backend/expression.ex b/lib/explorer/polars_backend/expression.ex index 93092fe63..ea094f527 100644 --- a/lib/explorer/polars_backend/expression.ex +++ b/lib/explorer/polars_backend/expression.ex @@ -322,7 +322,7 @@ defmodule Explorer.PolarsBackend.Expression do Native.expr_int_range(to_expr(0), size_expr, 1, {:u, 32}) end - for {op, arity} <- @all_expressions do + for {op, arity} <- @all_expressions -- @first_only_expressions do args = Macro.generate_arguments(arity, __MODULE__) updates = From fc9453e9ad37e24a417a5cfc059783518f097c51 Mon Sep 17 00:00:00 2001 From: greetingsfellowhumans Date: Sun, 5 Jul 2026 13:31:52 -0700 Subject: [PATCH 5/9] Move cli preferences out of project/0 --- mix.exs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/mix.exs b/mix.exs index 5dec87917..1946c0d32 100644 --- a/mix.exs +++ b/mix.exs @@ -18,7 +18,7 @@ defmodule Explorer.MixProject do package: package(), deps: deps(), docs: docs(), - preferred_cli_env: [ci: :test, "localstack.setup": :test], + cli: cli(), aliases: [ "rust.lint": ["cmd cargo clippy --manifest-path=native/explorer/Cargo.toml -- -Dwarnings"], "rust.fmt": ["cmd cargo fmt --manifest-path=native/explorer/Cargo.toml --all"], @@ -35,6 +35,10 @@ defmodule Explorer.MixProject do ] end + def cli do + [preferred_envs: [ci: :test, "localstack.setup": :test]] + end + defp elixirc_paths(:test), do: ~w(lib test/support) defp elixirc_paths(_), do: ~w(lib) From ce74082da6272ec2ce806d6f350621cad7bc8893 Mon Sep 17 00:00:00 2001 From: greetingsfellowhumans Date: Sun, 5 Jul 2026 14:10:16 -0700 Subject: [PATCH 6/9] Removed LazySeries.size/1 as it is already implemented on ln 476 --- lib/explorer/backend/lazy_series.ex | 7 ------- 1 file changed, 7 deletions(-) diff --git a/lib/explorer/backend/lazy_series.ex b/lib/explorer/backend/lazy_series.ex index fe9aa1453..607abb030 100644 --- a/lib/explorer/backend/lazy_series.ex +++ b/lib/explorer/backend/lazy_series.ex @@ -1076,13 +1076,6 @@ defmodule Explorer.Backend.LazySeries do defp to_elixir_ast(other), do: other - @impl true - def size(series) do - data = new(:size, [lazy_series!(series)], {:u, 32}) - - Backend.Series.new(data, {:u, 32}) - end - @impl true def transform(_series, _fun) do raise """ From 15e06e90989aa18df29a53fceb215695d90aac15 Mon Sep 17 00:00:00 2001 From: greetingsfellowhumans Date: Sun, 5 Jul 2026 14:30:48 -0700 Subject: [PATCH 7/9] Fix duplicate operations in to_expr/1 clauses --- lib/explorer/polars_backend/expression.ex | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/explorer/polars_backend/expression.ex b/lib/explorer/polars_backend/expression.ex index ea094f527..3abc34c2b 100644 --- a/lib/explorer/polars_backend/expression.ex +++ b/lib/explorer/polars_backend/expression.ex @@ -322,7 +322,10 @@ defmodule Explorer.PolarsBackend.Expression do Native.expr_int_range(to_expr(0), size_expr, 1, {:u, 32}) end - for {op, arity} <- @all_expressions -- @first_only_expressions do + for {op, arity} when op not in [ + :acos, :asin, :atan, :cos, :degrees, :radians, :sin, :tan, + :variance, :exp, :skew, :standard_deviation + ] <- @all_expressions do args = Macro.generate_arguments(arity, __MODULE__) updates = From 3ea091afab3a882063514f31f8d94d26cf88518b Mon Sep 17 00:00:00 2001 From: greetingsfellowhumans Date: Sun, 5 Jul 2026 14:40:58 -0700 Subject: [PATCH 8/9] Use normalized dtypes in Series.ewm_mean/2 --- lib/explorer/series.ex | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/explorer/series.ex b/lib/explorer/series.ex index 8276dc1b1..718f4915b 100644 --- a/lib/explorer/series.ex +++ b/lib/explorer/series.ex @@ -5346,15 +5346,15 @@ defmodule Explorer.Series do float_series = case dtype(series) do - :f32 -> + {:f, 32} -> series - :f64 -> + {:f, 64} -> series _ -> try do - cast(series, :f64) + cast(series, {:f, 64}) rescue _ -> raise ArgumentError, From c9a5463efe7283f1a91b894e0548866783fd15da Mon Sep 17 00:00:00 2001 From: greetingsfellowhumans Date: Sun, 5 Jul 2026 14:49:02 -0700 Subject: [PATCH 9/9] Remove impossible clauses for Series.maybe_max --- lib/explorer/series.ex | 3 --- 1 file changed, 3 deletions(-) diff --git a/lib/explorer/series.ex b/lib/explorer/series.ex index 718f4915b..1f22aa6d8 100644 --- a/lib/explorer/series.ex +++ b/lib/explorer/series.ex @@ -3483,9 +3483,6 @@ defmodule Explorer.Series do defp maybe_max(left, right) when K.and(is_integer(left), is_integer(right)), do: K.max(left, right) - defp maybe_max(left, nil), do: left - defp maybe_max(nil, right), do: right - @doc """ Subtracts right from left, element-wise.