Strange behavior with dataframes in julia 1.6

I’m seeing something strange in dataframes.

In version 1.5.3, i am using the leftjoin function in dataframes and it works OK

df = DataFrame(A = 1:4, B = ["M", "F", "F", "M"])
df2 = DataFrame(A = 1:4, C = ["M", "F", "F", "M"])
julia> leftjoin(df,df2,on = :A)


This works OK

but from julia 1.6 rc-1, I’m getting the following error when trying to use leftjoin

df = DataFrame(A = 1:4, B = ["M", "F", "F", "M"])
df2 = DataFrame(A = 1:4, C = ["M", "F", "F", "M"])
julia> leftjoin(df,df2,on=:A)
ERROR: UndefVarError: leftjoin not defined

is this a function of julia 1.6 or some issue with a version of dataframes?

Does DataFrames.leftjoin work?

No, same error message.

And it isn’t required in 1.5.3 so I’d hate to have to rewrite my code to make it compatible with 1.6

I just tried your code and it worked fine

df = DataFrame(A = 1:4, B = ["M", "F", "F", "M"])
4×2 DataFrame
 Row │ A      B
     │ Int64  String
─────┼───────────────
   1 │     1  M
   2 │     2  F
   3 │     3  F
   4 │     4  M

julia> df2 = DataFrame(A = 1:4, C = ["M", "F", "F", "M"])
4×2 DataFrame
 Row │ A      C
     │ Int64  String
─────┼───────────────
   1 │     1  M
   2 │     2  F
   3 │     3  F
   4 │     4  M

julia> leftjoin(df,df2,on=:A)
4×3 DataFrame
 Row │ A      B       C
     │ Int64  String  String?
─────┼────────────────────────
   1 │     1  M       M
   2 │     2  F       F
   3 │     3  F       F
   4 │     4  M       M

What version of Dataframes are you using? I am on v0.22.5 with 1.6.0-rc1

I just used the version that installed within a fresh 1.6 rc-1 installation. That shows v0.20.2.

I did a update package, but that’s the version after update.

So I tried to update package, but it wouldn’t upgrade to a higher version. I wiped out the entire installation and re-installed 1.6-rc1 and then now it works again. Thanks.

Here is a short description how to diagnose package version restrictions: Understanding package version restrictions in Julia | Blog by Bogumił Kamiński

3 Likes