Twig's a bit weird in this regard. You'll need to use the merge filter for this.
merge
{% set entry = entry|merge({'depth': 1}) %}