Datatamer / tamr-client

Programmatically interact with Tamr
https://tamr-client.readthedocs.io
Apache License 2.0
11 stars 25 forks source link

Utility for checking operations #462

Closed pcattori closed 4 years ago

pcattori commented 4 years ago

🙋 feature request

Utility function that raises an exception when an operation has failed.

🤔 Expected Behavior

tc.operation.check(op_success) # noop

tc.operation.check(op_fail) # raises exception

😯 Current Behavior

Have to implement a check function in every repo in userland.

💁 Possible Solution

def check(op: tc.Operation):
    if not tc.operation.succeeded(op):
        raise RuntimeError("Operation failed.")
    return op

💻 Examples

See #449