"""Utility functions.""" from string import Template from commit_royalty.config import SNOWFLAKE_CONFIG def get_formatted_query(template, extra_params=None): """Get formatted query.""" template_params = { 'db': SNOWFLAKE_CONFIG.get('db'), 'schema': SNOWFLAKE_CONFIG.get('schema') } if extra_params: template_params.update(extra_params) return Template(template).substitute(**template_params)