Skip to content

Commit

Permalink
add aditional test, merge from subquery
Browse files Browse the repository at this point in the history
  • Loading branch information
collerek committed Jun 8, 2021
2 parents 63003e5 + d72f8b0 commit 6360a5a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/python-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ jobs:
- name: Upload coverage report to Coveralls
if: matrix.python-version == '3.9'
env:
GITHUB_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
run: poetry run coveralls
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: poetry run coveralls --service=github

- name: Lint with pylint
run: make lint
Expand Down
10 changes: 10 additions & 0 deletions test/test_create_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,3 +93,13 @@ def test_creating_table_as_select_with_with_clause():
"sub.it_id",
]
assert parser.tables == ["xyz", "internal_table", "table_a", "table_b", "table_c"]


def test_create_table_as_select_in_parentheses():
qry = """
CREATE TABLE records AS
(SELECT t.id, t.name, e.name as energy FROM t JOIN e ON t.e_id = e.id)
"""
parser = Parser(qry)
assert parser.columns == ["t.id", "t.name", "e.name", "t.e_id", "e.id"]
assert parser.tables == ["records", "t", "e"]

0 comments on commit 6360a5a

Please sign in to comment.