From 52fee9424b99121388593a84f45b9210014723b2 Mon Sep 17 00:00:00 2001 From: Cristhian Garcia Date: Thu, 12 Sep 2024 09:29:23 -0500 Subject: [PATCH 1/2] fix(dev): sql parse dataset SQL statement --- tutoraspects/asset_command_helpers.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tutoraspects/asset_command_helpers.py b/tutoraspects/asset_command_helpers.py index ea006909a..2cf1f8b9c 100644 --- a/tutoraspects/asset_command_helpers.py +++ b/tutoraspects/asset_command_helpers.py @@ -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 @@ -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): """ From 6409f3949475493087b38c580ffa6b108ae18ae9 Mon Sep 17 00:00:00 2001 From: Cristhian Garcia Date: Thu, 12 Sep 2024 09:36:19 -0500 Subject: [PATCH 2/2] test: install dev requirements for CI --- .github/workflows/build-image.yaml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-image.yaml b/.github/workflows/build-image.yaml index eae06741f..55042428b 100644 --- a/.github/workflows/build-image.yaml +++ b/.github/workflows/build-image.yaml @@ -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