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

Fix bug in dask_cudf.read_parquet for index=False #9453

Merged
merged 1 commit into from Oct 15, 2021

Conversation

rjzamora
Copy link
Member

Simple fix for case that index=False in dask_cudf.read_parquet (the default/general case in NVTabular).

@rjzamora rjzamora added bug Something isn't working 3 - Ready for Review Ready for review by team dask Dask issue non-breaking Non-breaking change labels Oct 15, 2021
@rjzamora rjzamora self-assigned this Oct 15, 2021
@rjzamora rjzamora requested a review from a team as a code owner October 15, 2021 18:05
@github-actions github-actions bot added the cuDF (Python) Affects Python cuDF API. label Oct 15, 2021
Comment on lines +90 to +97
tmpdir = str(tmpdir)
path = os.path.join(tmpdir, "test.parquet")

df2 = ddf.reset_index(drop=True).compute()
df2.to_parquet(path, engine="pyarrow")

ddf3 = dask_cudf.read_parquet(path, index=False)
dd.assert_eq(df2, ddf3)
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
tmpdir = str(tmpdir)
path = os.path.join(tmpdir, "test.parquet")
df2 = ddf.reset_index(drop=True).compute()
df2.to_parquet(path, engine="pyarrow")
ddf3 = dask_cudf.read_parquet(path, index=False)
dd.assert_eq(df2, ddf3)
bytes_buf = BytesIO()
df2 = ddf.reset_index(drop=True).compute()
df2.to_parquet(bytes_buf, engine="pyarrow")
ddf3 = dask_cudf.read_parquet(bytes_buf, index=False)
dd.assert_eq(df2, ddf3)

Can we use BytesIO instead of interacting with Filesystem?

Copy link
Member Author

Choose a reason for hiding this comment

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

Ooo - I like your thinking here, but we cannot pass a BytesIO object to dask_cudf.read_parquet without making some much larger changes :)

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. I thought dask_cudf.read_parquet accepts Bytes like object similar to pyarrow/cudf/pandas. Then lets not do it now.

@codecov
Copy link

codecov bot commented Oct 15, 2021

Codecov Report

Merging #9453 (fca3cb1) into branch-21.12 (ab4bfaa) will increase coverage by 0.03%.
The diff coverage is 0.00%.

Impacted file tree graph

@@               Coverage Diff                @@
##           branch-21.12    #9453      +/-   ##
================================================
+ Coverage         10.79%   10.82%   +0.03%     
================================================
  Files               116      117       +1     
  Lines             18869    19454     +585     
================================================
+ Hits               2036     2106      +70     
- Misses            16833    17348     +515     
Impacted Files Coverage Δ
python/cudf/cudf/__init__.py 0.00% <0.00%> (ø)
python/cudf/cudf/_lib/__init__.py 0.00% <ø> (ø)
python/cudf/cudf/_lib/strings/__init__.py 0.00% <0.00%> (ø)
python/cudf/cudf/io/csv.py 0.00% <0.00%> (ø)
python/cudf/cudf/io/hdf.py 0.00% <0.00%> (ø)
python/cudf/cudf/io/orc.py 0.00% <0.00%> (ø)
python/cudf/cudf/_version.py 0.00% <0.00%> (ø)
python/cudf/cudf/core/abc.py 0.00% <0.00%> (ø)
python/cudf/cudf/api/types.py 0.00% <0.00%> (ø)
python/cudf/cudf/io/dlpack.py 0.00% <0.00%> (ø)
... and 61 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 13e9ec0...fca3cb1. Read the comment docs.

@galipremsagar galipremsagar added this to PR-WIP in v21.12 Release via automation Oct 15, 2021
@galipremsagar galipremsagar moved this from PR-WIP to PR-Reviewer approved in v21.12 Release Oct 15, 2021
@galipremsagar galipremsagar added 5 - Ready to Merge Testing and reviews complete, ready to merge and removed 3 - Ready for Review Ready for review by team labels Oct 15, 2021
@rjzamora
Copy link
Member Author

@gpucibot merge

@rapids-bot rapids-bot bot merged commit 057728c into rapidsai:branch-21.12 Oct 15, 2021
v21.12 Release automation moved this from PR-Reviewer approved to Done Oct 15, 2021
@rjzamora rjzamora deleted the fix-false-index-bug branch October 15, 2021 20:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
5 - Ready to Merge Testing and reviews complete, ready to merge bug Something isn't working cuDF (Python) Affects Python cuDF API. dask Dask issue non-breaking Non-breaking change
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

2 participants