Tables.jl
Tables.jl copied to clipboard
infinite loop when converting btw Pandas.DataFrame and DataFrames.DataFrame in v1.6.1
The following creates an infinite loop and stack overflow in v1.6.1, it used to works fine in v1.6.0. The conversion btw Pandas and DataFrames are quite common use case, can you take a look?
using Pandas
using DataFrames
df = DataFrames.DataFrame(a=rand(10), b = rand(10))
df |> Pandas.DataFrame |> DataFrames.DataFrame
results:
StackOverflowError:
Stacktrace: [1] columns(x::Pandas.DataFrame) @ Tables ~/.julia/packages/Tables/M26tI/src/fallbacks.jl:252 [2] rows(x::Pandas.DataFrame) @ Tables ~/.julia/packages/Tables/M26tI/src/fallbacks.jl:88 --- the last 2 lines are repeated 39990 more times --- [79983] columns(x::Pandas.DataFrame) @ Tables ~/.julia/packages/Tables/M26tI/src/fallbacks.jl:252
am using [email protected] and [email protected]
It seems to be unrelated to DataFrames.jl.
Yes, you are right, Tables.rows(Pandas.DataFrame(df))
also overflows
Fixed via https://github.com/JuliaPy/Pandas.jl/commit/b120a90654d942e2495eb711ed688e66ad1d6789?