Some more small fixes
This commit is contained in:
@@ -126,7 +126,7 @@ cdef inline int unpack_row(
|
|||||||
arr = arrays[i]
|
arr = arrays[i]
|
||||||
|
|
||||||
if arr.is_object:
|
if arr.is_object:
|
||||||
deserializer = desc.datatypes[i]
|
deserializer = desc.deserializers[i]
|
||||||
val = deserializer.deserialize(&buf, desc.protocol_version)
|
val = deserializer.deserialize(&buf, desc.protocol_version)
|
||||||
Py_INCREF(val)
|
Py_INCREF(val)
|
||||||
(<PyObject **> arr.buf_ptr)[0] = <PyObject *> val
|
(<PyObject **> arr.buf_ptr)[0] = <PyObject *> val
|
||||||
|
|||||||
@@ -54,12 +54,6 @@ cdef class TupleRowParser(RowParser):
|
|||||||
Parse a single returned row into a tuple of objects:
|
Parse a single returned row into a tuple of objects:
|
||||||
|
|
||||||
(obj1, ..., objN)
|
(obj1, ..., objN)
|
||||||
|
|
||||||
Attributes
|
|
||||||
===========
|
|
||||||
datatypes:
|
|
||||||
this is a memoryview of N DataType objects that can deserialize bytes
|
|
||||||
into objects
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
cpdef unpack_row(self, BytesIOReader reader, ParseDesc desc):
|
cpdef unpack_row(self, BytesIOReader reader, ParseDesc desc):
|
||||||
@@ -73,7 +67,7 @@ cdef class TupleRowParser(RowParser):
|
|||||||
get_buf(reader, &buf)
|
get_buf(reader, &buf)
|
||||||
|
|
||||||
# Deserialize bytes to python object
|
# Deserialize bytes to python object
|
||||||
deserializer = desc.datatypes[i]
|
deserializer = desc.deserializers[i]
|
||||||
val = deserializer.deserialize(&buf, desc.protocol_version)
|
val = deserializer.deserialize(&buf, desc.protocol_version)
|
||||||
|
|
||||||
# Insert new object into tuple
|
# Insert new object into tuple
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ from cassandra.deserializers cimport Deserializer
|
|||||||
cdef class ParseDesc:
|
cdef class ParseDesc:
|
||||||
cdef public object colnames
|
cdef public object colnames
|
||||||
cdef public object coltypes
|
cdef public object coltypes
|
||||||
cdef Deserializer[::1] datatypes
|
cdef Deserializer[::1] deserializers
|
||||||
cdef public object protocol_version
|
cdef public object protocol_version
|
||||||
cdef Py_ssize_t rowsize
|
cdef Py_ssize_t rowsize
|
||||||
|
|
||||||
|
|||||||
@@ -5,10 +5,10 @@ Module containing the definitions and declarations (parsing.pxd) for parsers.
|
|||||||
cdef class ParseDesc:
|
cdef class ParseDesc:
|
||||||
"""Description of what structure to parse"""
|
"""Description of what structure to parse"""
|
||||||
|
|
||||||
def __init__(self, colnames, coltypes, datatypes, protocol_version):
|
def __init__(self, colnames, coltypes, deserializers, protocol_version):
|
||||||
self.colnames = colnames
|
self.colnames = colnames
|
||||||
self.coltypes = coltypes
|
self.coltypes = coltypes
|
||||||
self.datatypes = datatypes
|
self.deserializers = deserializers
|
||||||
self.protocol_version = protocol_version
|
self.protocol_version = protocol_version
|
||||||
self.rowsize = len(colnames)
|
self.rowsize = len(colnames)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user