How To use reserved variables in tick scripts

I have a tick scripts shown below and it is not executing as expected as “duration” is a reserved variable and it cannot be passed to query. can any one suggest a work around for this so that i can pass reserved variables in tick scripts

batch
|query(‘SELECT duration FROM “telegraf”.“autogen”.“session” where “host” = ‘ABC’’)
.groupBy(‘host’)
.period(1m)
|deadman(1.0, 1m)
.message(‘not collecting any data’)
.stateChangesOnly()
.critReset(lambda: “emitted” > 3.0)
.log(’/tmp/testing.log’)