Skip to content

Commit a41f470

Browse files
authored
more careful test of ByRow for PooledArray (#2837)
1 parent 8dcccb4 commit a41f470

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ DataAPI = "1.8"
2929
InvertedIndices = "1"
3030
IteratorInterfaceExtensions = "0.1.1, 1"
3131
Missings = "0.4.2, 1"
32-
PooledArrays = "1.2.1"
32+
PooledArrays = "1.3.0"
3333
PrettyTables = "0.12, 1"
3434
Reexport = "0.1, 0.2, 1"
3535
SortingAlgorithms = "0.1, 0.2, 0.3, 1"

test/select.jl

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module TestSelect
22

3-
using DataFrames, Test, Random, Statistics, CategoricalArrays
3+
using DataFrames, Test, Random, Statistics, CategoricalArrays, PooledArrays
44

55
const = isequal
66

@@ -1668,4 +1668,14 @@ end
16681668
@test_throws ArgumentError select(gdf, [:c1, :c2] => AsTable)
16691669
end
16701670

1671+
@testset "ByRow on PooledArray calls function on each entry" begin
1672+
id = 0
1673+
df = DataFrame(a=PooledArray([1, 1, 1]))
1674+
function f(x)
1675+
id += 1
1676+
return id
1677+
end
1678+
@test select(df, :a => ByRow(f) => :a) == DataFrame(a=1:3)
1679+
end
1680+
16711681
end # module

0 commit comments

Comments
 (0)