Skip to content

Commit

Permalink
Remove unused BufferArrayFromVector
Browse files Browse the repository at this point in the history
  • Loading branch information
Matt711 committed Dec 7, 2024
1 parent 169a45a commit 76b590a
Showing 1 changed file with 1 addition and 45 deletions.
46 changes: 1 addition & 45 deletions python/cudf/cudf/_lib/parquet.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,8 @@ from cudf._lib.utils cimport _data_from_columns, data_from_pylibcudf_io

from cudf._lib.utils import _index_level_name, generate_pandas_metadata

from libc.stdint cimport int64_t, uint8_t
from libc.stdint cimport int64_t
from libcpp cimport bool
from libcpp.memory cimport unique_ptr
from libcpp.utility cimport move
from libcpp.vector cimport vector

from pylibcudf.expressions cimport Expression
from pylibcudf.io.parquet cimport ChunkedParquetReader
Expand All @@ -47,47 +44,6 @@ from pylibcudf cimport Table
from cudf.utils.ioutils import _ROW_GROUP_SIZE_BYTES_DEFAULT
from pylibcudf.io.types cimport TableInputMetadata, SinkInfo, ColumnInMetadata
from pylibcudf.io.parquet cimport ParquetChunkedWriter
from cython.operator cimport dereference


cdef class BufferArrayFromVector:
cdef Py_ssize_t length
cdef unique_ptr[vector[uint8_t]] in_vec

# these two things declare part of the buffer interface
cdef Py_ssize_t shape[1]
cdef Py_ssize_t strides[1]

@staticmethod
cdef BufferArrayFromVector from_unique_ptr(
unique_ptr[vector[uint8_t]] in_vec
):
cdef BufferArrayFromVector buf = BufferArrayFromVector()
buf.in_vec = move(in_vec)
buf.length = dereference(buf.in_vec).size()
return buf

def __getbuffer__(self, Py_buffer *buffer, int flags):
cdef Py_ssize_t itemsize = sizeof(uint8_t)

self.shape[0] = self.length
self.strides[0] = 1

buffer.buf = dereference(self.in_vec).data()

buffer.format = NULL # byte
buffer.internal = NULL
buffer.itemsize = itemsize
buffer.len = self.length * itemsize # product(shape) * itemsize
buffer.ndim = 1
buffer.obj = self
buffer.readonly = 0
buffer.shape = self.shape
buffer.strides = self.strides
buffer.suboffsets = NULL

def __releasebuffer__(self, Py_buffer *buffer):
pass


def _parse_metadata(meta):
Expand Down

0 comments on commit 76b590a

Please sign in to comment.