Skip to content
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
29 changes: 29 additions & 0 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: SQLMesh Main

on:
pull_request:
branches: [ main ]
jobs:
style-and-unit-tests:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
make install-dev
- name: Run linters and code style checks
run: |
make style
- name: Run unit tests
run: |
make unit-test
- name: Run doc tests
run: |
make doc-test
7 changes: 5 additions & 2 deletions tests/utils/test_metaprogramming.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import sys
import typing as t

import pandas as pd
Expand Down Expand Up @@ -104,6 +105,8 @@ def test_serialize_env() -> None:
build_env(main_func, env=env, name="MAIN", module="tests")
env = serialize_env(env, module="tests", prefix="PREFIX ") # type: ignore

lambda_no_args_padding = " " if sys.version_info < (3, 11) else ""

assert env == {
"MAIN": """PREFIX def main_func(y):
sqlglot.parse_one('1')
Expand Down Expand Up @@ -133,7 +136,7 @@ def baz(self):
return KLASS_Z""",
"pd": "PREFIX import pandas as pd",
"sqlglot": "PREFIX import sqlglot",
"my_lambda": "PREFIX my_lambda = lambda : print('z')",
"my_lambda": f"PREFIX my_lambda = lambda{lambda_no_args_padding}: print('z')",
"other_func": """PREFIX def other_func(a):
import sqlglot
sqlglot.parse_one('1')
Expand Down Expand Up @@ -165,7 +168,7 @@ def test_fun():

expected_message = f"""Traceback (most recent call last):

File "{__file__}", line 162, in test_print_exception
File "{__file__}", line 165, in test_print_exception
eval("test_fun()", env)

File "<string>", line 1, in <module>
Expand Down