-
Notifications
You must be signed in to change notification settings - Fork 173
feat(c/driver/postgresql): add validation suite and override tests #3821
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
Merged
lidavidm
merged 5 commits into
apache:main
from
Mandukhai-Alimaa:feat/setup-validation-suite
Dec 29, 2025
Merged
Changes from 2 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
bcd56eb
feat(c/driver/postgresql): add validation suite and override tests
Mandukhai-Alimaa 16f1c65
run precommit and cleanup
Mandukhai-Alimaa a3ab269
fix the license headers and move the fix upstream for getinfo instead…
Mandukhai-Alimaa dc0cb30
update ruby and c++ tests
Mandukhai-Alimaa 6faacb8
fix the test helper
Mandukhai-Alimaa 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 hidden or 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 hidden or 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 hidden or 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,18 @@ | ||
| # Licensed to the Apache Software Foundation (ASF) under one | ||
| # or more contributor license agreements. See the NOTICE file | ||
| # distributed with this work for additional information | ||
| # regarding copyright ownership. The ASF licenses this file | ||
| # to you under the Apache License, Version 2.0 (the | ||
| # "License"); you may not use this file except in compliance | ||
| # with the License. You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, | ||
| # software distributed under the License is distributed on an | ||
| # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
| # KIND, either express or implied. See the License for the | ||
| # specific language governing permissions and limitations | ||
| # under the License. | ||
|
|
||
| validation-report.xml |
This file contains hidden or 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,59 @@ | ||
| <!-- | ||
| Licensed to the Apache Software Foundation (ASF) under one | ||
| or more contributor license agreements. See the NOTICE file | ||
| distributed with this work for additional information | ||
| regarding copyright ownership. The ASF licenses this file | ||
| to you under the Apache License, Version 2.0 (the | ||
| "License"); you may not use this file except in compliance | ||
| with the License. You may obtain a copy of the License at | ||
|
|
||
| http://www.apache.org/licenses/LICENSE-2.0 | ||
|
|
||
| Unless required by applicable law or agreed to in writing, | ||
| software distributed under the License is distributed on an | ||
| "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
| KIND, either express or implied. See the License for the | ||
| specific language governing permissions and limitations | ||
| under the License. | ||
| --> | ||
|
|
||
| # PostgreSQL ADBC Driver Validation Suite | ||
|
|
||
| This directory contains a Python-based validation suite for the PostgreSQL ADBC driver. | ||
|
|
||
| ## Testing | ||
|
|
||
| A running instance of PostgreSQL is required. For example, using Docker: | ||
|
|
||
| ```shell | ||
| $ docker run -it --rm \ | ||
| -e POSTGRES_PASSWORD=password \ | ||
| -e POSTGRES_DB=postgres \ | ||
| -p 5432:5432 \ | ||
| postgres | ||
| ``` | ||
|
|
||
| Alternatively use the `docker compose` provided by ADBC to manage the test | ||
| database container. | ||
|
|
||
| ```shell | ||
| $ docker compose up postgres-test | ||
| # When finished: | ||
| # docker compose down postgres-test | ||
| ``` | ||
|
|
||
| Then, to run the tests, set the environment variable specifying the | ||
| PostgreSQL URI before running tests: | ||
|
|
||
| ```shell | ||
| $ export ADBC_POSTGRESQL_TEST_URI=postgresql://localhost:5432/postgres?user=postgres&password=password | ||
| ``` | ||
|
|
||
| ### 5. Run Tests | ||
|
|
||
| #### Using pixi: | ||
|
|
||
| ```bash | ||
| cd c/driver/postgresql/validation | ||
| pixi run validate | ||
| ``` |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or 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,34 @@ | ||
| # Licensed to the Apache Software Foundation (ASF) under one | ||
| # or more contributor license agreements. See the NOTICE file | ||
| # distributed with this work for additional information | ||
| # regarding copyright ownership. The ASF licenses this file | ||
| # to you under the Apache License, Version 2.0 (the | ||
| # "License"); you may not use this file except in compliance | ||
| # with the License. You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, | ||
| # software distributed under the License is distributed on an | ||
| # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
| # KIND, either express or implied. See the License for the | ||
| # specific language governing permissions and limitations | ||
| # under the License. | ||
|
|
||
| [workspace] | ||
| authors = ["Arrow ADBC Contributors"] | ||
| channels = ["conda-forge"] | ||
| name = "postgresql-validation" | ||
| platforms = ["linux-64", "osx-arm64", "win-64", "linux-aarch64"] | ||
| version = "0.1.0" | ||
|
|
||
| [tasks] | ||
| validate = "pytest -vvs --junit-xml=validation-report.xml -rfEsxX tests/" | ||
|
|
||
| [dependencies] | ||
| python = ">=3.13.5,<3.14" | ||
| pytest-lazy-fixtures = ">=1.3.2,<2" | ||
|
|
||
| [pypi-dependencies] | ||
| adbc-drivers-dev = { git = "https://github.com/adbc-drivers/dev" } | ||
| adbc-drivers-validation = { git = "https://github.com/adbc-drivers/validation" } |
This file contains hidden or 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,24 @@ | ||
| # Licensed to the Apache Software Foundation (ASF) under one | ||
| # or more contributor license agreements. See the NOTICE file | ||
| # distributed with this work for additional information | ||
| # regarding copyright ownership. The ASF licenses this file | ||
| # to you under the Apache License, Version 2.0 (the | ||
| # "License"); you may not use this file except in compliance | ||
| # with the License. You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, | ||
| # software distributed under the License is distributed on an | ||
| # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
| # KIND, either express or implied. See the License for the | ||
| # specific language governing permissions and limitations | ||
| # under the License. | ||
|
|
||
| [pytest] | ||
| junit_suite_name = validation | ||
| junit_duration_report = call | ||
| xfail_strict = true | ||
|
|
||
| markers = | ||
| feature: test for a driver-specific feature |
15 changes: 15 additions & 0 deletions
15
c/driver/postgresql/validation/queries/ingest/decimal.toml
This file contains hidden or 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,15 @@ | ||
| # Copyright (c) 2025 ADBC Drivers Contributors | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
|
|
||
| skip = "decimal ingest code has a bug and fix has not been merged in yet. https://github.com/apache/arrow-adbc/pull/3787" | ||
17 changes: 17 additions & 0 deletions
17
c/driver/postgresql/validation/queries/ingest/time_ms.txtcase
This file contains hidden or 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,17 @@ | ||
| // Copyright (c) 2025 ADBC Drivers Contributors | ||
| // | ||
| // Licensed under the Apache License, Version 2.0 (the "License"); | ||
| // you may not use this file except in compliance with the License. | ||
| // You may obtain a copy of the License at | ||
| // | ||
| // http://www.apache.org/licenses/LICENSE-2.0 | ||
| // | ||
| // Unless required by applicable law or agreed to in writing, software | ||
| // distributed under the License is distributed on an "AS IS" BASIS, | ||
| // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| // See the License for the specific language governing permissions and | ||
| // limitations under the License. | ||
|
|
||
| // part: metadata | ||
|
|
||
| skip = "COPY Writer not implemented" |
17 changes: 17 additions & 0 deletions
17
c/driver/postgresql/validation/queries/ingest/time_ns.txtcase
This file contains hidden or 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,17 @@ | ||
| // Copyright (c) 2025 ADBC Drivers Contributors | ||
| // | ||
| // Licensed under the Apache License, Version 2.0 (the "License"); | ||
| // you may not use this file except in compliance with the License. | ||
| // You may obtain a copy of the License at | ||
| // | ||
| // http://www.apache.org/licenses/LICENSE-2.0 | ||
| // | ||
| // Unless required by applicable law or agreed to in writing, software | ||
| // distributed under the License is distributed on an "AS IS" BASIS, | ||
| // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| // See the License for the specific language governing permissions and | ||
| // limitations under the License. | ||
|
|
||
| // part: metadata | ||
|
|
||
| skip = "COPY Writer not implemented" |
17 changes: 17 additions & 0 deletions
17
c/driver/postgresql/validation/queries/ingest/time_s.txtcase
This file contains hidden or 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,17 @@ | ||
| // Copyright (c) 2025 ADBC Drivers Contributors | ||
| // | ||
| // Licensed under the Apache License, Version 2.0 (the "License"); | ||
| // you may not use this file except in compliance with the License. | ||
| // You may obtain a copy of the License at | ||
| // | ||
| // http://www.apache.org/licenses/LICENSE-2.0 | ||
| // | ||
| // Unless required by applicable law or agreed to in writing, software | ||
| // distributed under the License is distributed on an "AS IS" BASIS, | ||
| // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| // See the License for the specific language governing permissions and | ||
| // limitations under the License. | ||
|
|
||
| // part: metadata | ||
|
|
||
| skip = "COPY Writer not implemented" |
40 changes: 40 additions & 0 deletions
40
c/driver/postgresql/validation/queries/ingest/timestamp_ms.txtcase
This file contains hidden or 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,40 @@ | ||
| // Copyright (c) 2025 ADBC Drivers Contributors | ||
| // | ||
| // Licensed under the Apache License, Version 2.0 (the "License"); | ||
| // you may not use this file except in compliance with the License. | ||
| // You may obtain a copy of the License at | ||
| // | ||
| // http://www.apache.org/licenses/LICENSE-2.0 | ||
| // | ||
| // Unless required by applicable law or agreed to in writing, software | ||
| // distributed under the License is distributed on an "AS IS" BASIS, | ||
| // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| // See the License for the specific language governing permissions and | ||
| // limitations under the License. | ||
|
|
||
| // part: expected_schema | ||
|
|
||
| { | ||
| "format": "+s", | ||
| "children": [ | ||
| { | ||
| "name": "idx", | ||
| "format": "l", | ||
| "flags": ["nullable"] | ||
| }, | ||
| { | ||
| "name": "value", | ||
| "format": "tsu:", | ||
| "flags": ["nullable"] | ||
| } | ||
| ] | ||
| } | ||
|
|
||
| // part: expected | ||
|
|
||
| {"idx": 0, "value": null} | ||
| {"idx": 1, "value": 0} | ||
| {"idx": 2, "value": 946684800123000} | ||
| {"idx": 3, "value": 1684158330123000} | ||
| {"idx": 4, "value": -62135596800000000} | ||
| {"idx": 5, "value": 253402300799999000} |
40 changes: 40 additions & 0 deletions
40
c/driver/postgresql/validation/queries/ingest/timestamp_ns.txtcase
This file contains hidden or 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,40 @@ | ||
| // Copyright (c) 2025 ADBC Drivers Contributors | ||
| // | ||
| // Licensed under the Apache License, Version 2.0 (the "License"); | ||
| // you may not use this file except in compliance with the License. | ||
| // You may obtain a copy of the License at | ||
| // | ||
| // http://www.apache.org/licenses/LICENSE-2.0 | ||
| // | ||
| // Unless required by applicable law or agreed to in writing, software | ||
| // distributed under the License is distributed on an "AS IS" BASIS, | ||
| // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| // See the License for the specific language governing permissions and | ||
| // limitations under the License. | ||
|
|
||
| // part: expected_schema | ||
|
|
||
| { | ||
| "format": "+s", | ||
| "children": [ | ||
| { | ||
| "name": "idx", | ||
| "format": "l", | ||
| "flags": ["nullable"] | ||
| }, | ||
| { | ||
| "name": "value", | ||
| "format": "tsu:", | ||
| "flags": ["nullable"] | ||
| } | ||
| ] | ||
| } | ||
|
|
||
| // part: expected | ||
|
|
||
| {"idx": 0, "value": null} | ||
| {"idx": 1, "value": 0} | ||
| {"idx": 2, "value": -9223372036854775} | ||
| {"idx": 3, "value": 946684800000000} | ||
| {"idx": 4, "value": 1684158330000000} | ||
| {"idx": 5, "value": 9223372036854775} |
40 changes: 40 additions & 0 deletions
40
c/driver/postgresql/validation/queries/ingest/timestamp_s.txtcase
This file contains hidden or 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,40 @@ | ||
| // Copyright (c) 2025 ADBC Drivers Contributors | ||
| // | ||
| // Licensed under the Apache License, Version 2.0 (the "License"); | ||
| // you may not use this file except in compliance with the License. | ||
| // You may obtain a copy of the License at | ||
| // | ||
| // http://www.apache.org/licenses/LICENSE-2.0 | ||
| // | ||
| // Unless required by applicable law or agreed to in writing, software | ||
| // distributed under the License is distributed on an "AS IS" BASIS, | ||
| // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| // See the License for the specific language governing permissions and | ||
| // limitations under the License. | ||
|
|
||
| // part: expected_schema | ||
|
|
||
| { | ||
| "format": "+s", | ||
| "children": [ | ||
| { | ||
| "name": "idx", | ||
| "format": "l", | ||
| "flags": ["nullable"] | ||
| }, | ||
| { | ||
| "name": "value", | ||
| "format": "tsu:", | ||
| "flags": ["nullable"] | ||
| } | ||
| ] | ||
| } | ||
|
|
||
| // part: expected | ||
|
|
||
| {"idx": 0, "value": null} | ||
| {"idx": 1, "value": 0} | ||
| {"idx": 2, "value": 946684800000000} | ||
| {"idx": 3, "value": 1684158330000000} | ||
| {"idx": 4, "value": -62135596800000000} | ||
| {"idx": 5, "value": 253402300799000000} |
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.