CurtHagenlocher opened a new pull request, #4911:
URL: https://github.com/apache/arrow-adbc/pull/4911
## What's changed
This adds tests that exercise the ADBC 1.1 APIs and the async/cancellation
support through the imported DuckDB driver. The other tests use the managed
round-trip fixture; these check the C# importer against a real native 1.1
driver.
This is the last of the PRs implementing ADBC 1.1 in C#:
- #4884 fixed bugs in the C importer and exporter.
- #4885 added the 1.1 APIs to the base classes.
- #4895 added async methods and cancellation.
- #4901 used them in the Client.
There are no library changes in this PR.
### New tests in `ImportedDuckDbTests`
- **Options:**
- `DatabaseGetOption` and `TypedDatabaseOptionsAreAppliedAtOpen`. A `long`
value reaches DuckDB through `DatabaseSetOptionInt`.
- `StandardConnectionOptionsComeFromTheDriver`, for autocommit, current
catalog and current schema.
- `SetCurrentDbSchema`, which also uses `SetOptionAsync` and
`GetOptionAsync`.
- `ConnectWithTypedOptions` and `ConnectWithTypedOptionsAsync`.
- `StatementGetOption`.
- `UnsupportedOptions`, which checks the `NotFound` and `NotImplemented`
statuses at each level.
- **Errors:** `ErrorDetails` checks the 1.1 error details
(`duckdb:error_type`). It also checks that the vendor code field, which the 1.1
error layout reuses, doesn't leak into `NativeError`.
- **Statistics:** `Statistics` covers `GetStatisticsNames` and
`GetStatistics`.
- **Async:**
- `OpenAndConnectAsync`.
- `ExecuteAsyncWithCancellationToken`.
- `TransactionsAsync`, for `CommitAsync` and `RollbackAsync`.
- `CancellationTokenCancelsQuery`. Like `CancelStatement` and
`CancelConnection`, it keeps cancelling until the query ends, because DuckDB
discards a cancel that arrives before the query has started.
`DuckDbFixture` gains an `OpenDatabase` overload that takes `object` values,
and an `OpenDatabaseAsync`.
### DuckDB 1.5.6 behavior the tests allow for
Each of these is commented where a test allows for it:
- **Interrupted queries** are reported as `InvalidArgument` rather than
`Cancelled`.
- **Unknown statement options** get `InvalidArgument` rather than the spec's
`NotImplemented`. The test accepts either, so a DuckDB fix won't break it.
- **Autocommit:** after the current catalog or schema has been read, a later
attempt to disable autocommit is silently ignored. The test checks the catalog
and schema last.
## Testing
- The full solution builds without warnings, and `dotnet format
--verify-no-changes` is clean.
- The core test project passes on net10.0, net8.0 and net472.
- 10 full runs with `DOTNET_PROCESSOR_COUNT=2` had no failures.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]