We've had several discussions about jinja macros for readability recently, and we're on board with more liberal use of them. This ticket is about trying to do this in a structured way - the google approach seems like a reasonable analog to what we should be thinking about.
While this does not need to be done in one go, generally we should follow these steps:
When updating old templates, try to replace repeated/quirky control logic with macros
If you're using the same macro more than one file, move that macro to someplace inside of ./cumulus_library/template_sql/macros, and import it from there
if you're working on a downstream study, try to follow this same pattern, and merge shared, non-study specific macros back to the main library.
We'll close this issue by consensus when we feel like we've made enough progress on this that this pattern will be self-enforcing due to utility.
We've had several discussions about jinja macros for readability recently, and we're on board with more liberal use of them. This ticket is about trying to do this in a structured way - the google approach seems like a reasonable analog to what we should be thinking about.
While this does not need to be done in one go, generally we should follow these steps:
We'll close this issue by consensus when we feel like we've made enough progress on this that this pattern will be self-enforcing due to utility.