Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add jinja templating support to utils.task_wrappers.run and extractor.metric_runner.MetricRunner #76

Closed
rsyi opened this issue Oct 29, 2020 · 1 comment
Labels
enhancement New feature or request python

Comments

@rsyi
Copy link
Owner

rsyi commented Oct 29, 2020

For more modular SQL-writes within the platform, we should enable jinja templating in metrics queries (in MetricRunner) & raw queries (in run), using templates stored in the ~/.whale/templates folder.

Detailed specifications

  • All Jinja templates should be stored in ~/.whale/templates.
  • A template ~/.whale/templates/my_template should be able to be added to a query by inserting {% extends my_template.sql %}, following the Jinja template engine pattern (similar to the pattern found in Django). This will require invocation of a jinja2.FileSystemLoader with the path ~/.whale/templates given as argument (an example is shown here).
  • Both utils.task_wrappers.run and extractor.metric_runner.MetricRunner.extract() should run the templating engine first, then execute the rendered query.
@rsyi rsyi added enhancement New feature or request python labels Oct 29, 2020
@rsyi rsyi changed the title Add jinja templating to utils.task_wrappers.run and extractor.metric_runner.MetricRunner Add jinja templating support to utils.task_wrappers.run and extractor.metric_runner.MetricRunner Oct 29, 2020
@rsyi rsyi self-assigned this Oct 29, 2020
@rsyi rsyi removed their assignment Nov 11, 2020
@rsyi
Copy link
Owner Author

rsyi commented Dec 18, 2020

Closed with #96

@rsyi rsyi closed this as completed Dec 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request python
Projects
None yet
Development

No branches or pull requests

1 participant