Pedro Machado

    Pedro Machado

    2 years ago
    Is there a way to use the
    StringFormatter
    task with a template that is read at run time?
    Chris White

    Chris White

    2 years ago
    Hi Pedro, yes, the template kwarg is also available as a run method kwarg
    Pedro Machado

    Pedro Machado

    2 years ago
    Hi Chris. Thanks for your reply. The template location is a
    Parameter
    Would I need to have another task that takes the location as an input and returns the contents of the file as a string to pass it to the
    StringFormatter
    task?
    Chris White

    Chris White

    2 years ago
    Yup yup that is correct
    Pedro Machado

    Pedro Machado

    2 years ago
    Got it. One more thing ... is there a way to persist the rendered template as plain text using a templated
    target
    without writing a custom serializer? The rendered template produces SQL and we'd like this to be in plain text format. I wrote a
    PlainTextSerializer
    class for this but I am wondering if there is a better way. Thanks again!
    Chris White

    Chris White

    2 years ago
    No worries! Sounds like you’ve got a great handle on things - you are correct that as of right now you will need a custom serializer to save task output as plain text. In fact, that seems like a really useful serializer - it’d be great if you could open a PR with it to include it in the library!