Skip to content

Commit ae3304b

Browse files
committed
adding type checking for updating existing functions
1 parent e703c95 commit ae3304b

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

tabpy/tabpy_tools/client.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -300,10 +300,22 @@ def update(self, name, description=None, schema=None, is_public=None):
300300
)
301301

302302
if description is not None:
303+
if type(description) is not str:
304+
raise RuntimeError(
305+
f"Type of description must be string"
306+
)
303307
endpoint.description = description
304308
if schema is not None:
309+
if type(schema) is not dict:
310+
raise RuntimeError(
311+
f"Type of schema must be dictionary"
312+
)
305313
endpoint.schema = schema
306314
if is_public is not None:
315+
if type(is_public) is not bool:
316+
raise RuntimeError(
317+
f"Type of is_public must be bool"
318+
)
307319
endpoint.is_public = is_public
308320

309321
dest_path = self._get_endpoint_upload_destination()

0 commit comments

Comments
 (0)