Skip to content

Commit 692b54f

Browse files
jacalataclaude
andcommitted
feat: expose JobFailedException and JobCancelledException at the top level
Both were previously reachable only via `tableauserverclient.server.endpoint.exceptions`, which is an internal module path. Callers waiting on a background job with `server.jobs.wait_for_job()` need to catch these to distinguish a failed job from a cancelled one (JobCancelledException is a subclass of JobFailedException, so the order in an except-chain matters), and reaching into a `server.endpoint` sub-package to do so is a bad pattern to teach. Re-export them alongside the other exception types already exposed at the top level (FailedSignInError, MissingRequiredFieldError, NotSignedInError, ServerResponseError). Existing internal imports in tests and endpoints remain unchanged; this is purely additive. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent dba5cd1 commit 692b54f

2 files changed

Lines changed: 12 additions & 1 deletion

File tree

tableauserverclient/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@
6767
RequestOptions,
6868
MissingRequiredFieldError,
6969
FailedSignInError,
70+
JobCancelledException,
71+
JobFailedException,
7072
NotSignedInError,
7173
ServerResponseError,
7274
Filter,
@@ -105,6 +107,8 @@
105107
"HourlyInterval",
106108
"ImageRequestOptions",
107109
"IntervalItem",
110+
"JobCancelledException",
111+
"JobFailedException",
108112
"JobItem",
109113
"JWTAuth",
110114
"LinkedTaskFlowRunItem",

tableauserverclient/server/__init__.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,12 @@
1212
from tableauserverclient.server.sort import Sort
1313
from tableauserverclient.server.server import Server
1414
from tableauserverclient.server.pager import Pager
15-
from tableauserverclient.server.endpoint.exceptions import FailedSignInError, NotSignedInError
15+
from tableauserverclient.server.endpoint.exceptions import (
16+
FailedSignInError,
17+
JobCancelledException,
18+
JobFailedException,
19+
NotSignedInError,
20+
)
1621

1722
from tableauserverclient.server.endpoint import (
1823
Auth,
@@ -60,6 +65,8 @@
6065
"Server",
6166
"Pager",
6267
"FailedSignInError",
68+
"JobCancelledException",
69+
"JobFailedException",
6370
"NotSignedInError",
6471
"Auth",
6572
"CustomViews",

0 commit comments

Comments
 (0)