-
Notifications
You must be signed in to change notification settings - Fork 447
#1090 add check for 409 error code #1733
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: development
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Initial plan * Update refresh() docstring to document None return type Co-authored-by: jacalata <2009720+jacalata@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: jacalata <2009720+jacalata@users.noreply.github.com>
* Initial plan * Replace print() with logger.warning() for 409 error handling Co-authored-by: jacalata <2009720+jacalata@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: jacalata <2009720+jacalata@users.noreply.github.com>
No description provided.