in pyqldb/transaction/transaction.py [0:0]
def _to_ion(obj):
"""
Check if the object is of Ion type; if not, convert to Ion.
:raises TypeError in case conversion fails.
"""
if not hasattr(obj, "ion_annotations"):
try:
obj = loads(dumps(obj))
except TypeError:
raise TypeError("Failed to convert parameter to Ion; unsupported data type: %r" % (type(obj)))
return obj