Open
Conversation
There was a problem hiding this comment.
Pull request overview
This pull request adds handling for HTTP 409 (Conflict) errors when attempting to refresh a workbook that already has a refresh job queued, preventing duplicate job creation. The change makes the refresh method return None instead of raising an exception when encountering this specific error condition.
Changes:
- Added exception handling in the
workbooks.refresh()method to catch 409 errors indicating duplicate job requests - Created a new test to verify the duplicate refresh handling behavior
- Added a test asset XML file containing the expected 409 error response
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 7 comments.
| File | Description |
|---|---|
| tableauserverclient/server/endpoint/workbooks_endpoint.py | Added try-catch block to handle 409 errors and return None for duplicate refresh requests |
| test/test_workbook.py | Added test case to verify None is returned when a refresh job is already queued |
| test/assets/workbook_refresh_duplicate.xml | Added test fixture containing the 409 error response XML |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
* Initial plan * Update refresh() docstring to document None return type Co-authored-by: jacalata <[email protected]> --------- Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: jacalata <[email protected]>
* Initial plan * Replace print() with logger.warning() for 409 error handling Co-authored-by: jacalata <[email protected]> --------- Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: jacalata <[email protected]>
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.
No description provided.