# Why does append!(df1, df2) return a DataFrame, as well as modify the argument df1?

**URL:** <https://discourse.julialang.org/t/why-does-append-df1-df2-return-a-dataframe-as-well-as-modify-the-argument-df1/122329>\
**Category:** New to Julia\
**Tags:** question\
**Created:** [November 6, 2024, 11:03am UTC](https://discourse.julialang.org/t/why-does-append-df1-df2-return-a-dataframe-as-well-as-modify-the-argument-df1/122329 "2024-11-06T11:03:07Z")\
**Posts on this page:** 3\
**Page:** 2

<div class="post-metadata">

**Author:** ![world-peace](https://avatars.discourse-cdn.com/v4/letter/w/9f8e36/32.png) [@world-peace](https://discourse.julialang.org/u/world-peace)\
**Post date:** [November 7, 2024, 12:11pm UTC](https://discourse.julialang.org/t/why-does-append-df1-df2-return-a-dataframe-as-well-as-modify-the-argument-df1/122329/21 "2024-11-07T12:11:12Z")

</div>

> [@carstenbauer](#):
>
> That’s not a bug

It’s a bug

---

<div class="post-metadata">

**Author:** ![GunnarFarneback](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gunnarfarneback/32/1827_2.png) [@GunnarFarneback](https://discourse.julialang.org/u/GunnarFarneback)\
**Post date:** [November 7, 2024, 1:00pm UTC](https://discourse.julialang.org/t/why-does-append-df1-df2-return-a-dataframe-as-well-as-modify-the-argument-df1/122329/22 "2024-11-07T13:00:05Z")

</div>

Indeed, the implementation of `some()` errors so there certainly is a bug there. Whether it’s best solved by adding variants of `append!` to Base or by adding either of `nothing`, `return`, or `return nothing` to the implementation of `some()` is a different question.

---

<div class="post-metadata">

**Author:** ![DanielVandH](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/danielvandh/32/31134_2.png) [@DanielVandH](https://discourse.julialang.org/u/DanielVandH)\
**Post date:** [November 7, 2024, 1:03pm UTC](https://discourse.julialang.org/t/why-does-append-df1-df2-return-a-dataframe-as-well-as-modify-the-argument-df1/122329/23 "2024-11-07T13:03:21Z")

</div>

It’s a bug in your implementation from misunderstanding what `append!` or `::Nothing` actually does (or what a function actually returns when there is no explicit `return`, as also discussed), not in the `append!` function itself (or Julia for that matter). You have already had plenty of responses addressing this so I can’t imagine what more you need?

> Whether it’s best solved by adding variants of `append!` to Base or by adding either of `nothing`, `return`, or `return nothing` to the implementation of `some()` is a different question.

I don’t see what benefit there would be to add another variant of `append!` that returns `nothing`. There is literally no penalty for it returning the collection again. If someone doesn’t want the returned value, just don’t assign it to anything and, if you really do want your function to return `nothing`, the user should just do that.

[Previous page](https://discourse.julialang.org/t/why-does-append-df1-df2-return-a-dataframe-as-well-as-modify-the-argument-df1/122329.md?page=1)
