Skip to content

Commit fc93edb

Browse files
committed
chore: import validation suite
0 parents  commit fc93edb

324 files changed

Lines changed: 6235 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 221 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,221 @@
1+
# Copyright (c) 2025 Columnar Technologies, Inc.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
# Byte-compiled / optimized / DLL files
16+
__pycache__/
17+
*.py[codz]
18+
*$py.class
19+
20+
# C extensions
21+
*.so
22+
23+
# Distribution / packaging
24+
.Python
25+
build/
26+
develop-eggs/
27+
dist/
28+
downloads/
29+
eggs/
30+
.eggs/
31+
lib/
32+
lib64/
33+
parts/
34+
sdist/
35+
var/
36+
wheels/
37+
share/python-wheels/
38+
*.egg-info/
39+
.installed.cfg
40+
*.egg
41+
MANIFEST
42+
43+
# PyInstaller
44+
# Usually these files are written by a python script from a template
45+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
46+
*.manifest
47+
*.spec
48+
49+
# Installer logs
50+
pip-log.txt
51+
pip-delete-this-directory.txt
52+
53+
# Unit test / coverage reports
54+
htmlcov/
55+
.tox/
56+
.nox/
57+
.coverage
58+
.coverage.*
59+
.cache
60+
nosetests.xml
61+
coverage.xml
62+
*.cover
63+
*.py.cover
64+
.hypothesis/
65+
.pytest_cache/
66+
cover/
67+
68+
# Translations
69+
*.mo
70+
*.pot
71+
72+
# Django stuff:
73+
*.log
74+
local_settings.py
75+
db.sqlite3
76+
db.sqlite3-journal
77+
78+
# Flask stuff:
79+
instance/
80+
.webassets-cache
81+
82+
# Scrapy stuff:
83+
.scrapy
84+
85+
# Sphinx documentation
86+
docs/_build/
87+
88+
# PyBuilder
89+
.pybuilder/
90+
target/
91+
92+
# Jupyter Notebook
93+
.ipynb_checkpoints
94+
95+
# IPython
96+
profile_default/
97+
ipython_config.py
98+
99+
# pyenv
100+
# For a library or package, you might want to ignore these files since the code is
101+
# intended to run in multiple environments; otherwise, check them in:
102+
# .python-version
103+
104+
# pipenv
105+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
106+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
107+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
108+
# install all needed dependencies.
109+
#Pipfile.lock
110+
111+
# UV
112+
# Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
113+
# This is especially recommended for binary packages to ensure reproducibility, and is more
114+
# commonly ignored for libraries.
115+
#uv.lock
116+
117+
# poetry
118+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
119+
# This is especially recommended for binary packages to ensure reproducibility, and is more
120+
# commonly ignored for libraries.
121+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
122+
#poetry.lock
123+
#poetry.toml
124+
125+
# pdm
126+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
127+
# pdm recommends including project-wide configuration in pdm.toml, but excluding .pdm-python.
128+
# https://pdm-project.org/en/latest/usage/project/#working-with-version-control
129+
#pdm.lock
130+
#pdm.toml
131+
.pdm-python
132+
.pdm-build/
133+
134+
# pixi
135+
# Similar to Pipfile.lock, it is generally recommended to include pixi.lock in version control.
136+
#pixi.lock
137+
# Pixi creates a virtual environment in the .pixi directory, just like venv module creates one
138+
# in the .venv directory. It is recommended not to include this directory in version control.
139+
.pixi
140+
141+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
142+
__pypackages__/
143+
144+
# Celery stuff
145+
celerybeat-schedule
146+
celerybeat.pid
147+
148+
# SageMath parsed files
149+
*.sage.py
150+
151+
# Environments
152+
.env
153+
.envrc
154+
.venv
155+
env/
156+
venv/
157+
ENV/
158+
env.bak/
159+
venv.bak/
160+
161+
# Spyder project settings
162+
.spyderproject
163+
.spyproject
164+
165+
# Rope project settings
166+
.ropeproject
167+
168+
# mkdocs documentation
169+
/site
170+
171+
# mypy
172+
.mypy_cache/
173+
.dmypy.json
174+
dmypy.json
175+
176+
# Pyre type checker
177+
.pyre/
178+
179+
# pytype static type analyzer
180+
.pytype/
181+
182+
# Cython debug symbols
183+
cython_debug/
184+
185+
# PyCharm
186+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
187+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
188+
# and can be added to the global gitignore or merged into this file. For a more nuclear
189+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
190+
#.idea/
191+
192+
# Abstra
193+
# Abstra is an AI-powered process automation framework.
194+
# Ignore directories containing user credentials, local state, and settings.
195+
# Learn more at https://abstra.io/docs
196+
.abstra/
197+
198+
# Visual Studio Code
199+
# Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
200+
# that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
201+
# and can be added to the global gitignore or merged into this file. However, if you prefer,
202+
# you could uncomment the following to ignore the entire vscode folder
203+
# .vscode/
204+
205+
# Ruff stuff:
206+
.ruff_cache/
207+
208+
# PyPI configuration file
209+
.pypirc
210+
211+
# Cursor
212+
# Cursor is an AI-powered code editor. `.cursorignore` specifies files/directories to
213+
# exclude from AI features like autocomplete and code analysis. Recommended for sensitive data
214+
# refer to https://docs.cursor.com/context/ignore-files
215+
.cursorignore
216+
.cursorindexingignore
217+
218+
# Marimo
219+
marimo/_static/
220+
marimo/_lsp/
221+
__marimo__/

.pre-commit-config.yaml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# Copyright (c) 2025 Columnar Technologies, Inc.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
repos:
16+
- repo: https://github.com/astral-sh/ruff-pre-commit
17+
rev: 8a948e557ca98afa9489998ad0b85515964df9c4 # v0.12.0
18+
hooks:
19+
- id: ruff-check
20+
name: "ruff check (isort)"
21+
args: ["--select", "I", "--fix"]
22+
- id: ruff-check
23+
args: ["--fix"]
24+
- id: ruff-format
25+
26+
- repo: https://github.com/codespell-project/codespell
27+
rev: 63c8f8312b7559622c0d82815639671ae42132ac # v2.4.1
28+
hooks:
29+
- id: codespell
30+
31+
- repo: https://github.com/pre-commit/pre-commit-hooks
32+
rev: cef0300fd0fc4d2a87a85fa2093c6b283ea36f4b # v5.0.0
33+
hooks:
34+
- id: check-added-large-files
35+
- id: check-case-conflict
36+
- id: check-executables-have-shebangs
37+
- id: check-yaml
38+
- id: detect-private-key
39+
- id: end-of-file-fixer
40+
- id: mixed-line-ending
41+
args: [--fix=lf]
42+
exclude: '\.bat$'
43+
- id: trailing-whitespace
44+
45+
- repo: git@github.com:adbc-drivers/dev
46+
rev: f5779f2109f177f7da6394d3427589a3a84eb521
47+
hooks:
48+
- id: rat

.rat-excludes

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Copyright (c) 2025 Columnar Technologies, Inc.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
adbc_drivers_validation/queries/*/*.json
16+
adbc_drivers_validation/queries/*/*.sql

README.markdown

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
<!--
2+
Copyright (c) 2025 Columnar Technologies, Inc.
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
-->
16+
17+
# Driver Validation Suite
18+
19+
## Adding New Tests
20+
21+
The validation suite essentially runs a bunch of SQL queries against each
22+
driver. The queries are tagged with various bits of metadata that are used to
23+
generate documentation.
24+
25+
The queries live under `queries/base`. They are somewhat subcategorized, but
26+
this is arbitrary and not important to the test runner. A single query is all
27+
the files in the same directory with the same filename (less extensions). The
28+
type of query, and hence what kind of test results, depends on which files are
29+
present.
30+
31+
All queries have an optional `query.toml` file defining various metadata:
32+
33+
- `hide` (`bool`) - if `true`, don't run this query (for this driver)
34+
- `sort-keys` (`list[tuple[str, 'ascending' | 'descending']]`) - if present,
35+
sort the result set by these columns before comparison
36+
- `tags` table:
37+
- `caveats` (`list[str]`) - if present, a list of footnotes to add to the
38+
user documentation (e.g. to explain why something is only partially
39+
supported)
40+
- `partial-support` (`bool`) - if present, indicate in the user
41+
documentation that something is only partially supported
42+
- `sql-type-name` (`str`) - the name of the SQL type being tested (to
43+
display in the user documentation)
44+
45+
A `SELECT` query just tests running a query and checking the result. It
46+
consists of:
47+
48+
- `query.sql` - the query to run
49+
- `query.schema.json` - the schema of the result set
50+
- `query.json` - the data of the result set (in JSON Lines)
51+
- `query.setup.sql` (optional) - a query to run before the main query (e.g. to
52+
create any tables required)
53+
- `query.bind.json` (optional) - data to insert via executing a query with
54+
bind parameters (in JSON Lines)
55+
- `query.bind.schema.json` (optional) - the schema of the bind data
56+
- `query.bind.sql` (optional) - the query that is executed for bind data. It
57+
should always use `$1` style placeholders, which will be replaced at runtime
58+
with database-specific placeholders
59+
60+
A schema query tests getting the schema of the result set of a query without
61+
actually running it. It consists of:
62+
63+
- `query.sql`
64+
- `query.schema.json`
65+
66+
An ingest query tests using bulk ingestion to load Arrow data, then querying
67+
the result table. It consists of:
68+
69+
- `query.input.schema.json` - the schema of the data to insert
70+
- `query.input.json` - the data to insert
71+
- `query.schema.json` (optional) - the schema of the result set (by default it
72+
is assumed to be the same as the input)
73+
- `query.json` (optional) - the data of the result set (in JSON Lines) (by
74+
default it is assumed to be the same as the input)
75+
76+
### Overriding Tests with Driver-Specific Tests
77+
78+
Often a driver needs specific changes to a test case, e.g. because it picks a
79+
different return type. Also, drivers may support extra features that need
80+
specific test cases, or may not support a feature and need to skip a test
81+
case. These can be added under a directory specified by the driver quirks.
82+
Instead of duplicating the full test case, as long as a file is present at the
83+
same relative path, it will be used to override that specific part of that
84+
test case for that driver.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Copyright (c) 2025 Columnar Technologies, Inc.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.

0 commit comments

Comments
 (0)