You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@arrow.apache.org by qu...@apache.org on 2022/10/07 18:19:28 UTC

[arrow-julia] branch jq/immutable_error created (now 49d1fad)

This is an automated email from the ASF dual-hosted git repository.

quinnj pushed a change to branch jq/immutable_error
in repository https://gitbox.apache.org/repos/asf/arrow-julia.git


      at 49d1fad  Add ArgumentError for deleteat on ArrowVectrs; fixes #324

This branch includes the following new commits:

     new 49d1fad  Add ArgumentError for deleteat on ArrowVectrs; fixes #324

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[arrow-julia] 01/01: Add ArgumentError for deleteat on ArrowVectrs; fixes #324

Posted by qu...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

quinnj pushed a commit to branch jq/immutable_error
in repository https://gitbox.apache.org/repos/asf/arrow-julia.git

commit 49d1fadaa7c4db3cfdd53e5b0ed7db63eceb2d80
Author: Jacob Quinn <qu...@gmail.com>
AuthorDate: Fri Oct 7 12:19:21 2022 -0600

    Add ArgumentError for deleteat on ArrowVectrs; fixes #324
---
 src/arraytypes/arraytypes.jl | 1 +
 test/runtests.jl             | 3 +++
 2 files changed, 4 insertions(+)

diff --git a/src/arraytypes/arraytypes.jl b/src/arraytypes/arraytypes.jl
index 88d38f8..32b9491 100644
--- a/src/arraytypes/arraytypes.jl
+++ b/src/arraytypes/arraytypes.jl
@@ -29,6 +29,7 @@ Base.similar(::Type{A}, dims::Dims) where {T, A <: ArrowVector{T}} = Vector{T}(u
 validitybitmap(x::ArrowVector) = x.validity
 nullcount(x::ArrowVector) = validitybitmap(x).nc
 getmetadata(x::ArrowVector) = x.metadata
+Base.deleteat!(x::T, inds) where {T <: ArrowVector} = throw(ArgumentError("`$T` does not support `deleteat!`; arrow data is by nature immutable"))
 
 function toarrowvector(x, i=1, de=Dict{Int64, Any}(), ded=DictEncoding[], meta=getmetadata(x); compression::Union{Nothing, Vector{LZ4FrameCompressor}, LZ4FrameCompressor, Vector{ZstdCompressor}, ZstdCompressor}=nothing, kw...)
     @debug 2 "converting top-level column to arrow format: col = $(typeof(x)), compression = $compression, kw = $(kw.data)"
diff --git a/test/runtests.jl b/test/runtests.jl
index dd79475..87e561e 100644
--- a/test/runtests.jl
+++ b/test/runtests.jl
@@ -533,6 +533,9 @@ end
 @test Arrow.Stream(UInt8[]) isa Arrow.Stream
 @test isempty(Tables.partitions(Arrow.Stream(UInt8[])))
 
+# https://github.com/apache/arrow-julia/issues/324
+@test_throws ArgumentError filter!(x -> x > 1, Arrow.toarrowvector([1, 2, 3]))
+
 end # @testset "misc"
 
 end