Skip to content
Open
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 2 additions & 2 deletions .github/workflows/databricks_testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ jobs:
- name: Install dependencies
run: uv pip install -e ".[databricks]"

- name: Run DEFOG refresh if stale (locked by date)
run: uv run python -m tests.gen_data.databricks_task
- name: Run DEFOG refresh
run: uv run python -m tests.gen_data.databricks_task --force

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Force regenerating with each run. This was mainly because I had to stop running the testing mid running and that made the data incomplete.


databricks-tests:
name: Databricks Tests (Python ${{ matrix.python-version }})
Expand Down
47 changes: 47 additions & 0 deletions .github/workflows/duckdb_testing.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Run DuckDB Tests

on:
workflow_call:
inputs:
python-versions:
description: "JSON string of Python versions"
type: string
required: true

jobs:
duckdb-tests:
name: DuckDB Tests (Python ${{ matrix.python-version }})
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ${{ fromJSON(inputs.python-versions) }}

steps:
- uses: actions/checkout@v4

- name: Setup Python ${{ matrix.python-version }}
id: setup-python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Install uv
uses: astral-sh/setup-uv@v3
with:
version: "0.6.0"

- name: Create virtual environment
# See sf_testing.yml on why we use `uv venv`
run: uv venv

- name: Install dependencies
run: uv pip install -e ".[duckdb]"

- name: Confirm DuckDB connector is installed
run: uv run python -c "import duckdb; print('DuckDB connector installed')"

- name: Download TPCH DB
run: ./demos/setup_tpch.sh ./tpch.db

- name: Run DuckDB Tests
run: uv run pytest -m duckdb tests/ -rs
27 changes: 23 additions & 4 deletions .github/workflows/pr_testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,11 @@ on:
type: boolean
required: false
default: false
run-duckdb:
description: "Run DuckDB Tests"
type: boolean
required: false
default: false
run-sf_masked:
description: "Run Snowflake Masked Tests"
type: boolean
Expand Down Expand Up @@ -181,10 +186,10 @@ jobs:
run: uv run ruff check .

- name: Run Tests
run: uv run pytest tests/ -m "not (snowflake or mysql or postgres or sf_masked or s3 or bodosql or oracle or trino or databricks)" -rs
run: uv run pytest tests/ -m "not (snowflake or mysql or postgres or sf_masked or s3 or bodosql or oracle or trino or databricks or duckdb)" -rs

run-defog-daily-update:
name: Run DEFOG Daily Update
run-sf-defog-daily-update:
name: Run Snowflake DEFOG Daily Update
needs: [get-msg]
if: |
(github.event_name == 'pull_request' && contains(needs.get-msg.outputs.commitMsg, '[run all]')) ||
Expand All @@ -199,7 +204,7 @@ jobs:

run-sf-tests:
name: Snowflake Tests
needs: [run-defog-daily-update, get-msg, get-py-ver-matrix]
needs: [run-sf-defog-daily-update, get-msg, get-py-ver-matrix]
if: |
(github.event_name == 'pull_request' && contains(needs.get-msg.outputs.commitMsg, '[run all]')) ||
(github.event_name == 'pull_request' && contains(needs.get-msg.outputs.commitMsg, '[run dialects]')) ||
Expand Down Expand Up @@ -365,3 +370,17 @@ jobs:
python-versions: ${{ github.event_name == 'workflow_dispatch'
&& needs.get-py-ver-matrix.outputs.matrix
|| '["3.11", "3.12", "3.13"]' }}

run-duckdb-tests:
name: DuckDB Tests
needs: [get-msg, get-py-ver-matrix]
if: |
(github.event_name == 'pull_request' && contains(needs.get-msg.outputs.commitMsg, '[run all]')) ||
(github.event_name == 'pull_request' && contains(needs.get-msg.outputs.commitMsg, '[run dialects]')) ||
(github.event_name == 'pull_request' && contains(needs.get-msg.outputs.commitMsg, '[run duckdb]')) ||
(github.event_name == 'workflow_dispatch' && (inputs.run-all || inputs.run-dialects || inputs.run-duckdb))
uses: ./.github/workflows/duckdb_testing.yml
with:
python-versions: ${{ github.event_name == 'workflow_dispatch'
&& needs.get-py-ver-matrix.outputs.matrix
|| '["3.11", "3.12", "3.13"]' }}
41 changes: 41 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,48 @@ To run **Trino CI tests**, add the flag `[run trino]` to your commit message.
export MONGO_USER="your_username"
export MONGO_PASSWORD="your_password"
```
## Running Oracle Tests on CI
To run **Oracle CI tests**, add the flag `[run oracle]` to your commit message.

**Running Oracle tests locally:**
1. Make sure you have [**Docker Desktop**](https://www.docker.com/get-started/)
installed and running.
2. Install the Oracle Connector for Python
```bash
pip install oracledb
```
3. Set your Oracle credentials as environment variables:
```bash
export ORACLE_PASSWORD="your_password"
```
## Running Databricks Tests on CI
To run **Databricks CI tests**, add the flag `[run databricks]` to your commit message.

**Running Databricks tests locally:**

1. Install the Databricks Connector for Python with Pandas support
```bash
pip install databricks-sql-connector"
```

2. Set your Databricks credentials as environment variables:
```bash
export DATABRICKS_HOST="databricks_instance"
export DATABRICKS_HTTP_PATH="server_http_path"
export DATABRICKS_TOKEN="databricks_token"
```

## Running DuckDB Tests on CI
To run **DuckDB CI tests**, add the flag `[run duckdb]` to your commit message.

** Running DuckDB tests locally:**
1. Install the DuckDB Connector for Python with Pandas support
```bash
pip install duckdb
```
2. DuckDB does not require any additional environment variables to be set up for testing.

3. DuckDB TPC-H and Defog tests require the `tpch.db` and `defog.db` files to be located in the `tests` directory. Please refer to the sqlite setup instructions above for more information on how to set up these files.

## Runtime Dependencies

Expand Down
2 changes: 1 addition & 1 deletion demos/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ Once the introduction notebook is complete, you can explore the other notebooks:
- [Oracle_TPCH.ipynb](notebooks/Oracle_TPCH.ipynb) demonstrates how to connect an Oracle database with PyDough.
- [Databricks_TPCH.ipynb](notebooks/Databricks_TPCH.ipynb) demonstrates how to connect a Databricks database with PyDough.
- [Trino_TPCH.ipynb](notebooks/Trino_TPCH.ipynb) demonstrates how to connect a Trino database with PyDough.

- [DuckDB_TPCH.ipynb](notebooks/DuckDB_TPCH.ipynb) demonstrates how to connect a DuckDB database with PyDough.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We didn't add databricks and duckdb to our main README file on the root folder on how to run the tests section. Let's add them

Loading
Loading