Use oracledb AuthMode/Purity enums in Oracle hook connection config#67689
Merged
Conversation
Contributor
Author
|
Hi @potiuk @amoghrajesh — when you have a moment, could you take a look at this PR? It's a small change that switches the Oracle hook to use oracledb's AuthMode/Purity enums instead of raw integers. Thanks! |
potiuk
approved these changes
Jun 21, 2026
Resolve the long-standing TODO to map the connection extra mode/purity strings via the oracledb.AuthMode / oracledb.Purity enums instead of the hand-written if/elif chains. The enums were added in python-oracledb 2.3, so the minimum is raised from 2.0.0 to 2.3.0. The legacy AUTH_MODE_*/PURITY_* module constants are aliases of these enum members, so the resolved values are unchanged. Matching is now done by enum member name (case-insensitive) and covers every AuthMode/Purity value rather than the previously hard-coded subset. None is compared explicitly because Purity.DEFAULT is 0 and a truthiness check would drop it.
The dependency table in the generated README.rst and docs/index.rst is derived from pyproject.toml. Regenerated via `breeze release-management prepare-provider-documentation --only-min-version-update` to reflect the oracledb >=2.3.0 floor.
potiuk
force-pushed
the
feature/oracle-auth-mode-purity-enum
branch
from
June 21, 2026 23:46
3b3071f to
dc6c0e3
Compare
75 tasks
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.
Description
Resolves the long-standing TODO in
OracleHook.get_connto map the connectionextramode/purity strings via theoracledb.AuthModeandoracledb.Purityenums, replacing the hand-writtenif/elifchains.Key changes
mode/puritystring is now resolved against the matchingAuthMode/Purityenum member by name (case-insensitive), collapsing twoif/elifchains into a singlegetattrlookup each.oracledb.AuthMode/oracledb.Puritywere introduced in python-oracledb 2.3, so the floor is raised from2.0.0to2.3.0(a minor release within the same major).AuthMode/Purityvalue instead of the previously hard-coded subset.Compatibility
The legacy
AUTH_MODE_*/PURITY_*module constants are aliases of these enum members, so resolved connection values are unchanged.Noneis compared explicitly becausePurity.DEFAULTis0and a truthiness check would drop it.Verification
prek(ruff, pre-commit hooks): passedtest_get_conn_mode/test_get_conn_purityand the fulltest_oracle.pyhook suite (55 tests): passed unchangedWas generative AI tooling used to co-author this PR?
Generated-by: Claude Code (Opus 4.8) following the guidelines
{pr_number}.significant.rst, in airflow-core/newsfragments. You can add this file in a follow-up commit after the PR is created so you know the PR number.