Sorry for the late reply.
As I’m not a Py dev, I’m not sure how to help. For sure there is something similar to ES6’s Template Strings in Python context.
I see that you are using DQL Variables, that should work, and looks it would work. Have you solved your issue?