Closed james-whiteside closed 7 months ago
@james-whiteside Actually, you're right that passing a value there works, but the current interface looks wrong (and it's sad that python doesn't help much with checking it). The inner method accepts *role_types: RoleType
as a variable number of arguments, and it can't accept a list: it would convert it to a tuple of lists of values instead of a tuple of values.
I've written a small test which sends a list to this method (not worth pushing), and it highlighted this issue as well:
native_role_types = [rt.native_object for rt in role_types]
AttributeError: 'list' object has no attribute 'native_object'
We have a similar situation with get_players_by_role_type
, but there we have matching interface and implementation contracts: *role_types: _RoleType
.
I believe that there is a bug in the interface, and I'm going to change it to match the implementation contract. Gonna merge it as a part of https://github.com/vaticle/typedb-driver/pull/623.
The connected PR is merged, so the updated API will be a part of the next release.
Description
Thing.get_relations
has the following signature:This is incorrect, as argument
role_types
can also be of typeRoleType
(tested), so the signature should probably be:Environment