test(connection): int-typed getter coherence for autocommit set via SetOptionInt - #8
Open
fornwall wants to merge 1 commit into
Open
test(connection): int-typed getter coherence for autocommit set via SetOptionInt#8fornwall wants to merge 1 commit into
fornwall wants to merge 1 commit into
Conversation
…etOptionInt adbc.h (AdbcConnectionGetOptionInt): 'For standard options, drivers must always support getting the option value (if they support getting option values at all) via the type specified in the option. (For example, an option set via SetOptionDouble must be retrievable via GetOptionDouble.)' test_option_autocommit_int_coherence sets adbc.connection.autocommit through SetOptionInt (a plain Python int via set_options) and, when the driver accepts that set, requires GetOptionInt to succeed and agree (and the string getter to agree as well). Drivers that reject the integer-typed set are skipped, not failed. Gated on connection_transactions since the test toggles autocommit off; restores autocommit afterwards like test_transaction_toggle. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LGf8PVEe2tYkw8Q6Pd95tq Signed-off-by: Fredrik Fornwall <fredrik@fornwall.net>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Split out of #4 (one PR per test). Adds one generic, driver-agnostic test for a gap found while reviewing an ADBC driver (the adbc-spanner Rust driver) against this suite; candidate for upstreaming to adbc-drivers/validation later.
TestConnection.test_option_autocommit_int_coherence(gated onconnection_transactions)Sets
adbc.connection.autocommitthroughSetOptionInt(a plain Pythonintviaset_options); if the driver accepts that set, requiresGetOptionInton the same key to succeed and agree, and the string getter to agree too. Drivers that reject the integer-typed set are skipped, not failed. Restores autocommit afterwards (same pattern astest_transaction_toggle, which covers the bool-as-string round-trip; this test is specifically the int-typed accessor coherence).AdbcConnectionGetOptionIntdoc comment inadbc.h: "For standard options, drivers must always support getting the option value (if they support getting option values at all) via the type specified in the option. (For example, an option set via SetOptionDouble must be retrievable via GetOptionDouble.)" The skip-on-rejected-set keeps the test within that text: it only asserts the getter once the driver has itself accepted the int-typed set.Results on real drivers
get_option_interrors withINVALID_ARGUMENT: option adbc.connection.autocommit value "true" is not an integer.driver does not accept an integer-typed autocommit).Framework checks
uv run pytest tests/(210 passed, 1 skipped),uv run ty check(clean),pre-commit run --all-files(all hooks pass) — all on this branch independently.🤖 Generated with Claude Code
https://claude.ai/code/session_01LGf8PVEe2tYkw8Q6Pd95tq