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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions adbc_drivers_validation/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,8 @@ class DriverFeatures(BaseModel):
statement_get_parameter_schema: bool = Field(default=False)
statement_prepare: bool = Field(default=False)
statement_rows_affected: bool = Field(default=False)
# Some backends report zero for every ordinary DML statement (ex: Databend)
statement_rows_affected_dml_returns_zero: bool = Field(default=False)

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.

nit, but maybe this could be a 'quirk' (see below)?

statement_rows_affected_ddl: bool = Field(default=False)
_current_catalog: str | FromEnv | None = PrivateAttr(default=None)
_current_schema: str | FromEnv | None = PrivateAttr(default=None)
Expand Down
2 changes: 1 addition & 1 deletion adbc_drivers_validation/tests/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ def generate_tests(
elif not f.get_objects and metafunc.definition.name.startswith(
"test_get_objects_"
):
marks.append(pytest.mark.xfail(reason="not implemented"))
marks.append(pytest.mark.skip(reason="not implemented"))

combinations.append(pytest.param(driver_param, id=driver_param, marks=marks))
metafunc.parametrize(
Expand Down
15 changes: 12 additions & 3 deletions adbc_drivers_validation/tests/statement.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,10 @@ def test_rows_affected(
)
rows_affected = cursor.adbc_statement.execute_update()
if driver.features.statement_rows_affected:
assert rows_affected == 1
if driver.features.statement_rows_affected_dml_returns_zero:
assert rows_affected == 0
else:
assert rows_affected == 1
else:
assert rows_affected == -1

Expand All @@ -258,7 +261,10 @@ def test_rows_affected(
)
rows_affected = cursor.adbc_statement.execute_update()
if driver.features.statement_rows_affected:
assert rows_affected == 1
if driver.features.statement_rows_affected_dml_returns_zero:
assert rows_affected == 0
else:
assert rows_affected == 1
else:
assert rows_affected == -1

Expand All @@ -267,7 +273,10 @@ def test_rows_affected(
)
rows_affected = cursor.adbc_statement.execute_update()
if driver.features.statement_rows_affected:
assert rows_affected == 1
if driver.features.statement_rows_affected_dml_returns_zero:
assert rows_affected == 0
else:
assert rows_affected == 1
else:
assert rows_affected == -1

Expand Down
Loading