Tables.jl icon indicating copy to clipboard operation
Tables.jl copied to clipboard

infinite loop when converting btw Pandas.DataFrame and DataFrames.DataFrame in v1.6.1

Open yadongli opened this issue 3 years ago • 2 comments

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]

yadongli avatar Jan 17 '22 20:01 yadongli

It seems to be unrelated to DataFrames.jl.

bkamins avatar Jan 17 '22 21:01 bkamins

Yes, you are right, Tables.rows(Pandas.DataFrame(df)) also overflows

yadongli avatar Jan 17 '22 22:01 yadongli

Fixed via https://github.com/JuliaPy/Pandas.jl/commit/b120a90654d942e2495eb711ed688e66ad1d6789?

quinnj avatar Oct 06 '22 23:10 quinnj