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

fix(dev): sql parse dataset SQL statement #940

Merged
merged 2 commits into from
Sep 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions .github/workflows/build-image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,11 @@ jobs:
- name: setup python
uses: actions/setup-python@v5
with:
python-version: 3.8
python-version: 3.12
- name: Install aspects
run: pip install .
run: |
pip install -r requirements/dev.txt
pip install -e .
- name: Save config
run: tutor config save
- name: Setup Docker Buildx
Expand Down
6 changes: 6 additions & 0 deletions tutoraspects/asset_command_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
import re
import json
from zipfile import ZipFile
from sqlfmt.api import format_string
from sqlfmt.mode import Mode

import click
import yaml
Expand Down Expand Up @@ -212,6 +214,10 @@ def process(self, content: dict, existing: dict):
if not metric.get("verbose_name"):
metric["verbose_name"] = metric["metric_name"].replace("_", " ").title()

content["sql"] = format_string(
content["sql"], mode=Mode(dialect_name="clickhouse")
)


class DatabaseAsset(Asset):
"""
Expand Down