Jsonify in partial error wrong number of args but page builds and outputs json

From a layout template I call a partial with {{ partial "integration" (dict "integration_list" $integration_list "context" .) }}

In the integration.html partial I have

{{ $.context.Scratch.Add "ints" (dict "one" "two")}}
<h1>{{ $test := $.context.Scratch.Get "ints" }} {{ $test | jsonify }}</h1>

Hugo gives this errors

ERROR 2017/04/27 09:21:31 partials/integration.html template: partials/integration.html:9:59: executing "partials/integration.html" at <jsonify>: wrong number of args for jsonify: want 1 got 0

But my page builds and json is returned {"one":"two"} from the dict

I thought it may be because i’m not passing the . directly to the partial but even that gives the same error. Not sure if this is expected behavior or a bug

I think you will find that it sometimes works, but not always.

Try

{{  if $test }}
{{ $test | jsonify }}
{{ end }}