Skip to content

Commit

Permalink
Merge pull request #172 from DLHub-Argonne/167-change-validate_input-…
Browse files Browse the repository at this point in the history
…behavior-for-type-python-object

immediate patch for "Python object" validation errors
  • Loading branch information
ascourtas committed Oct 14, 2022
2 parents 3b08006 + 94397ea commit 6f8c2d4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion dlhub_sdk/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ def describe_methods(self, name, method=None):
return get_method_details(metadata, method)

def run(self, name: str, inputs: Any, parameters: Optional[Dict[str, Any]] = None,
asynchronous: bool = False, debug: bool = False, validate_input: bool = True,
asynchronous: bool = False, debug: bool = False, validate_input: bool = False,
async_wait: float = 5, timeout: Optional[float] = None)\
-> Union[
DLHubFuture,
Expand Down
5 changes: 5 additions & 0 deletions dlhub_sdk/tests/test_dlhub_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,11 @@ def test_run(dl):
# res[0] contains model results, res[1] contains event data JSON
assert res == 'Hello world!'

# Do the same thing with input validation
res = dl.run("{}/{}".format(user, name), data, timeout=60, validate_input=True)
# res[0] contains model results, res[1] contains event data JSON
assert res == 'Hello world!'

# Do the same thing with debug mode
res = dl.run("{}/{}".format(user, name), data, timeout=60, debug=True)
# res[0] contains model results, res[1] contains event data JSON
Expand Down

0 comments on commit 6f8c2d4

Please sign in to comment.