fix(providers/oracle): use conn.schema as service_name fallback in OracleHook#62895
Open
YoannAbriel wants to merge 3 commits intoapache:mainfrom
Open
fix(providers/oracle): use conn.schema as service_name fallback in OracleHook#62895YoannAbriel wants to merge 3 commits intoapache:mainfrom
YoannAbriel wants to merge 3 commits intoapache:mainfrom
Conversation
Contributor
|
Static check failure due to unrelated failures for which fix #62897 is already in place by @potiuk You can trigger CI from your end @YoannAbriel, or wait until it is retriggered from maintainers. |
e9f1902 to
be511b3
Compare
…acleHook When creating an Oracle connection via the UI with Host, Port, and Schema fields filled but without explicitly setting service_name in extras, get_conn() built the DSN without a service name, causing TNS errors. Now conn.schema is used as the service_name when neither service_name nor sid is set in connection extras. Fixes apache#62526
…racle client dependency
be511b3 to
a358a74
Compare
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.
OracleHook.get_conn()ignoresconn.schemawhen building the DSN. When users fill Host, Port, and Schema in the connection UI without settingservice_namein extras, the DSN is constructed without any service name — causingORA-12504: TNS:listener was not given the SERVICE_NAME in CONNECT_DATA.The Schema field in the UI maps to
conn.schema, which for Oracle is typically the service name. This fix falls back toconn.schemaasservice_namewhen neitherservice_namenorsidis explicitly set in extras. Explicit extras still take precedence.Added three tests covering: schema-as-service-name fallback, service_name precedence over schema, and sid precedence over schema.
Closes: #62526
Was generative AI tooling used to co-author this PR?
Generated-by: Claude Code following the guidelines
{pr_number}.significant.rstor{issue_number}.significant.rst, in airflow-core/newsfragments.