sql-testing-library 0.22.1__tar.gz → 0.23.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {sql_testing_library-0.22.1 → sql_testing_library-0.23.1}/CHANGELOG.md +20 -0
- {sql_testing_library-0.22.1 → sql_testing_library-0.23.1}/PKG-INFO +59 -40
- {sql_testing_library-0.22.1 → sql_testing_library-0.23.1}/README.md +52 -33
- {sql_testing_library-0.22.1 → sql_testing_library-0.23.1}/pyproject.toml +16 -12
- {sql_testing_library-0.22.1 → sql_testing_library-0.23.1}/src/sql_testing_library/__init__.py +1 -1
- sql_testing_library-0.23.1/src/sql_testing_library/_adapters/clickhouse.py +337 -0
- {sql_testing_library-0.22.1 → sql_testing_library-0.23.1}/src/sql_testing_library/_core.py +47 -10
- {sql_testing_library-0.22.1 → sql_testing_library-0.23.1}/src/sql_testing_library/_mock_table.py +10 -12
- {sql_testing_library-0.22.1 → sql_testing_library-0.23.1}/src/sql_testing_library/_pytest_plugin.py +21 -0
- {sql_testing_library-0.22.1 → sql_testing_library-0.23.1}/src/sql_testing_library/_sql_logger.py +3 -2
- {sql_testing_library-0.22.1 → sql_testing_library-0.23.1}/src/sql_testing_library/_sql_utils.py +108 -6
- {sql_testing_library-0.22.1 → sql_testing_library-0.23.1}/LICENSE +0 -0
- {sql_testing_library-0.22.1 → sql_testing_library-0.23.1}/src/sql_testing_library/_adapters/__init__.py +0 -0
- {sql_testing_library-0.22.1 → sql_testing_library-0.23.1}/src/sql_testing_library/_adapters/athena.py +0 -0
- {sql_testing_library-0.22.1 → sql_testing_library-0.23.1}/src/sql_testing_library/_adapters/base.py +0 -0
- {sql_testing_library-0.22.1 → sql_testing_library-0.23.1}/src/sql_testing_library/_adapters/bigquery.py +0 -0
- {sql_testing_library-0.22.1 → sql_testing_library-0.23.1}/src/sql_testing_library/_adapters/duckdb.py +0 -0
- {sql_testing_library-0.22.1 → sql_testing_library-0.23.1}/src/sql_testing_library/_adapters/presto.py +0 -0
- {sql_testing_library-0.22.1 → sql_testing_library-0.23.1}/src/sql_testing_library/_adapters/redshift.py +0 -0
- {sql_testing_library-0.22.1 → sql_testing_library-0.23.1}/src/sql_testing_library/_adapters/snowflake.py +0 -0
- {sql_testing_library-0.22.1 → sql_testing_library-0.23.1}/src/sql_testing_library/_adapters/trino.py +0 -0
- {sql_testing_library-0.22.1 → sql_testing_library-0.23.1}/src/sql_testing_library/_exceptions.py +0 -0
- {sql_testing_library-0.22.1 → sql_testing_library-0.23.1}/src/sql_testing_library/_types.py +0 -0
- {sql_testing_library-0.22.1 → sql_testing_library-0.23.1}/src/sql_testing_library/py.typed +0 -0
|
@@ -5,6 +5,26 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## 0.23.1 (2026-10-02)
|
|
9
|
+
|
|
10
|
+
### Fix
|
|
11
|
+
|
|
12
|
+
- honor each SQL logger output directory (#179)
|
|
13
|
+
- **deps**: bump cryptography to 50.0.0 (CVE-2026-69247) (#165)
|
|
14
|
+
- **deps**: bump cryptography 48.0.1 → 50.0.0 (CVE-2026-69247)
|
|
15
|
+
|
|
16
|
+
## 0.23.0 (2026-07-26)
|
|
17
|
+
|
|
18
|
+
### Feat
|
|
19
|
+
|
|
20
|
+
- add ClickHouse adapter (#114) (#157)
|
|
21
|
+
|
|
22
|
+
### Fix
|
|
23
|
+
|
|
24
|
+
- grant contents:read to workflows that call reusable workflows
|
|
25
|
+
- resolve all code scanning security alerts (#147)
|
|
26
|
+
- preserve None values in to_dataframe for pandas 3.x StringDtype compatibility
|
|
27
|
+
|
|
8
28
|
## 0.22.1 (2026-03-02)
|
|
9
29
|
|
|
10
30
|
### Fix
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: sql-testing-library
|
|
3
|
-
Version: 0.
|
|
4
|
-
Summary: SQL Testing Framework for Python: Unit test SQL queries with mock data injection for BigQuery, Snowflake, Redshift, Athena, Trino, and
|
|
3
|
+
Version: 0.23.1
|
|
4
|
+
Summary: SQL Testing Framework for Python: Unit test SQL queries with mock data injection for BigQuery, Snowflake, Redshift, Athena, Trino, DuckDB, and ClickHouse. Simplify data engineering ETL testing and analytics validation.
|
|
5
5
|
License: MIT
|
|
6
6
|
License-File: LICENSE
|
|
7
|
-
Keywords: sql,testing,unit-testing,mock-data,database-testing,bigquery,snowflake,redshift,athena,trino,duckdb,data-engineering,etl-testing,sql-validation,query-testing,pytest,data-quality,analytics-testing,sql-unit-test,database-mocking,sql-mock,data-warehouse-testing,cloud-database,aws-athena,google-bigquery,amazon-redshift,snowflake-testing,ci-cd-testing,test-automation
|
|
7
|
+
Keywords: sql,testing,unit-testing,mock-data,database-testing,bigquery,snowflake,redshift,athena,trino,duckdb,data-engineering,etl-testing,sql-validation,query-testing,pytest,data-quality,analytics-testing,sql-unit-test,database-mocking,sql-mock,data-warehouse-testing,cloud-database,aws-athena,google-bigquery,amazon-redshift,snowflake-testing,clickhouse,clickhouse-testing,ci-cd-testing,test-automation
|
|
8
8
|
Author: Gurmeet Saran
|
|
9
9
|
Author-email: gurmeetx@gmail.com
|
|
10
10
|
Maintainer: Gurmeet Saran
|
|
11
11
|
Maintainer-email: gurmeetx@gmail.com
|
|
12
|
-
Requires-Python: >=3.
|
|
12
|
+
Requires-Python: >=3.10
|
|
13
13
|
Classifier: Development Status :: 4 - Beta
|
|
14
14
|
Classifier: Environment :: Console
|
|
15
15
|
Classifier: Framework :: Pytest
|
|
@@ -20,12 +20,12 @@ Classifier: License :: OSI Approved :: MIT License
|
|
|
20
20
|
Classifier: Natural Language :: English
|
|
21
21
|
Classifier: Operating System :: OS Independent
|
|
22
22
|
Classifier: Programming Language :: Python :: 3
|
|
23
|
-
Classifier: Programming Language :: Python :: 3.9
|
|
24
23
|
Classifier: Programming Language :: Python :: 3.10
|
|
25
24
|
Classifier: Programming Language :: Python :: 3.11
|
|
26
25
|
Classifier: Programming Language :: Python :: 3.12
|
|
27
26
|
Classifier: Programming Language :: Python :: 3.13
|
|
28
27
|
Classifier: Programming Language :: Python :: 3.14
|
|
28
|
+
Classifier: Programming Language :: Python :: 3.15
|
|
29
29
|
Classifier: Programming Language :: Python :: Implementation :: CPython
|
|
30
30
|
Classifier: Topic :: Database
|
|
31
31
|
Classifier: Topic :: Database :: Database Engines/Servers
|
|
@@ -37,16 +37,16 @@ Classifier: Typing :: Typed
|
|
|
37
37
|
Provides-Extra: all
|
|
38
38
|
Provides-Extra: athena
|
|
39
39
|
Provides-Extra: bigquery
|
|
40
|
+
Provides-Extra: clickhouse
|
|
40
41
|
Provides-Extra: duckdb
|
|
41
42
|
Provides-Extra: redshift
|
|
42
43
|
Provides-Extra: snowflake
|
|
43
44
|
Provides-Extra: trino
|
|
44
45
|
Requires-Dist: db-dtypes (>=1.4.3,<2.0.0)
|
|
45
|
-
Requires-Dist: docutils (>=0.21.2,<0.
|
|
46
|
+
Requires-Dist: docutils (>=0.21.2,<0.24.0)
|
|
46
47
|
Requires-Dist: pandas (>=1.0.0)
|
|
47
48
|
Requires-Dist: pydantic (>=2.0.0)
|
|
48
49
|
Requires-Dist: sqlglot (>=26.0.0)
|
|
49
|
-
Requires-Dist: typing-extensions (>=4.5.0) ; python_version < "3.10"
|
|
50
50
|
Project-URL: Bug Tracker, https://github.com/gurmeetsaran/sqltesting/issues
|
|
51
51
|
Project-URL: Changelog, https://github.com/gurmeetsaran/sqltesting/blob/master/CHANGELOG.md
|
|
52
52
|
Project-URL: Contributing, https://github.com/gurmeetsaran/sqltesting/blob/master/CONTRIBUTING.md
|
|
@@ -62,7 +62,7 @@ Description-Content-Type: text/markdown
|
|
|
62
62
|
|
|
63
63
|
> **A powerful Python framework for unit testing SQL queries with mock data injection**
|
|
64
64
|
>
|
|
65
|
-
> Test SQL queries across BigQuery, Snowflake, Redshift, Athena, Trino, and
|
|
65
|
+
> Test SQL queries across BigQuery, Snowflake, Redshift, Athena, Trino, DuckDB, and ClickHouse with type-safe mock data, pytest integration, and automatic table resolution. Perfect for data engineering, ETL pipeline testing, and analytics validation.
|
|
66
66
|
|
|
67
67
|
**Quick Links:** [Installation](#installation) | [Quick Start](#quick-start) | [Documentation](https://gurmeetsaran.github.io/sqltesting/) | [Examples](https://gurmeetsaran.github.io/sqltesting/examples.html) | [PyPI Package](https://pypi.org/project/sql-testing-library/)
|
|
68
68
|
|
|
@@ -73,6 +73,7 @@ Description-Content-Type: text/markdown
|
|
|
73
73
|
[](https://github.com/gurmeetsaran/sqltesting/actions/workflows/trino-integration.yml)
|
|
74
74
|
[](https://github.com/gurmeetsaran/sqltesting/actions/workflows/snowflake-integration.yml)
|
|
75
75
|
[](https://github.com/gurmeetsaran/sqltesting/actions/workflows/duckdb-integration.yml)
|
|
76
|
+
[](https://github.com/gurmeetsaran/sqltesting/actions/workflows/clickhouse-integration.yml)
|
|
76
77
|
[](https://github.com/gurmeetsaran/sqltesting/blob/master/LICENSE)
|
|
77
78
|
[](https://pepy.tech/projects/sql-testing-library)
|
|
78
79
|
[](https://codecov.io/gh/gurmeetsaran/sqltesting)
|
|
@@ -112,7 +113,7 @@ For more details on our journey and the engineering challenges we solved, read t
|
|
|
112
113
|
|
|
113
114
|
## Features
|
|
114
115
|
|
|
115
|
-
- **Multi-Database Support**: Test SQL across BigQuery, Athena, Redshift, Trino, Snowflake, and
|
|
116
|
+
- **Multi-Database Support**: Test SQL across BigQuery, Athena, Redshift, Trino, Snowflake, DuckDB, and ClickHouse
|
|
116
117
|
- **Mock Data Injection**: Use Python dataclasses for type-safe test data
|
|
117
118
|
- **CTE or Physical Tables**: Automatic fallback for query size limits
|
|
118
119
|
- **Type-Safe Results**: Deserialize results to Pydantic models
|
|
@@ -125,31 +126,31 @@ The library supports different data types across database engines. All checkmark
|
|
|
125
126
|
|
|
126
127
|
### Primitive Types
|
|
127
128
|
|
|
128
|
-
| Data Type | Python Type | BigQuery | Athena | Redshift | Trino | Snowflake | DuckDB |
|
|
129
|
-
|
|
130
|
-
| **String** | `str` | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
|
|
131
|
-
| **Integer** | `int` | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
|
|
132
|
-
| **Float** | `float` | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
|
|
133
|
-
| **Boolean** | `bool` | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
|
|
134
|
-
| **Date** | `date` | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
|
|
135
|
-
| **Datetime** | `datetime` | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
|
|
136
|
-
| **Decimal** | `Decimal` | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
|
|
137
|
-
| **Optional** | `Optional[T]` | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
|
|
129
|
+
| Data Type | Python Type | BigQuery | Athena | Redshift | Trino | Snowflake | DuckDB | ClickHouse |
|
|
130
|
+
|-----------|-------------|----------|--------|----------|-------|-----------|--------|------------|
|
|
131
|
+
| **String** | `str` | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
|
|
132
|
+
| **Integer** | `int` | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
|
|
133
|
+
| **Float** | `float` | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
|
|
134
|
+
| **Boolean** | `bool` | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
|
|
135
|
+
| **Date** | `date` | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
|
|
136
|
+
| **Datetime** | `datetime` | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
|
|
137
|
+
| **Decimal** | `Decimal` | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
|
|
138
|
+
| **Optional** | `Optional[T]` | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
|
|
138
139
|
|
|
139
140
|
### Complex Types
|
|
140
141
|
|
|
141
|
-
| Data Type | Python Type | BigQuery | Athena | Redshift | Trino | Snowflake | DuckDB |
|
|
142
|
-
|
|
143
|
-
| **String Array** | `List[str]` | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
|
|
144
|
-
| **Integer Array** | `List[int]` | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
|
|
145
|
-
| **Decimal Array** | `List[Decimal]` | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
|
|
146
|
-
| **Optional Array** | `Optional[List[T]]` | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
|
|
147
|
-
| **Map/Dict** | `Dict[K, V]` | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
|
|
148
|
-
| **Struct/Record** | `dataclass` | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
|
|
149
|
-
| **Nested Arrays** | `List[List[T]]` | ❌ | ✅ | ✅ | ✅ | ✅ | ✅ |
|
|
150
|
-
| **Arrays of Structs** | `List[dataclass]` | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
|
|
151
|
-
| **3D Arrays** | `List[List[List[T]]]` | ❌ | ✅ | ✅ | ✅ | ✅ | ✅ |
|
|
152
|
-
| **Arrays of Arrays of Structs** | `List[List[dataclass]]` | ❌ | ✅ | ✅ | ✅ | ✅ | ✅ |
|
|
142
|
+
| Data Type | Python Type | BigQuery | Athena | Redshift | Trino | Snowflake | DuckDB | ClickHouse |
|
|
143
|
+
|-----------|-------------|----------|--------|----------|-------|-----------|--------|------------|
|
|
144
|
+
| **String Array** | `List[str]` | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
|
|
145
|
+
| **Integer Array** | `List[int]` | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
|
|
146
|
+
| **Decimal Array** | `List[Decimal]` | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
|
|
147
|
+
| **Optional Array** | `Optional[List[T]]` | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
|
|
148
|
+
| **Map/Dict** | `Dict[K, V]` | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
|
|
149
|
+
| **Struct/Record** | `dataclass` | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
|
|
150
|
+
| **Nested Arrays** | `List[List[T]]` | ❌ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
|
|
151
|
+
| **Arrays of Structs** | `List[dataclass]` | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
|
|
152
|
+
| **3D Arrays** | `List[List[List[T]]]` | ❌ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
|
|
153
|
+
| **Arrays of Arrays of Structs** | `List[List[dataclass]]` | ❌ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
|
|
153
154
|
|
|
154
155
|
### Database-Specific Notes
|
|
155
156
|
|
|
@@ -159,15 +160,16 @@ The library supports different data types across database engines. All checkmark
|
|
|
159
160
|
- **Trino**: Memory catalog for testing; excellent decimal precision; supports arrays, maps, and struct types using `ROW` with named fields (dataclasses and Pydantic models); **full support for deeply nested types** including nested arrays, arrays of structs, and 3D arrays
|
|
160
161
|
- **Snowflake**: Column names normalized to lowercase; 1MB query size limit; dict/map types implemented via VARIANT type (JSON parsing); **full support for deeply nested types** including struct types using OBJECT + PARSE_JSON, nested arrays (2D, 3D+), arrays of structs, and arrays of arrays of structs
|
|
161
162
|
- **DuckDB**: Fast embedded analytics database; excellent SQL standards compliance; supports arrays, maps, and struct types using `STRUCT` syntax with named fields (dataclasses and Pydantic models); **full support for deeply nested types** including nested arrays (2D, 3D+), arrays of structs, and arrays of arrays of structs
|
|
163
|
+
- **ClickHouse**: Column-oriented analytics database; uses HTTP client (`clickhouse-connect`) against `Memory`-engine tables for physical mode; supports `Array(T)`, `Map(K, V)`, and named `Tuple(field T, ...)` for struct types (dataclasses and Pydantic models); scalar columns are declared `Nullable(...)` so NULLs round-trip cleanly; **full support for deeply nested types** including nested arrays, arrays of tuples, and arrays of arrays of tuples
|
|
162
164
|
|
|
163
165
|
## Execution Modes Support
|
|
164
166
|
|
|
165
167
|
The library supports two execution modes for mock data injection. **CTE Mode is the default** and is automatically used unless Physical Tables mode is explicitly requested or required due to query size limits.
|
|
166
168
|
|
|
167
|
-
| Execution Mode | Description | BigQuery | Athena | Redshift | Trino | Snowflake | DuckDB |
|
|
168
|
-
|
|
169
|
-
| **CTE Mode** | Mock data injected as Common Table Expressions | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
|
|
170
|
-
| **Physical Tables** | Mock data created as temporary tables | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
|
|
169
|
+
| Execution Mode | Description | BigQuery | Athena | Redshift | Trino | Snowflake | DuckDB | ClickHouse |
|
|
170
|
+
|----------------|-------------|----------|--------|----------|-------|-----------|--------|------------|
|
|
171
|
+
| **CTE Mode** | Mock data injected as Common Table Expressions | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
|
|
172
|
+
| **Physical Tables** | Mock data created as temporary tables | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
|
|
171
173
|
|
|
172
174
|
### Execution Mode Details
|
|
173
175
|
|
|
@@ -192,15 +194,17 @@ The library supports two execution modes for mock data injection. **CTE Mode is
|
|
|
192
194
|
| **Trino** | Memory tables | `memory.default` schema | Library executes `DROP TABLE` | After each test |
|
|
193
195
|
| **Snowflake** | Temporary tables | Session-specific temp schema | Database automatic | Session end |
|
|
194
196
|
| **DuckDB** | Temporary tables | Database-specific temp schema | Library executes `DROP TABLE` | After each test |
|
|
197
|
+
| **ClickHouse** | `Memory`-engine tables | Configured database | Library executes `DROP TABLE` | After each test |
|
|
195
198
|
|
|
196
199
|
#### **Cleanup Behavior Explained**
|
|
197
200
|
|
|
198
|
-
**Library-Managed Cleanup (BigQuery, Athena, Trino, DuckDB):**
|
|
201
|
+
**Library-Managed Cleanup (BigQuery, Athena, Trino, DuckDB, ClickHouse):**
|
|
199
202
|
- The SQL Testing Library explicitly calls cleanup methods after each test
|
|
200
203
|
- **BigQuery**: Creates standard tables in your dataset, then deletes them via `client.delete_table()`
|
|
201
204
|
- **Athena**: Creates external tables backed by S3 data, then drops table metadata via `DROP TABLE IF EXISTS` (⚠️ **S3 data files remain and require separate cleanup**)
|
|
202
205
|
- **Trino**: Creates tables in memory catalog, then drops them via `DROP TABLE IF EXISTS`
|
|
203
206
|
- **DuckDB**: Creates temporary tables in the database, then drops them via `DROP TABLE IF EXISTS`
|
|
207
|
+
- **ClickHouse**: Creates tables with the `Memory` engine, then drops them via `DROP TABLE IF EXISTS`
|
|
204
208
|
|
|
205
209
|
**Database-Managed Cleanup (Redshift, Snowflake):**
|
|
206
210
|
- These databases have built-in temporary table mechanisms
|
|
@@ -225,7 +229,7 @@ A: Trino's memory catalog doesn't automatically clean up tables when sessions en
|
|
|
225
229
|
A: BigQuery tables created by the library are **standard tables without TTL** - they persist until explicitly deleted. The library immediately calls `client.delete_table()` after each test. If you want to set TTL as a safety net, you can configure it at the dataset level (e.g., 24 hours) to auto-delete any orphaned tables.
|
|
226
230
|
|
|
227
231
|
**Q: Which databases leave artifacts if tests crash?**
|
|
228
|
-
- **BigQuery, Athena, Trino, DuckDB**: May leave tables if library crashes before cleanup
|
|
232
|
+
- **BigQuery, Athena, Trino, DuckDB, ClickHouse**: May leave tables if library crashes before cleanup
|
|
229
233
|
- **Redshift, Snowflake**: No artifacts - temporary tables auto-cleanup on session end
|
|
230
234
|
|
|
231
235
|
**Q: How to manually clean up orphaned tables?**
|
|
@@ -296,6 +300,7 @@ aws s3api list-objects-v2 --bucket your-athena-results-bucket --prefix "temp_" \
|
|
|
296
300
|
| **Trino** | 16MB (estimated) | Large dataset or complex CTEs |
|
|
297
301
|
| **Snowflake** | 1MB | Automatically switches at 1MB |
|
|
298
302
|
| **DuckDB** | 32MB (estimated) | Large dataset or complex CTEs |
|
|
303
|
+
| **ClickHouse** | No hard limit | Manually via `use_physical_tables=True` |
|
|
299
304
|
|
|
300
305
|
### How to Control Execution Mode
|
|
301
306
|
|
|
@@ -421,6 +426,9 @@ pip install sql-testing-library[snowflake]
|
|
|
421
426
|
# Install with DuckDB support
|
|
422
427
|
pip install sql-testing-library[duckdb]
|
|
423
428
|
|
|
429
|
+
# Install with ClickHouse support
|
|
430
|
+
pip install sql-testing-library[clickhouse]
|
|
431
|
+
|
|
424
432
|
# Or install with all database adapters
|
|
425
433
|
pip install sql-testing-library[all]
|
|
426
434
|
```
|
|
@@ -437,9 +445,10 @@ poetry install --with redshift
|
|
|
437
445
|
poetry install --with trino
|
|
438
446
|
poetry install --with snowflake
|
|
439
447
|
poetry install --with duckdb
|
|
448
|
+
poetry install --with clickhouse
|
|
440
449
|
|
|
441
450
|
# Install with all database adapters and dev tools
|
|
442
|
-
poetry install --with bigquery,athena,redshift,trino,snowflake,duckdb,dev
|
|
451
|
+
poetry install --with bigquery,athena,redshift,trino,snowflake,duckdb,clickhouse,dev
|
|
443
452
|
```
|
|
444
453
|
|
|
445
454
|
## Quick Start
|
|
@@ -448,7 +457,7 @@ poetry install --with bigquery,athena,redshift,trino,snowflake,duckdb,dev
|
|
|
448
457
|
|
|
449
458
|
```ini
|
|
450
459
|
[sql_testing]
|
|
451
|
-
adapter = bigquery # Use 'bigquery', 'athena', 'redshift', 'trino', 'snowflake', or '
|
|
460
|
+
adapter = bigquery # Use 'bigquery', 'athena', 'redshift', 'trino', 'snowflake', 'duckdb', or 'clickhouse'
|
|
452
461
|
|
|
453
462
|
# BigQuery configuration
|
|
454
463
|
[sql_testing.bigquery]
|
|
@@ -510,6 +519,15 @@ credentials_path = <path to credentials json>
|
|
|
510
519
|
# DuckDB configuration
|
|
511
520
|
# [sql_testing.duckdb]
|
|
512
521
|
# database = <path/to/database.duckdb> # Optional: defaults to in-memory database
|
|
522
|
+
|
|
523
|
+
# ClickHouse configuration
|
|
524
|
+
# [sql_testing.clickhouse]
|
|
525
|
+
# host = <clickhouse-host.example.com>
|
|
526
|
+
# port = 8123 # Optional: default HTTP port (use 9440 for HTTPS)
|
|
527
|
+
# username = default # Optional: default is 'default'
|
|
528
|
+
# password = <clickhouse_password> # Optional: default is empty
|
|
529
|
+
# database = default # Optional: default is 'default'
|
|
530
|
+
# secure = false # Optional: true for HTTPS
|
|
513
531
|
```
|
|
514
532
|
|
|
515
533
|
### Database Context Understanding
|
|
@@ -524,6 +542,7 @@ Each database adapter uses a different concept for organizing tables and queries
|
|
|
524
542
|
| **Snowflake** | `{database}.{schema}` | database + schema | `"test_db.public"` | `SELECT * FROM test_db.public.products` |
|
|
525
543
|
| **Trino** | `{catalog}.{schema}` | catalog + schema | `"memory.default"` | `SELECT * FROM memory.default.inventory` |
|
|
526
544
|
| **DuckDB** | `{database}` | database only | `"test_db"` | `SELECT * FROM test_db.analytics` |
|
|
545
|
+
| **ClickHouse** | `{database}` | database only | `"default"` | `SELECT * FROM default.events` |
|
|
527
546
|
|
|
528
547
|
#### Key Points:
|
|
529
548
|
|
|
@@ -1045,7 +1064,7 @@ def test_duckdb_query():
|
|
|
1045
1064
|
)
|
|
1046
1065
|
```
|
|
1047
1066
|
|
|
1048
|
-
The adapter_type parameter will use the configuration from the corresponding section in pytest.ini, such as `[sql_testing.bigquery]`, `[sql_testing.athena]`, `[sql_testing.redshift]`, `[sql_testing.trino]`, `[sql_testing.snowflake]`, or `[sql_testing.
|
|
1067
|
+
The adapter_type parameter will use the configuration from the corresponding section in pytest.ini, such as `[sql_testing.bigquery]`, `[sql_testing.athena]`, `[sql_testing.redshift]`, `[sql_testing.trino]`, `[sql_testing.snowflake]`, `[sql_testing.duckdb]`, or `[sql_testing.clickhouse]`.
|
|
1049
1068
|
|
|
1050
1069
|
**Default Adapter Behavior:**
|
|
1051
1070
|
- If `adapter_type` is not specified in the test, the library uses the adapter from `[sql_testing]` section's `adapter` setting
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
> **A powerful Python framework for unit testing SQL queries with mock data injection**
|
|
4
4
|
>
|
|
5
|
-
> Test SQL queries across BigQuery, Snowflake, Redshift, Athena, Trino, and
|
|
5
|
+
> Test SQL queries across BigQuery, Snowflake, Redshift, Athena, Trino, DuckDB, and ClickHouse with type-safe mock data, pytest integration, and automatic table resolution. Perfect for data engineering, ETL pipeline testing, and analytics validation.
|
|
6
6
|
|
|
7
7
|
**Quick Links:** [Installation](#installation) | [Quick Start](#quick-start) | [Documentation](https://gurmeetsaran.github.io/sqltesting/) | [Examples](https://gurmeetsaran.github.io/sqltesting/examples.html) | [PyPI Package](https://pypi.org/project/sql-testing-library/)
|
|
8
8
|
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
[](https://github.com/gurmeetsaran/sqltesting/actions/workflows/trino-integration.yml)
|
|
14
14
|
[](https://github.com/gurmeetsaran/sqltesting/actions/workflows/snowflake-integration.yml)
|
|
15
15
|
[](https://github.com/gurmeetsaran/sqltesting/actions/workflows/duckdb-integration.yml)
|
|
16
|
+
[](https://github.com/gurmeetsaran/sqltesting/actions/workflows/clickhouse-integration.yml)
|
|
16
17
|
[](https://github.com/gurmeetsaran/sqltesting/blob/master/LICENSE)
|
|
17
18
|
[](https://pepy.tech/projects/sql-testing-library)
|
|
18
19
|
[](https://codecov.io/gh/gurmeetsaran/sqltesting)
|
|
@@ -52,7 +53,7 @@ For more details on our journey and the engineering challenges we solved, read t
|
|
|
52
53
|
|
|
53
54
|
## Features
|
|
54
55
|
|
|
55
|
-
- **Multi-Database Support**: Test SQL across BigQuery, Athena, Redshift, Trino, Snowflake, and
|
|
56
|
+
- **Multi-Database Support**: Test SQL across BigQuery, Athena, Redshift, Trino, Snowflake, DuckDB, and ClickHouse
|
|
56
57
|
- **Mock Data Injection**: Use Python dataclasses for type-safe test data
|
|
57
58
|
- **CTE or Physical Tables**: Automatic fallback for query size limits
|
|
58
59
|
- **Type-Safe Results**: Deserialize results to Pydantic models
|
|
@@ -65,31 +66,31 @@ The library supports different data types across database engines. All checkmark
|
|
|
65
66
|
|
|
66
67
|
### Primitive Types
|
|
67
68
|
|
|
68
|
-
| Data Type | Python Type | BigQuery | Athena | Redshift | Trino | Snowflake | DuckDB |
|
|
69
|
-
|
|
70
|
-
| **String** | `str` | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
|
|
71
|
-
| **Integer** | `int` | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
|
|
72
|
-
| **Float** | `float` | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
|
|
73
|
-
| **Boolean** | `bool` | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
|
|
74
|
-
| **Date** | `date` | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
|
|
75
|
-
| **Datetime** | `datetime` | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
|
|
76
|
-
| **Decimal** | `Decimal` | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
|
|
77
|
-
| **Optional** | `Optional[T]` | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
|
|
69
|
+
| Data Type | Python Type | BigQuery | Athena | Redshift | Trino | Snowflake | DuckDB | ClickHouse |
|
|
70
|
+
|-----------|-------------|----------|--------|----------|-------|-----------|--------|------------|
|
|
71
|
+
| **String** | `str` | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
|
|
72
|
+
| **Integer** | `int` | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
|
|
73
|
+
| **Float** | `float` | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
|
|
74
|
+
| **Boolean** | `bool` | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
|
|
75
|
+
| **Date** | `date` | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
|
|
76
|
+
| **Datetime** | `datetime` | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
|
|
77
|
+
| **Decimal** | `Decimal` | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
|
|
78
|
+
| **Optional** | `Optional[T]` | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
|
|
78
79
|
|
|
79
80
|
### Complex Types
|
|
80
81
|
|
|
81
|
-
| Data Type | Python Type | BigQuery | Athena | Redshift | Trino | Snowflake | DuckDB |
|
|
82
|
-
|
|
83
|
-
| **String Array** | `List[str]` | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
|
|
84
|
-
| **Integer Array** | `List[int]` | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
|
|
85
|
-
| **Decimal Array** | `List[Decimal]` | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
|
|
86
|
-
| **Optional Array** | `Optional[List[T]]` | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
|
|
87
|
-
| **Map/Dict** | `Dict[K, V]` | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
|
|
88
|
-
| **Struct/Record** | `dataclass` | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
|
|
89
|
-
| **Nested Arrays** | `List[List[T]]` | ❌ | ✅ | ✅ | ✅ | ✅ | ✅ |
|
|
90
|
-
| **Arrays of Structs** | `List[dataclass]` | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
|
|
91
|
-
| **3D Arrays** | `List[List[List[T]]]` | ❌ | ✅ | ✅ | ✅ | ✅ | ✅ |
|
|
92
|
-
| **Arrays of Arrays of Structs** | `List[List[dataclass]]` | ❌ | ✅ | ✅ | ✅ | ✅ | ✅ |
|
|
82
|
+
| Data Type | Python Type | BigQuery | Athena | Redshift | Trino | Snowflake | DuckDB | ClickHouse |
|
|
83
|
+
|-----------|-------------|----------|--------|----------|-------|-----------|--------|------------|
|
|
84
|
+
| **String Array** | `List[str]` | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
|
|
85
|
+
| **Integer Array** | `List[int]` | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
|
|
86
|
+
| **Decimal Array** | `List[Decimal]` | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
|
|
87
|
+
| **Optional Array** | `Optional[List[T]]` | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
|
|
88
|
+
| **Map/Dict** | `Dict[K, V]` | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
|
|
89
|
+
| **Struct/Record** | `dataclass` | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
|
|
90
|
+
| **Nested Arrays** | `List[List[T]]` | ❌ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
|
|
91
|
+
| **Arrays of Structs** | `List[dataclass]` | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
|
|
92
|
+
| **3D Arrays** | `List[List[List[T]]]` | ❌ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
|
|
93
|
+
| **Arrays of Arrays of Structs** | `List[List[dataclass]]` | ❌ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
|
|
93
94
|
|
|
94
95
|
### Database-Specific Notes
|
|
95
96
|
|
|
@@ -99,15 +100,16 @@ The library supports different data types across database engines. All checkmark
|
|
|
99
100
|
- **Trino**: Memory catalog for testing; excellent decimal precision; supports arrays, maps, and struct types using `ROW` with named fields (dataclasses and Pydantic models); **full support for deeply nested types** including nested arrays, arrays of structs, and 3D arrays
|
|
100
101
|
- **Snowflake**: Column names normalized to lowercase; 1MB query size limit; dict/map types implemented via VARIANT type (JSON parsing); **full support for deeply nested types** including struct types using OBJECT + PARSE_JSON, nested arrays (2D, 3D+), arrays of structs, and arrays of arrays of structs
|
|
101
102
|
- **DuckDB**: Fast embedded analytics database; excellent SQL standards compliance; supports arrays, maps, and struct types using `STRUCT` syntax with named fields (dataclasses and Pydantic models); **full support for deeply nested types** including nested arrays (2D, 3D+), arrays of structs, and arrays of arrays of structs
|
|
103
|
+
- **ClickHouse**: Column-oriented analytics database; uses HTTP client (`clickhouse-connect`) against `Memory`-engine tables for physical mode; supports `Array(T)`, `Map(K, V)`, and named `Tuple(field T, ...)` for struct types (dataclasses and Pydantic models); scalar columns are declared `Nullable(...)` so NULLs round-trip cleanly; **full support for deeply nested types** including nested arrays, arrays of tuples, and arrays of arrays of tuples
|
|
102
104
|
|
|
103
105
|
## Execution Modes Support
|
|
104
106
|
|
|
105
107
|
The library supports two execution modes for mock data injection. **CTE Mode is the default** and is automatically used unless Physical Tables mode is explicitly requested or required due to query size limits.
|
|
106
108
|
|
|
107
|
-
| Execution Mode | Description | BigQuery | Athena | Redshift | Trino | Snowflake | DuckDB |
|
|
108
|
-
|
|
109
|
-
| **CTE Mode** | Mock data injected as Common Table Expressions | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
|
|
110
|
-
| **Physical Tables** | Mock data created as temporary tables | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
|
|
109
|
+
| Execution Mode | Description | BigQuery | Athena | Redshift | Trino | Snowflake | DuckDB | ClickHouse |
|
|
110
|
+
|----------------|-------------|----------|--------|----------|-------|-----------|--------|------------|
|
|
111
|
+
| **CTE Mode** | Mock data injected as Common Table Expressions | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
|
|
112
|
+
| **Physical Tables** | Mock data created as temporary tables | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
|
|
111
113
|
|
|
112
114
|
### Execution Mode Details
|
|
113
115
|
|
|
@@ -132,15 +134,17 @@ The library supports two execution modes for mock data injection. **CTE Mode is
|
|
|
132
134
|
| **Trino** | Memory tables | `memory.default` schema | Library executes `DROP TABLE` | After each test |
|
|
133
135
|
| **Snowflake** | Temporary tables | Session-specific temp schema | Database automatic | Session end |
|
|
134
136
|
| **DuckDB** | Temporary tables | Database-specific temp schema | Library executes `DROP TABLE` | After each test |
|
|
137
|
+
| **ClickHouse** | `Memory`-engine tables | Configured database | Library executes `DROP TABLE` | After each test |
|
|
135
138
|
|
|
136
139
|
#### **Cleanup Behavior Explained**
|
|
137
140
|
|
|
138
|
-
**Library-Managed Cleanup (BigQuery, Athena, Trino, DuckDB):**
|
|
141
|
+
**Library-Managed Cleanup (BigQuery, Athena, Trino, DuckDB, ClickHouse):**
|
|
139
142
|
- The SQL Testing Library explicitly calls cleanup methods after each test
|
|
140
143
|
- **BigQuery**: Creates standard tables in your dataset, then deletes them via `client.delete_table()`
|
|
141
144
|
- **Athena**: Creates external tables backed by S3 data, then drops table metadata via `DROP TABLE IF EXISTS` (⚠️ **S3 data files remain and require separate cleanup**)
|
|
142
145
|
- **Trino**: Creates tables in memory catalog, then drops them via `DROP TABLE IF EXISTS`
|
|
143
146
|
- **DuckDB**: Creates temporary tables in the database, then drops them via `DROP TABLE IF EXISTS`
|
|
147
|
+
- **ClickHouse**: Creates tables with the `Memory` engine, then drops them via `DROP TABLE IF EXISTS`
|
|
144
148
|
|
|
145
149
|
**Database-Managed Cleanup (Redshift, Snowflake):**
|
|
146
150
|
- These databases have built-in temporary table mechanisms
|
|
@@ -165,7 +169,7 @@ A: Trino's memory catalog doesn't automatically clean up tables when sessions en
|
|
|
165
169
|
A: BigQuery tables created by the library are **standard tables without TTL** - they persist until explicitly deleted. The library immediately calls `client.delete_table()` after each test. If you want to set TTL as a safety net, you can configure it at the dataset level (e.g., 24 hours) to auto-delete any orphaned tables.
|
|
166
170
|
|
|
167
171
|
**Q: Which databases leave artifacts if tests crash?**
|
|
168
|
-
- **BigQuery, Athena, Trino, DuckDB**: May leave tables if library crashes before cleanup
|
|
172
|
+
- **BigQuery, Athena, Trino, DuckDB, ClickHouse**: May leave tables if library crashes before cleanup
|
|
169
173
|
- **Redshift, Snowflake**: No artifacts - temporary tables auto-cleanup on session end
|
|
170
174
|
|
|
171
175
|
**Q: How to manually clean up orphaned tables?**
|
|
@@ -236,6 +240,7 @@ aws s3api list-objects-v2 --bucket your-athena-results-bucket --prefix "temp_" \
|
|
|
236
240
|
| **Trino** | 16MB (estimated) | Large dataset or complex CTEs |
|
|
237
241
|
| **Snowflake** | 1MB | Automatically switches at 1MB |
|
|
238
242
|
| **DuckDB** | 32MB (estimated) | Large dataset or complex CTEs |
|
|
243
|
+
| **ClickHouse** | No hard limit | Manually via `use_physical_tables=True` |
|
|
239
244
|
|
|
240
245
|
### How to Control Execution Mode
|
|
241
246
|
|
|
@@ -361,6 +366,9 @@ pip install sql-testing-library[snowflake]
|
|
|
361
366
|
# Install with DuckDB support
|
|
362
367
|
pip install sql-testing-library[duckdb]
|
|
363
368
|
|
|
369
|
+
# Install with ClickHouse support
|
|
370
|
+
pip install sql-testing-library[clickhouse]
|
|
371
|
+
|
|
364
372
|
# Or install with all database adapters
|
|
365
373
|
pip install sql-testing-library[all]
|
|
366
374
|
```
|
|
@@ -377,9 +385,10 @@ poetry install --with redshift
|
|
|
377
385
|
poetry install --with trino
|
|
378
386
|
poetry install --with snowflake
|
|
379
387
|
poetry install --with duckdb
|
|
388
|
+
poetry install --with clickhouse
|
|
380
389
|
|
|
381
390
|
# Install with all database adapters and dev tools
|
|
382
|
-
poetry install --with bigquery,athena,redshift,trino,snowflake,duckdb,dev
|
|
391
|
+
poetry install --with bigquery,athena,redshift,trino,snowflake,duckdb,clickhouse,dev
|
|
383
392
|
```
|
|
384
393
|
|
|
385
394
|
## Quick Start
|
|
@@ -388,7 +397,7 @@ poetry install --with bigquery,athena,redshift,trino,snowflake,duckdb,dev
|
|
|
388
397
|
|
|
389
398
|
```ini
|
|
390
399
|
[sql_testing]
|
|
391
|
-
adapter = bigquery # Use 'bigquery', 'athena', 'redshift', 'trino', 'snowflake', or '
|
|
400
|
+
adapter = bigquery # Use 'bigquery', 'athena', 'redshift', 'trino', 'snowflake', 'duckdb', or 'clickhouse'
|
|
392
401
|
|
|
393
402
|
# BigQuery configuration
|
|
394
403
|
[sql_testing.bigquery]
|
|
@@ -450,6 +459,15 @@ credentials_path = <path to credentials json>
|
|
|
450
459
|
# DuckDB configuration
|
|
451
460
|
# [sql_testing.duckdb]
|
|
452
461
|
# database = <path/to/database.duckdb> # Optional: defaults to in-memory database
|
|
462
|
+
|
|
463
|
+
# ClickHouse configuration
|
|
464
|
+
# [sql_testing.clickhouse]
|
|
465
|
+
# host = <clickhouse-host.example.com>
|
|
466
|
+
# port = 8123 # Optional: default HTTP port (use 9440 for HTTPS)
|
|
467
|
+
# username = default # Optional: default is 'default'
|
|
468
|
+
# password = <clickhouse_password> # Optional: default is empty
|
|
469
|
+
# database = default # Optional: default is 'default'
|
|
470
|
+
# secure = false # Optional: true for HTTPS
|
|
453
471
|
```
|
|
454
472
|
|
|
455
473
|
### Database Context Understanding
|
|
@@ -464,6 +482,7 @@ Each database adapter uses a different concept for organizing tables and queries
|
|
|
464
482
|
| **Snowflake** | `{database}.{schema}` | database + schema | `"test_db.public"` | `SELECT * FROM test_db.public.products` |
|
|
465
483
|
| **Trino** | `{catalog}.{schema}` | catalog + schema | `"memory.default"` | `SELECT * FROM memory.default.inventory` |
|
|
466
484
|
| **DuckDB** | `{database}` | database only | `"test_db"` | `SELECT * FROM test_db.analytics` |
|
|
485
|
+
| **ClickHouse** | `{database}` | database only | `"default"` | `SELECT * FROM default.events` |
|
|
467
486
|
|
|
468
487
|
#### Key Points:
|
|
469
488
|
|
|
@@ -985,7 +1004,7 @@ def test_duckdb_query():
|
|
|
985
1004
|
)
|
|
986
1005
|
```
|
|
987
1006
|
|
|
988
|
-
The adapter_type parameter will use the configuration from the corresponding section in pytest.ini, such as `[sql_testing.bigquery]`, `[sql_testing.athena]`, `[sql_testing.redshift]`, `[sql_testing.trino]`, `[sql_testing.snowflake]`, or `[sql_testing.
|
|
1007
|
+
The adapter_type parameter will use the configuration from the corresponding section in pytest.ini, such as `[sql_testing.bigquery]`, `[sql_testing.athena]`, `[sql_testing.redshift]`, `[sql_testing.trino]`, `[sql_testing.snowflake]`, `[sql_testing.duckdb]`, or `[sql_testing.clickhouse]`.
|
|
989
1008
|
|
|
990
1009
|
**Default Adapter Behavior:**
|
|
991
1010
|
- If `adapter_type` is not specified in the test, the library uses the adapter from `[sql_testing]` section's `adapter` setting
|
|
@@ -4,8 +4,8 @@ build-backend = "poetry.core.masonry.api"
|
|
|
4
4
|
|
|
5
5
|
[tool.poetry]
|
|
6
6
|
name = "sql-testing-library"
|
|
7
|
-
version = "0.
|
|
8
|
-
description = "SQL Testing Framework for Python: Unit test SQL queries with mock data injection for BigQuery, Snowflake, Redshift, Athena, Trino, and
|
|
7
|
+
version = "0.23.1"
|
|
8
|
+
description = "SQL Testing Framework for Python: Unit test SQL queries with mock data injection for BigQuery, Snowflake, Redshift, Athena, Trino, DuckDB, and ClickHouse. Simplify data engineering ETL testing and analytics validation."
|
|
9
9
|
authors = ["Gurmeet Saran <gurmeetx@gmail.com>", "Kushal Thakkar <kushal.thakkar@gmail.com>"]
|
|
10
10
|
maintainers = ["Gurmeet Saran <gurmeetx@gmail.com>", "Kushal Thakkar <kushal.thakkar@gmail.com>"]
|
|
11
11
|
license = "MIT"
|
|
@@ -41,6 +41,8 @@ keywords = [
|
|
|
41
41
|
"google-bigquery",
|
|
42
42
|
"amazon-redshift",
|
|
43
43
|
"snowflake-testing",
|
|
44
|
+
"clickhouse",
|
|
45
|
+
"clickhouse-testing",
|
|
44
46
|
"ci-cd-testing",
|
|
45
47
|
"test-automation"
|
|
46
48
|
]
|
|
@@ -57,7 +59,6 @@ classifiers = [
|
|
|
57
59
|
"Topic :: Scientific/Engineering :: Information Analysis",
|
|
58
60
|
"License :: OSI Approved :: MIT License",
|
|
59
61
|
"Programming Language :: Python :: 3",
|
|
60
|
-
"Programming Language :: Python :: 3.9",
|
|
61
62
|
"Programming Language :: Python :: 3.10",
|
|
62
63
|
"Programming Language :: Python :: 3.11",
|
|
63
64
|
"Programming Language :: Python :: 3.12",
|
|
@@ -83,19 +84,18 @@ include = ["LICENSE", "README.md", "CHANGELOG.md", "py.typed", "src/sql_testing_
|
|
|
83
84
|
"Contributing" = "https://github.com/gurmeetsaran/sqltesting/blob/master/CONTRIBUTING.md"
|
|
84
85
|
|
|
85
86
|
[tool.poetry.dependencies]
|
|
86
|
-
python = ">=3.
|
|
87
|
+
python = ">=3.10"
|
|
87
88
|
sqlglot = ">=26.0.0"
|
|
88
89
|
pydantic = ">=2.0.0"
|
|
89
90
|
pandas = ">=1.0.0"
|
|
90
|
-
|
|
91
|
-
docutils = ">=0.21.2,<0.23.0"
|
|
91
|
+
docutils = ">=0.21.2,<0.24.0"
|
|
92
92
|
db-dtypes = "^1.4.3"
|
|
93
93
|
|
|
94
94
|
[tool.poetry.group.bigquery.dependencies]
|
|
95
95
|
google-cloud-bigquery = ">=3.0.0"
|
|
96
96
|
|
|
97
97
|
[tool.poetry.group.athena.dependencies]
|
|
98
|
-
boto3 = ">=1.
|
|
98
|
+
boto3 = ">=1.35.0"
|
|
99
99
|
|
|
100
100
|
[tool.poetry.group.redshift.dependencies]
|
|
101
101
|
psycopg2-binary = ">=2.9.0"
|
|
@@ -104,28 +104,32 @@ psycopg2-binary = ">=2.9.0"
|
|
|
104
104
|
trino = ">=0.322.0"
|
|
105
105
|
|
|
106
106
|
[tool.poetry.group.snowflake.dependencies]
|
|
107
|
-
snowflake-connector-python = ">=
|
|
107
|
+
snowflake-connector-python = ">=4.6.0"
|
|
108
108
|
|
|
109
109
|
[tool.poetry.group.duckdb.dependencies]
|
|
110
110
|
duckdb = ">=0.8.0"
|
|
111
111
|
|
|
112
|
+
[tool.poetry.group.clickhouse.dependencies]
|
|
113
|
+
clickhouse-connect = { version = ">=0.7.0", python = "<3.15" }
|
|
114
|
+
|
|
112
115
|
[tool.poetry.extras]
|
|
113
|
-
all = ["google-cloud-bigquery", "boto3", "psycopg2-binary", "trino", "snowflake-connector-python", "duckdb"]
|
|
116
|
+
all = ["google-cloud-bigquery", "boto3", "psycopg2-binary", "trino", "snowflake-connector-python", "duckdb", "clickhouse-connect"]
|
|
114
117
|
bigquery = ["google-cloud-bigquery"]
|
|
115
118
|
athena = ["boto3"]
|
|
116
119
|
redshift = ["psycopg2-binary"]
|
|
117
120
|
trino = ["trino"]
|
|
118
121
|
snowflake = ["snowflake-connector-python"]
|
|
119
122
|
duckdb = ["duckdb"]
|
|
123
|
+
clickhouse = ["clickhouse-connect"]
|
|
120
124
|
|
|
121
125
|
[tool.poetry.group.dev.dependencies]
|
|
122
|
-
pytest = ">=
|
|
126
|
+
pytest = ">=9.0.3"
|
|
123
127
|
pytest-asyncio = ">=0.21.0"
|
|
124
128
|
pytest-mock = ">=3.10.0"
|
|
125
129
|
pytest-cov = ">=4.1.0"
|
|
126
130
|
pytest-xdist = ">=3.0.0"
|
|
127
131
|
pytest-rerunfailures = ">=12.0.0"
|
|
128
|
-
black = ">=
|
|
132
|
+
black = ">=26.3.1"
|
|
129
133
|
flake8 = ">=4.0.0"
|
|
130
134
|
pyright = ">=1.1.350"
|
|
131
135
|
tox = ">=4.0.0"
|
|
@@ -141,7 +145,7 @@ mocksmith = ">=6.0.1"
|
|
|
141
145
|
sql_testing = "sql_testing_library._pytest_plugin"
|
|
142
146
|
|
|
143
147
|
[tool.pyright]
|
|
144
|
-
pythonVersion = "3.
|
|
148
|
+
pythonVersion = "3.10"
|
|
145
149
|
include = ["src"]
|
|
146
150
|
exclude = ["tests", "scripts"]
|
|
147
151
|
reportMissingImports = true
|