-
Notifications
You must be signed in to change notification settings - Fork 914
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Avro Reader options classes to pylibcudf (#17599)
Apart of #17565 Authors: - Matthew Murray (https://github.com/Matt711) Approvers: - Matthew Roeschke (https://github.com/mroeschke) URL: #17599
- Loading branch information
Showing
5 changed files
with
173 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,23 @@ | ||
# Copyright (c) 2024, NVIDIA CORPORATION. | ||
from pylibcudf.io.types cimport SourceInfo, TableWithMetadata | ||
from pylibcudf.libcudf.io.avro cimport avro_reader_options | ||
from pylibcudf.libcudf.io.avro cimport avro_reader_options, avro_reader_options_builder | ||
from pylibcudf.libcudf.types cimport size_type | ||
|
||
|
||
cpdef TableWithMetadata read_avro( | ||
SourceInfo source_info, | ||
list columns = *, | ||
size_type skip_rows = *, | ||
size_type num_rows = * | ||
) | ||
from pylibcudf.libcudf.types cimport size_type | ||
|
||
cdef class AvroReaderOptions: | ||
cdef avro_reader_options c_obj | ||
cdef SourceInfo source | ||
cpdef void set_columns(self, list col_names) | ||
|
||
|
||
cdef class AvroReaderOptionsBuilder: | ||
cdef avro_reader_options_builder c_obj | ||
cdef SourceInfo source | ||
cpdef AvroReaderOptionsBuilder columns(self, list col_names) | ||
cpdef AvroReaderOptionsBuilder skip_rows(self, size_type skip_rows) | ||
cpdef AvroReaderOptionsBuilder num_rows(self, size_type num_rows) | ||
cpdef AvroReaderOptions build(self) | ||
|
||
cpdef TableWithMetadata read_avro(AvroReaderOptions options) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,16 @@ | ||
# Copyright (c) 2024, NVIDIA CORPORATION. | ||
from pylibcudf.io.types import SourceInfo, TableWithMetadata | ||
|
||
__all__ = ["read_avro"] | ||
|
||
def read_avro( | ||
source_info: SourceInfo, | ||
columns: list[str] | None = None, | ||
skip_rows: int = 0, | ||
num_rows: int = -1, | ||
) -> TableWithMetadata: ... | ||
__all__ = ["AvroReaderOptions", "AvroReaderOptionsBuilder", "read_avro"] | ||
|
||
class AvroReaderOptions: | ||
@staticmethod | ||
def builder(source: SourceInfo) -> AvroReaderOptionsBuilder: ... | ||
|
||
class AvroReaderOptionsBuilder: | ||
def columns(col_names: list[str]) -> AvroReaderOptionsBuilder: ... | ||
def skip_rows(skip_rows: int) -> AvroReaderOptionsBuilder: ... | ||
def num_rows(num_rows: int) -> AvroReaderOptionsBuilder: ... | ||
def build(self) -> AvroReaderOptions: ... | ||
|
||
def read_avro(options: AvroReaderOptions) -> TableWithMetadata: ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters