-
Notifications
You must be signed in to change notification settings - Fork 121
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
ci: add tests for the queries of TPC-H #899
Merged
MarcoGorelli
merged 11 commits into
narwhals-dev:main
from
IsaiasGutierrezCruz:dev/queries_validation
Sep 4, 2024
Merged
Changes from 7 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
bef839f
test: adding tests for the tpch queries
IsaiasGutierrezCruz a3306f5
ci: workflow for the queries validation
IsaiasGutierrezCruz 4d0611e
test: add description of the queries exceptions
IsaiasGutierrezCruz 724492f
ci: generate queries data in the correct directory
IsaiasGutierrezCruz db4cfc9
Merge branch 'main' into dev/queries_validation
IsaiasGutierrezCruz 2126c51
ci: add full-test label trigger for TPCH query validation workflow
IsaiasGutierrezCruz ff79a1a
ci: Update TPCH query validation workflow to trigger only on labeled β¦
IsaiasGutierrezCruz 4bdb960
Merge branch 'main' into dev/queries_validation
IsaiasGutierrezCruz fd1d1dc
ci: install locally narwhals
IsaiasGutierrezCruz 8d6a1f1
ci: add tqdm to the dev dependencies
IsaiasGutierrezCruz 321f429
fix: correction in the req-dev.txt syntax
IsaiasGutierrezCruz File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
name: Tests for TPCH Queries | ||
|
||
on: | ||
pull_request: | ||
types: [labeled] | ||
|
||
jobs: | ||
validate-queries: | ||
if: ${{ github.event.label.name == 'full-test' }} | ||
strategy: | ||
matrix: | ||
python-version: ["3.12"] | ||
os: [ubuntu-latest] | ||
|
||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install uv | ||
run: curl -LsSf https://astral.sh/uv/install.sh | sh | ||
- name: install-reqs | ||
run: uv pip install --upgrade -r tpch/requirements-tpch.txt --system | ||
- name: generate-data | ||
run: cd tpch && python generate_data.py | ||
- name: tpch-tests | ||
run: python -m unittest discover -s 'tpch/tests' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
duckdb | ||
pyarrow | ||
polars | ||
pandas | ||
dask[dataframe] | ||
tqdm | ||
narwhals |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import os | ||
import subprocess | ||
import sys | ||
import unittest | ||
from pathlib import Path | ||
|
||
|
||
class TestQueries(unittest.TestCase): | ||
def test_execute_scripts(self) -> None: | ||
root = Path(__file__).resolve().parent.parent | ||
# directory containing all the queries | ||
execute_dir = root / "execute" | ||
|
||
env = os.environ.copy() | ||
env["PYTHONPATH"] = str(root) | ||
|
||
for script_path in execute_dir.glob("q[1-9]*.py"): | ||
result = subprocess.run( # noqa: S603 | ||
[sys.executable, str(script_path)], | ||
capture_output=True, | ||
text=True, | ||
env=env, | ||
cwd=root, | ||
check=False, | ||
shell=False, | ||
) | ||
assert ( | ||
result.returncode == 0 | ||
), f"Script {script_path} failed with error: {result.stderr}" |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
instead of this, would we first do
pip install -e .
so that we install Narwhals locally and use that? then, if a PR introduces anything which affects the tpc-h queries, we'll know right awayThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done! c: