From eddfe4f7b9bbd80659988bf7da56abaf1bbeb482 Mon Sep 17 00:00:00 2001 From: Philip Sampaio Date: Wed, 9 Oct 2024 15:26:58 -0300 Subject: [PATCH] Add more complex example with decimal and mutate --- test/explorer/data_frame_test.exs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/explorer/data_frame_test.exs b/test/explorer/data_frame_test.exs index 191e20527..868241212 100644 --- a/test/explorer/data_frame_test.exs +++ b/test/explorer/data_frame_test.exs @@ -1692,7 +1692,7 @@ defmodule Explorer.DataFrameTest do df1 = DF.mutate(df, - b: from_list([Decimal.new(1), Decimal.new(2), nil]), + b: from_list([Decimal.new("3.14159265359"), Decimal.new(2), nil]), # Casting works, but the df will be different if we don't pass the precision, # because it will take the default precision for decimals, which is "38". # The second problem of not passing precision is that scale will be handled differently. @@ -1702,13 +1702,13 @@ defmodule Explorer.DataFrameTest do assert DF.to_columns(df1, atom_keys: true) == %{ a: [1, 2, 4], - b: [Decimal.new(1), Decimal.new(2), nil], + b: [Decimal.new("3.14159265359"), Decimal.new("2.00000000000"), nil], c: [Decimal.new("1.00"), Decimal.new("2.00"), Decimal.new("4.00")] } assert DF.dtypes(df1) == %{ "a" => {:s, 64}, - "b" => {:decimal, nil, 0}, + "b" => {:decimal, nil, 11}, "c" => {:decimal, 10, 2} } end