Skip to content

Commit 92119c5

Browse files
committed
formatting, mypy
1 parent 3791e8a commit 92119c5

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

tableauserverclient/models/column_item.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,4 +68,4 @@ def _parse_element(column_xml, ns):
6868
description = column_xml.get("description", None)
6969
remote_type = column_xml.get("remoteType", None)
7070

71-
return id, name, description, remote_type
71+
return id, name, description, remote_type

test/models/test_repr.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
def is_concrete(obj: Any):
1010
return inspect.isclass(obj) and not inspect.isabstract(obj)
1111

12+
1213
@pytest.mark.parametrize("class_name, obj", inspect.getmembers(TSC, is_concrete))
1314
def test_by_reflection(class_name, obj):
1415
instance = try_instantiate_class(class_name, obj)
@@ -22,7 +23,6 @@ def test_by_reflection(class_name, obj):
2223
print(instance.__repr__.__name__)
2324

2425

25-
2626
# Instantiate a class if it doesn't require any parameters
2727
def try_instantiate_class(name: str, obj: Any) -> Any | None:
2828
# Get the constructor (init) of the class

test/test_custom_view.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,7 @@ def test_publish_filepath(server: TSC.Server) -> None:
175175
cv._owner = TSC.UserItem()
176176
cv._owner._id = "dd2239f6-ddf1-4107-981a-4cf94e415794"
177177
cv.workbook = TSC.WorkbookItem()
178+
assert cv.workbook is not None
178179
cv.workbook._id = "1f951daf-4061-451a-9df1-69a8062664f2"
179180
with requests_mock.mock() as m:
180181
m.post(server.custom_views.expurl, status_code=201, text=GET_XML.read_text())
@@ -191,6 +192,7 @@ def test_publish_file_str(server: TSC.Server) -> None:
191192
cv._owner = TSC.UserItem()
192193
cv._owner._id = "dd2239f6-ddf1-4107-981a-4cf94e415794"
193194
cv.workbook = TSC.WorkbookItem()
195+
assert cv.workbook is not None
194196
cv.workbook._id = "1f951daf-4061-451a-9df1-69a8062664f2"
195197
with requests_mock.mock() as m:
196198
m.post(server.custom_views.expurl, status_code=201, text=GET_XML.read_text())
@@ -207,6 +209,7 @@ def test_publish_file_io(server: TSC.Server) -> None:
207209
cv._owner = TSC.UserItem()
208210
cv._owner._id = "dd2239f6-ddf1-4107-981a-4cf94e415794"
209211
cv.workbook = TSC.WorkbookItem()
212+
assert cv.workbook is not None
210213
cv.workbook._id = "1f951daf-4061-451a-9df1-69a8062664f2"
211214
data = io.BytesIO(CUSTOM_VIEW_DOWNLOAD.read_bytes())
212215
with requests_mock.mock() as m:
@@ -223,6 +226,7 @@ def test_publish_missing_owner_id(server: TSC.Server) -> None:
223226
cv = TSC.CustomViewItem(name="test")
224227
cv._owner = TSC.UserItem()
225228
cv.workbook = TSC.WorkbookItem()
229+
assert cv.workbook is not None
226230
cv.workbook._id = "1f951daf-4061-451a-9df1-69a8062664f2"
227231
with requests_mock.mock() as m:
228232
m.post(server.custom_views.expurl, status_code=201, text=GET_XML.read_text())
@@ -244,8 +248,10 @@ def test_publish_missing_wb_id(server: TSC.Server) -> None:
244248
def test_large_publish(server: TSC.Server):
245249
cv = TSC.CustomViewItem(name="test")
246250
cv._owner = TSC.UserItem()
251+
assert cv.workbook is not None
247252
cv._owner._id = "dd2239f6-ddf1-4107-981a-4cf94e415794"
248253
cv.workbook = TSC.WorkbookItem()
254+
assert cv.workbook is not None
249255
cv.workbook._id = "1f951daf-4061-451a-9df1-69a8062664f2"
250256
with ExitStack() as stack:
251257
temp_dir = stack.enter_context(TemporaryDirectory())

0 commit comments

Comments
 (0)