Skip to content

Commit 2fab29e

Browse files
committed
feat!: test GetTableSchema via regular select queries
This requires a bit more trickery on our side but saves dev effort in not having to effectively duplicate a lot of test cases. Fixes #43.
1 parent 2585c22 commit 2fab29e

41 files changed

Lines changed: 12 additions & 506 deletions

Some content is hidden

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

adbc_drivers_validation/model.py

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -318,24 +318,10 @@ def bind_data(self) -> pyarrow.Table:
318318
return query_table(self.bind_path, self.bind_schema())
319319

320320

321-
@dataclasses.dataclass
322-
class SchemaQuery:
323-
expected_schema_path: Path
324-
setup_query_path: Path
325-
326-
def setup_query(self) -> str | None:
327-
if not self.setup_query_path:
328-
return None
329-
return query(self.setup_query_path)
330-
331-
def expected_schema(self) -> pyarrow.Schema:
332-
return query_schema(self.expected_schema_path)
333-
334-
335321
@dataclasses.dataclass
336322
class Query:
337323
name: str
338-
query: IngestQuery | SchemaQuery | SelectQuery
324+
query: IngestQuery | SelectQuery
339325
metadata_paths: list[Path] | None = None
340326
pytest_marks: list = dataclasses.field(default_factory=list)
341327

@@ -374,11 +360,6 @@ def merge(
374360
)
375361
if parent.query.expected_path:
376362
params["expected_path"] = parent.query.expected_path
377-
case SchemaQuery():
378-
params = {
379-
"expected_schema_path": parent.query.expected_schema_path,
380-
"setup_query_path": parent.query.setup_query_path,
381-
}
382363
case SelectQuery():
383364
params = {
384365
"query_path": parent.query.query_path,
@@ -410,8 +391,6 @@ def merge(
410391
for key in params
411392
):
412393
query = IngestQuery(**params)
413-
elif params.keys() == {"expected_schema_path", "setup_query_path"}:
414-
query = SchemaQuery(**params)
415394
elif all(
416395
key in params
417396
for key in {

adbc_drivers_validation/queries/type/table_schema/binary.schema.json

Lines changed: 0 additions & 10 deletions
This file was deleted.

adbc_drivers_validation/queries/type/table_schema/binary.setup.sql

Lines changed: 0 additions & 11 deletions
This file was deleted.

adbc_drivers_validation/queries/type/table_schema/binary.toml

Lines changed: 0 additions & 16 deletions
This file was deleted.

adbc_drivers_validation/queries/type/table_schema/boolean.schema.json

Lines changed: 0 additions & 10 deletions
This file was deleted.

adbc_drivers_validation/queries/type/table_schema/boolean.setup.sql

Lines changed: 0 additions & 9 deletions
This file was deleted.

adbc_drivers_validation/queries/type/table_schema/boolean.toml

Lines changed: 0 additions & 16 deletions
This file was deleted.

adbc_drivers_validation/queries/type/table_schema/date.schema.json

Lines changed: 0 additions & 10 deletions
This file was deleted.

adbc_drivers_validation/queries/type/table_schema/date.setup.sql

Lines changed: 0 additions & 11 deletions
This file was deleted.

adbc_drivers_validation/queries/type/table_schema/date.toml

Lines changed: 0 additions & 16 deletions
This file was deleted.

0 commit comments

Comments
 (0)