Tortar opened a new issue, #492:
URL: https://github.com/apache/arrow-julia/issues/492

   Hi,
   
   I'm a bit in a desperate situation since I'd like to resolve an issue in 
Agents.jl involving the Arrow.jl package on Windows: it seems to me that in 
reality it could be a problem with Arrow.jl since all my (maybe poor) attempts 
to solve the problem failed. This is the PR trying to solve it: 
https://github.com/JuliaDynamics/Agents.jl/pull/909.
   
   In practice we have 
[here](https://github.com/JuliaDynamics/Agents.jl/blob/main/test/collect_tests.jl#L225)
 a test which currently performs:
   
   ```julia
               # Arrow, fails on Windows (see issue #826 
(https://github.com/JuliaDynamics/Agents.jl/issues/826))
               if !(Sys.iswindows())
                   offline_run!(model, 365 * 5;
                       when_model = each_year,
                       when = six_months,
                       backend = :arrow,
                       mdata = [:flag, :year],
                       adata = [(:weight, mean)],
                       writing_interval = 3
                   )
   
                   adata_saved = DataFrame(Arrow.Table("adata.arrow"))
                   @test size(adata_saved) == (11, 2)
                   @test propertynames(adata_saved) == [:step, :mean_weight]
   
                   mdata_saved = DataFrame(Arrow.Table("mdata.arrow"))
                   @test size(mdata_saved) == (6, 3)
                   @test propertynames(mdata_saved) == [:step, :flag, :year]
   
                   @test size(vcat(DataFrame.(Arrow.Stream("adata.arrow"))...)) 
== (11, 2)
                   @test size(vcat(DataFrame.(Arrow.Stream("mdata.arrow"))...)) 
== (6, 3)
   
                   rm("adata.arrow")
                   rm("mdata.arrow")
                   @test !isfile("adata.arrow")
                   @test !isfile("mdata.arrow")
               end
   ```
   
   On Linux and MacOS it works fine, but on Windows the operating system 
refuses to remove the .arrow files giving:
   
   ```julia
   ERROR: IOError: unlink("adata.arrow"): permission denied (EACCES)
   Stacktrace:
    [1] uv_error
      @ .\libuv.jl:100 [inlined]
    [2] unlink(p::String)
      @ Base.Filesystem .\file.jl:972
    [3] rm(path::String; force::Bool, recursive::Bool)
      @ Base.Filesystem .\file.jl:283
    [4] rm(path::String)
      @ Base.Filesystem .\file.jl:273
    [5] top-level scope
      @ REPL[17]:1
   ```
   
   As you can see for Windows it is disables since we didn't manage to make it 
work.
   
   It's probably necessary to describe what is the relationship between the 
Agents.jl function `offline_run!` and Arrow.jl, it is rather simple, 
`offline_run!` calls multiple times this other function:
   
   ```julia
   function Agents.writer_arrow(filename, data, append)
       if append
           Arrow.append(filename, data)
       else
           Arrow.write(filename, data; file = false)
       end
   end
   ```
   
   I'm trying multiple ways to solve the issue, but none worked. I will try to 
provide an MWE if necessary.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to