Skip to content

Commit a3663ee

Browse files
jacalataclaude
andcommitted
Also expose FlowRunFailedException and FlowRunCancelledException at top level
Same shape and same private-path problem as the Job exceptions this PR is already fixing. flow_runs.wait_for_flow_run() raises these; users need to catch them without importing from server.endpoint.exceptions. Add regression tests for both pairs so a future refactor of __init__.py can't silently break the public surface. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 692b54f commit a3663ee

3 files changed

Lines changed: 24 additions & 0 deletions

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+
FlowRunCancelledException,
71+
FlowRunFailedException,
7072
JobCancelledException,
7173
JobFailedException,
7274
NotSignedInError,
@@ -100,6 +102,8 @@
100102
"FileuploadItem",
101103
"Filter",
102104
"FlowItem",
105+
"FlowRunCancelledException",
106+
"FlowRunFailedException",
103107
"FlowRunItem",
104108
"get_versions",
105109
"GroupItem",

‎tableauserverclient/server/__init__.py‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
from tableauserverclient.server.pager import Pager
1515
from tableauserverclient.server.endpoint.exceptions import (
1616
FailedSignInError,
17+
FlowRunCancelledException,
18+
FlowRunFailedException,
1719
JobCancelledException,
1820
JobFailedException,
1921
NotSignedInError,
@@ -65,6 +67,8 @@
6567
"Server",
6668
"Pager",
6769
"FailedSignInError",
70+
"FlowRunCancelledException",
71+
"FlowRunFailedException",
6872
"JobCancelledException",
6973
"JobFailedException",
7074
"NotSignedInError",

‎test/test_import_surface.py‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import tableauserverclient as TSC
2+
from tableauserverclient.server.endpoint import exceptions
3+
4+
5+
def test_job_exceptions_at_top_level():
6+
assert TSC.JobFailedException is exceptions.JobFailedException
7+
assert TSC.JobCancelledException is exceptions.JobCancelledException
8+
assert "JobFailedException" in TSC.__all__
9+
assert "JobCancelledException" in TSC.__all__
10+
11+
12+
def test_flow_run_exceptions_at_top_level():
13+
assert TSC.FlowRunFailedException is exceptions.FlowRunFailedException
14+
assert TSC.FlowRunCancelledException is exceptions.FlowRunCancelledException
15+
assert "FlowRunFailedException" in TSC.__all__
16+
assert "FlowRunCancelledException" in TSC.__all__

0 commit comments

Comments
 (0)