Skip to content

Commit

Permalink
Tweak wording in query_single() error messages (#369)
Browse files Browse the repository at this point in the history
There is a potential confusion between being a "multi set" (a set with
multi cardinality) and a "multiset" (a set that can contain
duplicates). Reword to avoid this.
  • Loading branch information
msullivan committed Sep 30, 2022
1 parent b11b991 commit e24bb53
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion edgedb/protocol/protocol.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -1255,7 +1255,7 @@ cdef class SansIOProtocol:
methname = _QUERY_SINGLE_METHOD[required_one][output_format]
new_exc = errors.InterfaceError(
f'query cannot be executed with {methname}() as it '
f'returns a multiset')
f'may return more than one element')
new_exc.__cause__ = exc
exc = new_exc

Expand Down
6 changes: 4 additions & 2 deletions tests/test_async_query.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,12 +241,14 @@ async def test_async_basic_datatypes_01(self):

with self.assertRaisesRegex(
edgedb.InterfaceError,
r'query_single\(\) as it returns a multiset'):
r'query_single\(\) as it may return more than one element'
):
await self.client.query_single('SELECT {1, 2}')

with self.assertRaisesRegex(
edgedb.InterfaceError,
r'query_required_single\(\) as it returns a multiset'):
r'query_required_single\(\) as it may return '
r'more than one element'):
await self.client.query_required_single('SELECT {1, 2}')

with self.assertRaisesRegex(
Expand Down

0 comments on commit e24bb53

Please sign in to comment.