Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Start migrating I/O writers to pylibcudf (starting with JSON) #15952

Merged
merged 38 commits into from
Jul 2, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
591cdd2
Start migrating I/O writers to pylibcudf (starting with JSON)
lithomas1 Jun 6, 2024
15daaaa
update docs
lithomas1 Jun 7, 2024
72204f1
Merge branch 'branch-24.08' of github.com:rapidsai/cudf into pylibcud…
lithomas1 Jun 7, 2024
c24664c
update and start writing tests
lithomas1 Jun 7, 2024
8c88c7c
Merge branch 'branch-24.08' of github.com:rapidsai/cudf into pylibcud…
lithomas1 Jun 11, 2024
2b3853f
add some tests
lithomas1 Jun 11, 2024
cd6df5e
Merge branch 'branch-24.08' of github.com:rapidsai/cudf into pylibcud…
lithomas1 Jun 11, 2024
c54316e
update
lithomas1 Jun 11, 2024
dc93356
Merge branch 'branch-24.08' of github.com:rapidsai/cudf into pylibcud…
lithomas1 Jun 12, 2024
8c4c4e4
address comments
lithomas1 Jun 12, 2024
63358e9
Merge branch 'branch-24.08' of github.com:rapidsai/cudf into pylibcud…
lithomas1 Jun 12, 2024
9150a6c
try something else
lithomas1 Jun 12, 2024
b1951d0
try fix
lithomas1 Jun 13, 2024
1228569
update following feedback
lithomas1 Jun 13, 2024
699efd3
cleanup tests
lithomas1 Jun 13, 2024
e242182
address more comments
lithomas1 Jun 13, 2024
564358f
Merge branch 'branch-24.08' into pylibcudf-io-writers
lithomas1 Jun 17, 2024
e0901dd
fix bad merge
lithomas1 Jun 17, 2024
d22953f
Merge branch 'branch-24.08' into pylibcudf-io-writers
lithomas1 Jun 18, 2024
604c16d
address more comments
lithomas1 Jun 24, 2024
e6c3ec7
address more comments
lithomas1 Jun 24, 2024
624d444
fix all nested struct cases
lithomas1 Jun 24, 2024
53b821c
Merge branch 'pylibcudf-io-writers' of github.com:lithomas1/cudf into…
lithomas1 Jun 24, 2024
186a2fb
Merge branch 'branch-24.08' of github.com:rapidsai/cudf into pylibcud…
lithomas1 Jun 24, 2024
9a6a896
Merge branch 'branch-24.08' of github.com:rapidsai/cudf into pylibcud…
lithomas1 Jun 25, 2024
0ed9af6
Fix error in testing utils
lithomas1 Jun 25, 2024
aff6178
small test fixes
lithomas1 Jun 25, 2024
f7cd9e6
cleanup utils
lithomas1 Jun 26, 2024
c5a3fbe
Merge branch 'branch-24.08' of github.com:rapidsai/cudf into pylibcud…
lithomas1 Jun 27, 2024
79c1dfd
clean source_or_sink
lithomas1 Jun 27, 2024
8fc139f
Merge branch 'pylibcudf-io-writers' of github.com:lithomas1/cudf into…
lithomas1 Jun 27, 2024
e940e30
Address code review
lithomas1 Jun 27, 2024
e57a677
Merge branch 'branch-24.08' of github.com:rapidsai/cudf into pylibcud…
lithomas1 Jun 29, 2024
7806ce4
simplify again
lithomas1 Jun 29, 2024
25c25d4
Merge branch 'branch-24.08' of github.com:rapidsai/cudf into pylibcud…
lithomas1 Jul 1, 2024
60287e1
address more comments
lithomas1 Jul 1, 2024
205c32c
Update python/cudf/cudf/_lib/pylibcudf/io/types.pyx
vyasr Jul 2, 2024
d325b64
Merge branch 'branch-24.08' into pylibcudf-io-writers
vyasr Jul 2, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Merge branch 'branch-24.08' of github.com:rapidsai/cudf into pylibcud…
…f-io-writers
  • Loading branch information
lithomas1 committed Jun 25, 2024
commit 9a6a8962e843f11a029a9a6e2b2c958c774fc48c
6 changes: 4 additions & 2 deletions python/cudf/cudf/_lib/pylibcudf/io/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# the License.
# =============================================================================

set(cython_sources avro.pyx json.pyx types.pyx)
set(cython_sources avro.pyx datasource.pyx json.pyx types.pyx)

set(linked_libraries cudf::cudf)
rapids_cython_create_modules(
Expand All @@ -21,5 +21,7 @@ rapids_cython_create_modules(
LINKED_LIBRARIES "${linked_libraries}" MODULE_PREFIX pylibcudf_io_ ASSOCIATED_TARGETS cudf
)

set(targets_using_arrow_headers pylibcudf_io_avro pylibcudf_io_json pylibcudf_io_types)
set(targets_using_arrow_headers pylibcudf_io_avro pylibcudf_io_datasource pylibcudf_io_json
pylibcudf_io_types
)
link_to_pyarrow_headers("${targets_using_arrow_headers}")
4 changes: 2 additions & 2 deletions python/cudf/cudf/_lib/pylibcudf/io/__init__.pxd
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2024, NVIDIA CORPORATION.

from . cimport avro, json, types
from .types cimport SinkInfo, SourceInfo, TableWithMetadata
from . cimport avro, datasource, json, types
from .types cimport SourceInfo, TableWithMetadata
2 changes: 1 addition & 1 deletion python/cudf/cudf/_lib/pylibcudf/io/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2024, NVIDIA CORPORATION.

from . import avro, json, types
from . import avro, datasource, json, types
from .types import SinkInfo, SourceInfo, TableWithMetadata
2 changes: 2 additions & 0 deletions python/cudf/cudf/_lib/pylibcudf/io/types.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ from libcpp.string cimport string
from libcpp.utility cimport move
from libcpp.vector cimport vector

from cudf._lib.pylibcudf.io.datasource cimport Datasource
from cudf._lib.pylibcudf.libcudf.io.data_sink cimport data_sink
from cudf._lib.pylibcudf.libcudf.io.datasource cimport datasource
from cudf._lib.pylibcudf.libcudf.io.types cimport (
column_name_info,
host_buffer,
Expand Down
25 changes: 19 additions & 6 deletions python/cudf/cudf/pylibcudf_tests/io/test_source_sink_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,16 @@ def io_class(request):
return request.param


def _skip_invalid_sinks(io_class, sink):
"""
Skip invalid sinks for SinkInfo
"""
if io_class is plc.io.SinkInfo and isinstance(
sink, (bytes, NativeFileDatasource)
):
pytest.skip(f"{sink} is not a valid input for SinkInfo")


@pytest.mark.parametrize(
"source",
[
Expand All @@ -29,8 +39,7 @@ def test_source_info_ctor(io_class, source, tmp_path):
file.write_bytes("hello world".encode("utf-8"))
source = str(file)

if io_class is plc.io.SinkInfo and isinstance(source, bytes):
pytest.skip("bytes is not a valid input for SinkInfo")
_skip_invalid_sinks(source)

io_class([source])

Expand All @@ -54,8 +63,8 @@ def test_source_info_ctor_multiple(io_class, sources, tmp_path):
file = tmp_path / source
file.write_bytes("hello world".encode("utf-8"))
sources[i] = str(file)
elif io_class is plc.io.SinkInfo and isinstance(source, bytes):
pytest.skip("bytes is not a valid input for SinkInfo")

_skip_invalid_sinks(source)

io_class(sources)

Expand Down Expand Up @@ -86,7 +95,11 @@ def test_source_info_ctor_mixing_invalid(io_class, sources, tmp_path):
file = tmp_path / source
file.write_bytes("hello world".encode("utf-8"))
sources[i] = str(file)
elif io_class is plc.io.SinkInfo and isinstance(source, bytes):
pytest.skip("bytes is not a valid input for SinkInfo")
_skip_invalid_sinks(source)
with pytest.raises(ValueError):
io_class(sources)


def test_source_info_invalid():
with pytest.raises(ValueError):
plc.io.SourceInfo([123])
You are viewing a condensed version of this merge commit. You can view the full changes here.