# Join Deprecation Warning Pairs

**URL:** <https://discourse.julialang.org/t/join-deprecation-warning-pairs/37329>\
**Category:** General Usage\
**Tags:** question\
**Created:** [April 10, 2020, 11:22am UTC](https://discourse.julialang.org/t/join-deprecation-warning-pairs/37329 "2020-04-10T11:22:30Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![compleat](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/compleat/32/8958_2.png) [@compleat](https://discourse.julialang.org/u/compleat)\
**Post date:** [April 10, 2020, 11:22am UTC](https://discourse.julialang.org/t/join-deprecation-warning-pairs/37329/1 "2020-04-10T11:22:30Z")

</div>

I have been using ‘join’ in accordance with the example given on

[https://juliadata.github.io/DataFrames.jl/stable/man/joins/](https://juliadata.github.io/DataFrames.jl/stable/man/joins/)

julia\> join(a, b, on = [(:City, :Location), (:Job, :Work)])

Which seems straightforward enough and seems to work. However,  
I keep getting these deprecation warnings which are not fatal but worrying  
and may slow down my code:

vector containing such tuples as a value of `on` keyword argument is deprecated: use `Pair{Symbol,Symbol}` instead.

I tried replacing tuples as suggested

julia\> join(a, b, on = [Pair{:City, :Location}, Pair{:Job, :Work}])

but that did not work at all.

I can’t seem to find any documentation on this, nor questions on here.

I would be grateful for any hints.

Thanks for any help.

---

<div class="post-metadata">

**Author:** ![pdeffebach](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pdeffebach/32/10320_2.png) [@pdeffebach](https://discourse.julialang.org/u/pdeffebach)\
**Post date:** [April 10, 2020, 1:10pm UTC](https://discourse.julialang.org/t/join-deprecation-warning-pairs/37329/2 "2020-04-10T13:10:29Z")

</div>

The syntax you want is

```julia
julia> join(a, b, on = [:City => :Location, :Job => :Work])

```

This syntax is a bit clearer on which variable is left and which is right, maybe, as well as being a bit more consistent with the rest of DataFrames.

You are correct that the documentation and deprecation warning are out of date. The documentation is already “fixed” on master. I say “fixed” because the behavior will change a good deal in upcoming releases. Soon we will have `innerjoin`, `outerjoin`, etc. and the documentation will show the correct use of `Pair`s.

---

<div class="post-metadata">

**Author:** ![compleat](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/compleat/32/8958_2.png) [@compleat](https://discourse.julialang.org/u/compleat)\
**Post date:** [April 10, 2020, 2:38pm UTC](https://discourse.julialang.org/t/join-deprecation-warning-pairs/37329/3 "2020-04-10T14:38:28Z")

</div>

Thanks so much for that.

I just wonder, because I always thought of indices used in joins (except left/right) as being symmetric in their treatment, but the ‘=\>’ would appear to violate this (for instance, in ‘Dict’ objects, aren’t the mappings meant to be unambiguous?)

For this reason, I find this change (away from tuples) a bit confusing.

Thanks again for your help above and any additional.

[BTW, I am doing :left joins in my application, so it makes sense in that case!]

---

<div class="post-metadata">

**Author:** ![pdeffebach](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pdeffebach/32/10320_2.png) [@pdeffebach](https://discourse.julialang.org/u/pdeffebach)\
**Post date:** [April 10, 2020, 3:40pm UTC](https://discourse.julialang.org/t/join-deprecation-warning-pairs/37329/4 "2020-04-10T15:40:29Z")

</div>

Fair enough, that’s a good point. However given that even if the operation is symmetric, the positions of the arguments never will be. Personally I like `=>` because it’s easy to visualize from the positional arguments.

---

<div class="post-metadata">

**Author:** ![compleat](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/compleat/32/8958_2.png) [@compleat](https://discourse.julialang.org/u/compleat)\
**Post date:** [April 10, 2020, 3:47pm UTC](https://discourse.julialang.org/t/join-deprecation-warning-pairs/37329/5 "2020-04-10T15:47:14Z")

</div>

Thank you.  
PS. If Tuples are not ‘liked’, why not something like \<=\> ?  
PPS Maybe \<= for left joins and =\> for right ones?
