Changes for unauth stream exclude in discovery - #64
Open
atttiwari wants to merge 2 commits into
Open
Conversation
There was a problem hiding this comment.
Pull request overview
This PR changes tap discovery behavior to skip streams that are inaccessible due to authorization (HTTP 403) rather than failing discovery, while still failing with an AuthorizationError if no streams are accessible.
Changes:
- Added per-stream access probing (
check_access) and discovery-time pruning of inaccessible streams (plus child-stream pruning). - Updated CLI behavior to surface
AuthorizationErrordistinctly fromAuthenticationError. - Added/adjusted unit tests and updated dependency pins + changelog entry.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/unittests/test_tap_braintree.py | Adds tests around do_discover() and main() authentication/authorization error handling. |
| tests/unittests/test_discovery.py | Adds unit tests covering access checks, child pruning, and discovery outcomes. |
| tap_braintree/streams.py | Introduces check_access() to probe stream read permissions and treat 403 as inaccessible. |
| tap_braintree/discover.py | Adds discovery-time filtering of inaccessible streams and raises AuthorizationError when none are accessible. |
| tap_braintree/init.py | Adjusts do_discover() exception behavior and adds AuthorizationError handling in main(). |
| setup.py | Updates pinned versions for singer-python and requests. |
| CHANGELOG.md | Documents the new “exclude forbidden streams during discovery” behavior and test additions. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+61
to
+62
| """Run the discovery mode, prepare the catalog file and return the | ||
| catalog.""" | ||
| catalog. Streams the credentials cannot read are excluded from the catalog.""" |
Comment on lines
70
to
71
| if __name__ == '__main__': | ||
| unittest.main() |
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 of change
This PR changes tap discovery behavior to skip streams that are inaccessible due to authorization (HTTP 403) rather than failing discovery, while still failing with an AuthorizationError if no streams are accessible.
Changes:
Manual QA steps
Risks
Rollback steps
AI generated code
https://internal.qlik.dev/general/ways-of-working/code-reviews/#guidelines-for-ai-generated-code