# Docstring for hcat(DataFrame...) varargs returns the default Base.hcat docs

**URL:** <https://discourse.julialang.org/t/docstring-for-hcat-dataframe-varargs-returns-the-default-base-hcat-docs/104300>\
**Category:** General Usage\
**Tags:** documentation, dataframes\
**Created:** [September 27, 2023, 8:11am UTC](https://discourse.julialang.org/t/docstring-for-hcat-dataframe-varargs-returns-the-default-base-hcat-docs/104300 "2023-09-27T08:11:07Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![filchristou](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/filchristou/32/26760_2.png) [@filchristou](https://discourse.julialang.org/u/filchristou)\
**Post date:** [September 27, 2023, 8:11am UTC](https://discourse.julialang.org/t/docstring-for-hcat-dataframe-varargs-returns-the-default-base-hcat-docs/104300/1 "2023-09-27T08:11:07Z")

</div>

Probably, this is not something specific to DataFrames.jl but a general situation.  
Normally the following code

```julia
julia> using DataFrames;

julia> df1 = DataFrame(a=[1,2,3,4,5], b=[10,20,30,40,50]);

julia> df2 = DataFrame(c=[100,200,300,400,500], d = [1000, 2000, 3000, 4000, 5000]);

help?> hcat(df1, df2)

```

should return [Functions · DataFrames.jl](https://dataframes.juliadata.org/stable/lib/functions/#Base.hcat)  
but it returns [Arrays · The Julia Language](https://docs.julialang.org/en/v1/base/arrays/#Base.hcat)

The feature of argument-type-specific docstring seems to be in place since

```julia
help?> length([1,2,3])

```

and

```julia
help?> length("ena")

```

return different output related to the argument type.

So, why is the there the issue with the DataFrames case ? Maybe it’s a `varargs...` thing ?

---

<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:** [September 27, 2023, 9:44am UTC](https://discourse.julialang.org/t/docstring-for-hcat-dataframe-varargs-returns-the-default-base-hcat-docs/104300/2 "2023-09-27T09:44:49Z")

</div>

I am not sure what is the reason of the problem since:

```julia
julia> @which hcat(df, df)
hcat(df1::AbstractDataFrame, df2::AbstractDataFrame; makeunique, copycols)
     @ DataFrames ~\DataFrames\58MUJ\src\abstractdataframe\abstractdataframe.jl:1608

```

Maybe it is an issue with the signature in the docstring:

```julia
"""
    hcat(df::AbstractDataFrame...;
         makeunique::Bool=false, copycols::Bool=true)

```

or the fact that this docstring is above:

```julia
function Base.hcat(df::AbstractDataFrame; makeunique::Bool=false, copycols::Bool=true)

```

?

Probably some people knowing more how docstrings are invoked could help here.

---

<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:** [September 27, 2023, 9:46am UTC](https://discourse.julialang.org/t/docstring-for-hcat-dataframe-varargs-returns-the-default-base-hcat-docs/104300/3 "2023-09-27T09:46:17Z")

</div>

CC @nalimilan

---

<div class="post-metadata">

**Author:** ![nalimilan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nalimilan/32/147_2.png) [@nalimilan](https://discourse.julialang.org/u/nalimilan)\
**Post date:** [September 27, 2023, 10:09am UTC](https://discourse.julialang.org/t/docstring-for-hcat-dataframe-varargs-returns-the-default-base-hcat-docs/104300/4 "2023-09-27T10:09:04Z")

</div>

Yes to fix this we we should attach the docstring to a `Base.hcat(df::AbstractDataFrame, xs::Union{AbstractVector, AbstractDataFrame}...)` method. But currently that method doesn’t exist as we have a two-argument method and a three-argument method.
