From 72c90a7212d2f0895b8cba025907b1c9ce907dba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bogumi=C5=82=20Kami=C5=84ski?= Date: Sat, 7 Sep 2024 16:16:42 +0200 Subject: [PATCH 1/2] fix tests on nightly and 32-bit --- src/groupeddataframe/complextransforms.jl | 8 ++++++-- test/io.jl | 4 ++-- test/select.jl | 2 +- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/groupeddataframe/complextransforms.jl b/src/groupeddataframe/complextransforms.jl index 0f7fea6617..1a907de6f3 100644 --- a/src/groupeddataframe/complextransforms.jl +++ b/src/groupeddataframe/complextransforms.jl @@ -269,8 +269,12 @@ function _combine_rows_with_first!((firstrow,)::Ref{Any}, # Create up to one task per thread # This has lower overhead than creating one task per group, # but is optimal only if operations take roughly the same time for all groups - basesize = max(1, cld(len - 1, Threads.nthreads())) - partitions = Iterators.partition(2:len, basesize) + if isthreadsafe(outcols, incols) + basesize = max(1, cld(len - 1, Threads.nthreads())) + partitions = Iterators.partition(2:len, basesize) + else + partitions = (2:len,) + end widen_type_lock = ReentrantLock() outcolsref = Ref{NTuple{<:Any, AbstractVector}}(outcols) type_widened = fill(false, length(partitions)) diff --git a/test/io.jl b/test/io.jl index dee15ea7c2..bb15892dc3 100644 --- a/test/io.jl +++ b/test/io.jl @@ -760,7 +760,7 @@ end df = DataFrame( A=Int64[1,4,9,16,25,36,49,64], B = [ - md"[DataFrames.jl](http://juliadata.github.io/DataFrames.jl)", + md"ABC", md"``\frac{x^2}{x^2+y^2}``", md"`Header`", md"This is *very*, **very**, very, very, very, very, very, very, very long line" , @@ -781,7 +781,7 @@ end Row │ A B │ Int64 MD ─────┼────────────────────────────────────────── - 1 │ 1 DataFrames.jl (http://juliadat… + 1 │ 1 ABC 2 │ 4 \\frac{x^2}{x^2+y^2} 3 │ 9 Header 4 │ 16 This is very, very, very, very… diff --git a/test/select.jl b/test/select.jl index 3a8ad3b23b..02d84d4b93 100644 --- a/test/select.jl +++ b/test/select.jl @@ -3039,7 +3039,7 @@ end @test size(combine(df, :a => (x -> Any[]) => AsTable)) == (0, 0) df2 = combine(df, :a => (x -> NamedTuple{(:x,),Tuple{Int64}}[]) => AsTable) @test size(df2) == (0, 1) - @test eltype(df2.x) === Int + @test eltype(df2.x) === Int64 end end # module From faa224a7e9ad22fa07428210e4e47a71b1c1b506 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bogumi=C5=82=20Kami=C5=84ski?= Date: Sat, 7 Sep 2024 17:20:19 +0200 Subject: [PATCH 2/2] additional test fix --- test/io.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/io.jl b/test/io.jl index bb15892dc3..b566c655e8 100644 --- a/test/io.jl +++ b/test/io.jl @@ -793,7 +793,7 @@ end @test sprint(show, "text/csv", df) == """ \"A\",\"B\" - 1,\"[DataFrames.jl](http://juliadata.github.io/DataFrames.jl)\" + 1,\"ABC\" 4,\"\$\\\\frac{x^2}{x^2+y^2}\$\" 9,\"`Header`\" 16,\"This is *very*, **very**, very, very, very, very, very, very, very long line\"