|
6 | 6 |
|
7 | 7 | from contextlib import closing |
8 | 8 | from pathlib import Path |
9 | | -from typing import Literal, TYPE_CHECKING, TypedDict, TypeVar, overload |
| 9 | +from typing import Literal, TYPE_CHECKING, TypeVar, overload |
10 | 10 | from collections.abc import Iterable, Sequence |
11 | 11 |
|
12 | 12 | from tableauserverclient.models.dqw_item import DQWItem |
13 | 13 | from tableauserverclient.server.query import QuerySet |
| 14 | +from tableauserverclient.types import ( |
| 15 | + FilePath, |
| 16 | + FileObject, |
| 17 | + FileObjectR, |
| 18 | + FileObjectW, |
| 19 | + PathOrFile, |
| 20 | + PathOrFileR, |
| 21 | + PathOrFileW, |
| 22 | + HyperAction, |
| 23 | + HyperActionCondition, |
| 24 | + HyperActionRow, |
| 25 | + HyperActionTable, |
| 26 | + AddResponse, |
| 27 | +) |
14 | 28 |
|
15 | 29 | if TYPE_CHECKING: |
16 | 30 | from tableauserverclient.server import Server |
17 | 31 | from tableauserverclient.models import PermissionsRule |
18 | | - from .schedules_endpoint import AddResponse |
19 | 32 |
|
20 | 33 | from tableauserverclient.server.endpoint.dqw_endpoint import _DataQualityWarningEndpoint |
21 | 34 | from tableauserverclient.server.endpoint.endpoint import QuerysetEndpoint, api, parameter_added_in |
|
50 | 63 | io_types_r = (io.BytesIO, io.BufferedReader) |
51 | 64 | io_types_w = (io.BytesIO, io.BufferedWriter) |
52 | 65 |
|
53 | | -FilePath = str | os.PathLike |
54 | | -FileObject = io.BufferedReader | io.BytesIO |
55 | | -PathOrFile = FilePath | FileObject |
56 | | - |
57 | | -FileObjectR = io.BufferedReader | io.BytesIO |
58 | | -FileObjectW = io.BufferedWriter | io.BytesIO |
59 | | -PathOrFileR = FilePath | FileObjectR |
60 | | -PathOrFileW = FilePath | FileObjectW |
61 | | - |
62 | | - |
63 | | -HyperActionCondition = TypedDict( |
64 | | - "HyperActionCondition", |
65 | | - { |
66 | | - "op": str, |
67 | | - "target-col": str, |
68 | | - "source-col": str, |
69 | | - }, |
70 | | -) |
71 | | - |
72 | | -HyperActionRow = TypedDict( |
73 | | - "HyperActionRow", |
74 | | - { |
75 | | - "action": Literal[ |
76 | | - "update", |
77 | | - "upsert", |
78 | | - "delete", |
79 | | - ], |
80 | | - "source-table": str, |
81 | | - "target-table": str, |
82 | | - "condition": HyperActionCondition, |
83 | | - }, |
84 | | -) |
85 | | - |
86 | | -HyperActionTable = TypedDict( |
87 | | - "HyperActionTable", |
88 | | - { |
89 | | - "action": Literal[ |
90 | | - "insert", |
91 | | - "replace", |
92 | | - ], |
93 | | - "source-table": str, |
94 | | - "target-table": str, |
95 | | - }, |
96 | | -) |
97 | | - |
98 | | -HyperAction = HyperActionTable | HyperActionRow |
99 | | - |
100 | 66 |
|
101 | 67 | _UNSET = object() |
102 | 68 |
|
|
0 commit comments