When I tried to add an integer (or float) value as metadata avu, I got a different error than how the set method returns the error in that case. The reason looks like because of the check for possible empty argument(s) in the add method.
the prc snippet:
from irods.test.helpers import make_session
from irods.meta import iRODSMeta
s = make_session()
target = s.collections.get("/u0137480/home/rods/colA")
meta_set = iRODSMeta("abc", 2, "units")
meta_add = iRODSMeta("abcd", 3, "units")
print("set exception:")
try:
target.metadata.set(meta_set)
except Exception as e:
print(e)
print("\nadd exception:")
try:
target.metadata.add(meta_add)
except Exception as e:
print(e)
exceptions that I catch:
[irods@dev-u0137480 irods]$ python3 test.py
set exception:
AVU value (2) has incorrect type. AVU fields must be strings, except for units, which could be None.
add exception:
object of type 'int' has no len()
To be able to see the consistent same errors like here for both methods, I can make a pr. Thanks.
When I tried to add an integer (or float) value as metadata avu, I got a different error than how the set method returns the error in that case. The reason looks like because of the check for possible empty argument(s) in the add method.
the prc snippet:
exceptions that I catch:
To be able to see the consistent same errors like here for both methods, I can make a pr. Thanks.