fix(salesforce-data-cloud): don't label getAllMetadata failures as token-exchange errors (YET-1631)#341
Open
benitezfede wants to merge 1 commit into
Open
Conversation
…ken-exchange errors (YET-1631) list_tables wraps both the a360 token exchange and the subsequent getAllMetadata query in one except SalesforceCDPError, labeling all of them 'Token exchange failed for dataspace ... verify the dataspace name and Run-As permission'. That mis-attributes a post-exchange metadata-query failure (token obtained, then e.g. a transient DEADLINE_EXCEEDED) as a token/permission problem, sending triage down the wrong path. Distinguish the two: a metadata-query failure (getAllMetadata / 'executing metadata query' in the message) now raises 'Metadata query failed for dataspace ...' (no permission hint); otherwise keep the token-exchange/permission message. The KeyError (missing access_token) branch is a genuine token-exchange failure and is unchanged. Sibling of data-collector YET-1630. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
What's new?
SalesforceDataCloudProxyClient.list_tableswrapped both the a360 token exchange and the subsequentgetAllMetadataquery in oneexcept SalesforceCDPError, labeling every failureToken exchange failed for dataspace '…' … verify the dataspace name and that the connected app's Run-As user has permission. That mis-attributes a post-exchange metadata-query failure (the token was obtained, then e.g. a transientDEADLINE_EXCEEDED) as a token/permission problem — sending triage to check permissions/dataspace config when the real cause is a transient Salesforce timeout.getAllMetadata/ "executing metadata query" in the error) raisesMetadata query failed for dataspace '…': …(no permission hint); a genuine token-exchange failure keeps the original message. TheKeyError(missingaccess_token) branch is a real token-exchange failure and is unchanged.Related issues and PRs
Testing
test_list_tables_metadata_query_failure_not_labeled_token_exchange: agetAllMetadataSalesforceCDPError(DEADLINE_EXCEEDED) now surfaces as "Metadata query failed", not "Token exchange failed" / "verify the dataspace name".🤖 Generated with Claude Code