# Strange behavior with dataframes in julia 1.6

**URL:** <https://discourse.julialang.org/t/strange-behavior-with-dataframes-in-julia-1-6/56642>\
**Category:** General Usage\
**Tags:** dataframes\
**Created:** [March 7, 2021, 1:20am UTC](https://discourse.julialang.org/t/strange-behavior-with-dataframes-in-julia-1-6/56642 "2021-03-07T01:20:05Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![jonjilla](https://avatars.discourse-cdn.com/v4/letter/j/7ba0ec/32.png) [@jonjilla](https://discourse.julialang.org/u/jonjilla)\
**Post date:** [March 7, 2021, 1:20am UTC](https://discourse.julialang.org/t/strange-behavior-with-dataframes-in-julia-1-6/56642/1 "2021-03-07T01:20:05Z")

</div>

I’m seeing something strange in dataframes.

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

```julia
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

```julia
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?

---

<div class="post-metadata">

**Author:** ![jzr](https://avatars.discourse-cdn.com/v4/letter/j/eb9ed0/32.png) [@jzr](https://discourse.julialang.org/u/jzr)\
**Post date:** [March 7, 2021, 1:26am UTC](https://discourse.julialang.org/t/strange-behavior-with-dataframes-in-julia-1-6/56642/2 "2021-03-07T01:26:51Z")

</div>

Does `DataFrames.leftjoin` work?

---

<div class="post-metadata">

**Author:** ![jonjilla](https://avatars.discourse-cdn.com/v4/letter/j/7ba0ec/32.png) [@jonjilla](https://discourse.julialang.org/u/jonjilla)\
**Post date:** [March 7, 2021, 1:36am UTC](https://discourse.julialang.org/t/strange-behavior-with-dataframes-in-julia-1-6/56642/3 "2021-03-07T01:36:57Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![gbaraldi](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gbaraldi/32/22101_2.png) [@gbaraldi](https://discourse.julialang.org/u/gbaraldi)\
**Post date:** [March 7, 2021, 2:34am UTC](https://discourse.julialang.org/t/strange-behavior-with-dataframes-in-julia-1-6/56642/4 "2021-03-07T02:34:43Z")

</div>

I just tried your code and it worked fine

```julia
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

---

<div class="post-metadata">

**Author:** ![jonjilla](https://avatars.discourse-cdn.com/v4/letter/j/7ba0ec/32.png) [@jonjilla](https://discourse.julialang.org/u/jonjilla)\
**Post date:** [March 7, 2021, 3:16am UTC](https://discourse.julialang.org/t/strange-behavior-with-dataframes-in-julia-1-6/56642/5 "2021-03-07T03:16:04Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![jonjilla](https://avatars.discourse-cdn.com/v4/letter/j/7ba0ec/32.png) [@jonjilla](https://discourse.julialang.org/u/jonjilla)\
**Post date:** [March 7, 2021, 9:01am UTC](https://discourse.julialang.org/t/strange-behavior-with-dataframes-in-julia-1-6/56642/6 "2021-03-07T09:01:32Z")

</div>

> [@gbaraldi](#):
>
> `leftjoin(df,df2,on=:A)`

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.

---

<div class="post-metadata">

**Author:** ![bkamins](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bkamins/32/208538_2.png) [@bkamins](https://discourse.julialang.org/u/bkamins)\
**Post date:** [March 7, 2021, 9:04am UTC](https://discourse.julialang.org/t/strange-behavior-with-dataframes-in-julia-1-6/56642/7 "2021-03-07T09:04:51Z")

</div>

Here is a short description how to diagnose package version restrictions: [Understanding package version restrictions in Julia | Blog by Bogumił Kamiński](https://bkamins.github.io/julialang/2020/05/11/package-version-restrictions.html)
