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

Add CSV Reader options classes to pylibcudf #17412

Merged
merged 11 commits into from
Nov 27, 2024

Conversation

Matt711
Copy link
Contributor

@Matt711 Matt711 commented Nov 22, 2024

Description

This PR adds the CSV reader options classes to pylibcudf and plumbs the changes through cudf python.

Checklist

  • I am familiar with the Contributing Guidelines.
  • New or existing tests cover these changes.
  • The documentation is up to date with these changes.

@Matt711 Matt711 added feature request New feature or request non-breaking Non-breaking change labels Nov 22, 2024
@github-actions github-actions bot added Python Affects Python cuDF API. pylibcudf Issues specific to the pylibcudf package labels Nov 22, 2024
@github-actions github-actions bot added the cudf.polars Issues specific to cudf.polars label Nov 25, 2024
@Matt711 Matt711 marked this pull request as ready for review November 25, 2024 20:34
@Matt711 Matt711 requested a review from a team as a code owner November 25, 2024 20:34
options.set_prefix(prefix)

if usecols is not None:
if all([isinstance(col, int) for col in usecols]):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if all([isinstance(col, int) for col in usecols]):
if all(isinstance(col, int) for col in usecols):

@@ -54,7 +96,7 @@ def read_csv(
# detect_whitespace_around_quotes: bool = False,
# timestamp_type: DataType = DataType(type_id.EMPTY),
) -> TableWithMetadata: ...
def write_csv(options: CsvWriterOptionsBuilder) -> None: ...
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was this annotation incorrect before?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No I don't think so. I wanted to stay consistent because I noticed we dropped the None in other PRs.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah I see. IMO we should still include None as the output type cc @wence-

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll follow up based on what we decide

@@ -1,6 +1,7 @@
# Copyright (c) 2024, NVIDIA CORPORATION.

from collections.abc import Mapping
from typing import Self
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since cudf still supports Python 3.10, we'll need to import this from typing_extensions

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, done

Copy link
Contributor

@mroeschke mroeschke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The None annotation question is non-blocking for me

@Matt711
Copy link
Contributor Author

Matt711 commented Nov 27, 2024

/merge

@rapids-bot rapids-bot bot merged commit 4533085 into rapidsai:branch-25.02 Nov 27, 2024
104 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cudf.polars Issues specific to cudf.polars feature request New feature or request non-breaking Non-breaking change pylibcudf Issues specific to the pylibcudf package Python Affects Python cuDF API.
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants