Repository navigation
Support per-row path in named_credential_request_col - #158
Merged
Merged
Conversation
Add an optional url Column to named_credential_request_col / SparkNamedCredential.request_col so each row can call a different endpoint (e.g. per-entity REST GET lookups). A null row value falls back to request.url; omitting url keeps the existing expression unchanged.
Rows may only select an endpoint under the template's Named Credential: the path is appended to request.url, with '/' inserted unless it starts with '/' or '?', so a row can never change the Named Credential name. A null or empty path uses request.url.
diksha-sf
approved these changes
Oct 9, 2026
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.
Summary
named_credential_request_colcould only vary the request body per row; the url came from theHTTPRequesttemplate and was the same for every row. This adds an optional per-rowpathColumn that is appended torequest.url, so each row can target a different endpoint of the same Named Credential (e.g. pick a model, per-entityGETlookups, geocoding):Join rule (rows can never switch Named Credential):
/or?→ appended as is:callout:gemini+/v1→callout:gemini/v1;+ ?k=a→callout:gemini?k=a/:callout:gemini+2/v1→callout:gemini/2/v1(notcallout:gemini2/v1)request.urlpathomitted → exactly the previous behavior.named_credential_request_colonly forwardspathwhen given, soSparkNamedCredentialimplementations that don't accept it yet keep working for existing callers.Changes
SparkNamedCredential.request_col: new optionalpathkeyword; docstrings updated.DefaultSparkNamedCredential.request_col(local dev): withpath, the UDF is applied over(body, path); each row uses a copy of the template whose url isjoin_callout_path(request.url, path).named_credential_request_col: new optionalpathargument.Lint fixescommit:make lintcurrently fails onmain(pretty-format-tomlonpyproject.toml,blackontests/spark/test_column_hints_deferred.py). Formatting only; the reformattedpyproject.tomlparses to identical data.The Data Cloud runtime's built-in
named_credential_calloutUDF already takes the url per row, so no server-side change is needed; the runtime-side join lives in the internal SDK with the same rule.Testing
2/v1,@evil.example.com), null/empty fallback, path without body. Full suite: 625 passed.pre-commit run --all-files --hook-stage manual(same asmake lint): all hooks pass./gemini-2.5-pro,?key=a,2/v1,@evil.example.com,"",NULL: urls joined as above, empty/null fall back tocallout:gemini, omittingpathis unchanged.