Skip to content

Commit

Permalink
Don't reject tuple arguments on the client side
Browse files Browse the repository at this point in the history
Right now we reject them on the server side. If that is fixed,
they work fine on the client.
  • Loading branch information
msullivan committed Oct 6, 2022
1 parent e24bb53 commit 69198d7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
5 changes: 4 additions & 1 deletion edgedb/protocol/codecs/array.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,10 @@ cdef class BaseArrayCodec(BaseCodec):
Py_ssize_t objlen
Py_ssize_t i

if not isinstance(self.sub_codec, (ScalarCodec, TupleCodec, RangeCodec)):
if not isinstance(
self.sub_codec,
(ScalarCodec, TupleCodec, NamedTupleCodec, RangeCodec)
):
raise TypeError(
'only arrays of scalars are supported (got type {!r})'.format(
type(self.sub_codec).__name__
Expand Down
5 changes: 3 additions & 2 deletions edgedb/protocol/codecs/base.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -132,15 +132,16 @@ cdef class BaseRecordCodec(BaseCodec):
for codec in self.fields_codecs:
if not isinstance(
codec,
(ScalarCodec, ArrayCodec, EnumCodec, RangeCodec),
(ScalarCodec, ArrayCodec, TupleCodec, NamedTupleCodec,
EnumCodec, RangeCodec),
):
self.encoder_flags |= RECORD_ENCODER_INVALID
break
self.encoder_flags |= RECORD_ENCODER_CHECKED

if self.encoder_flags & RECORD_ENCODER_INVALID:
raise TypeError(
'argument tuples only support scalars and arrays of scalars')
'argument tuples do not support objects')

cdef encode(self, WriteBuffer buf, object obj):
cdef:
Expand Down

0 comments on commit 69198d7

Please sign in to comment.