Skip to content

Commit

Permalink
fix up tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mroeschke committed Nov 15, 2024
1 parent 097decb commit 3133ee1
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 23 deletions.
13 changes: 13 additions & 0 deletions python/pylibcudf/pylibcudf/contiguous_split.pxd
Original file line number Diff line number Diff line change
@@ -1,12 +1,25 @@
# Copyright (c) 2024, NVIDIA CORPORATION.

from libc.stdint cimport uint8_t
from libcpp.memory cimport unique_ptr
from libcpp.vector cimport vector
from pylibcudf.libcudf.contiguous_split cimport packed_columns

from .gpumemoryview cimport gpumemoryview
from .table cimport Table


cdef class HostBuffer:
cdef unique_ptr[vector[uint8_t]] c_obj
cdef size_t nbytes
cdef Py_ssize_t[1] shape
cdef Py_ssize_t[1] strides

@staticmethod
cdef HostBuffer from_unique_ptr(
unique_ptr[vector[uint8_t]] vec
)

cdef class PackedColumns:
cdef unique_ptr[packed_columns] c_obj

Expand Down
4 changes: 0 additions & 4 deletions python/pylibcudf/pylibcudf/contiguous_split.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,6 @@ __all__ = [

cdef class HostBuffer:
"""Owning host buffer that implements the buffer protocol"""
cdef unique_ptr[vector[uint8_t]] c_obj
cdef size_t nbytes
cdef Py_ssize_t[1] shape
cdef Py_ssize_t[1] strides

@staticmethod
cdef HostBuffer from_unique_ptr(
Expand Down
3 changes: 0 additions & 3 deletions python/pylibcudf/pylibcudf/io/parquet.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,6 @@ cpdef read_parquet(
cdef class ParquetWriterOptions:
cdef parquet_writer_options c_obj

@staticmethod
cdef ParquetWriterOptionsBuilder builder(SinkInfo sink, Table table)

cpdef void set_partitions(self, list partitions)

cpdef void set_column_chunks_file_paths(self, list file_paths)
Expand Down
6 changes: 3 additions & 3 deletions python/pylibcudf/pylibcudf/io/parquet.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ cpdef read_parquet(
cdef class ParquetWriterOptions:

@staticmethod
cdef ParquetWriterOptionsBuilder builder(SinkInfo sink, Table table):
def builder(SinkInfo sink, Table table):
"""
Create builder to create ParquetWriterOptionsBuilder.
Expand Down Expand Up @@ -287,9 +287,9 @@ cdef class ParquetWriterOptions:
cdef vector[partition_info] c_partions
cdef PartitionInfo partition

c_obj.reserve(len(partitions))
c_partions.reserve(len(partitions))
for partition in partitions:
c_obj.push_back(partition.c_obj)
c_partions.push_back(partition.c_obj)

self.c_obj.set_partitions(c_partions)

Expand Down
4 changes: 0 additions & 4 deletions python/pylibcudf/pylibcudf/io/types.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,6 @@ from pylibcudf.table cimport Table
cdef class PartitionInfo:
cdef partition_info c_obj

@staticmethod
cdef PartitionInfo from_start_and_num(int start_row, int num_rows)

cdef class ColumnInMetadata:
cdef column_in_metadata c_obj

Expand Down Expand Up @@ -59,7 +56,6 @@ cdef class ColumnInMetadata:
cpdef str get_name(self)

cdef class TableInputMetadata:
cdef public Table table
cdef table_input_metadata c_obj

cdef class TableWithMetadata:
Expand Down
6 changes: 1 addition & 5 deletions python/pylibcudf/pylibcudf/io/types.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ cdef class PartitionInfo:
num_rows : int
The number of rows in the partition.
"""
def __init__(int start_row, int num_rows):
def __init__(self, int start_row, int num_rows):
self.c_obj = partition_info(start_row, num_rows)


Expand Down Expand Up @@ -265,10 +265,6 @@ cdef class TableInputMetadata:
"""
def __init__(self, Table table):
self.c_obj = table_input_metadata(table.view())
self.column_metadata = [
ColumnInMetadata.from_metadata(metadata)
for metadata in self.c_obj.column_metadata
]


cdef class TableWithMetadata:
Expand Down
5 changes: 1 addition & 4 deletions python/pylibcudf/pylibcudf/tests/io/test_parquet.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,6 @@ def test_read_parquet_filters(
plc.io.types.StatisticsFreq.STATISTICS_COLUMN,
],
)
@pytest.mark.parametrize("int96_timestamps", [True, False])
@pytest.mark.parametrize("write_v2_headers", [True, False])
@pytest.mark.parametrize(
"dictionary_policy",
Expand All @@ -150,7 +149,6 @@ def test_write_parquet(
table_data,
compression,
stats_level,
int96_timestamps,
write_v2_headers,
dictionary_policy,
utc_timestamps,
Expand All @@ -174,7 +172,6 @@ def test_write_parquet(
.key_value_metadata(user_data)
.compression(compression)
.stats_level(stats_level)
.int96_timestamps(int96_timestamps)
.write_v2_headers(write_v2_headers)
.dictionary_policy(dictionary_policy)
.utc_timestamps(utc_timestamps)
Expand All @@ -197,4 +194,4 @@ def test_write_parquet(
options.set_max_dictionary_size(max_dictionary_size)

result = plc.io.parquet.write_parquet(options)
assert isinstance(result, plc.io.parquet.BufferArrayFromVector)
assert isinstance(result, plc.contiguous_split.HostBuffer)

0 comments on commit 3133ee1

Please sign in to comment.