Skip to content

Fix struct and list dtype logic in dask_cudf.read_parquet - #9159

Closed
rjzamora wants to merge 2 commits into
NVIDIA:branch-21.10from
rjzamora:fix-struct-list-read-parquet
Closed

rjzamora wants to merge 2 commits into
NVIDIA:branch-21.10from
rjzamora:fix-struct-list-read-parquet

Conversation

@rjzamora

@rjzamora rjzamora commented Sep 1, 2021

Copy link
Copy Markdown
Contributor

The dask_cudf.read_parquet logic currently uses a utility called set_object_dtypes_from_pa_schema to cast dtypes into proper cudf/pyarrow dtypes. The same utility is used to both (1) "reset" pandas.DataFrame metadata to agree with the pyarrow schema, and (2) to cast cudf.DataFrame partitions to the "correct" dtypes at IO time. In both cases, the pd/cudf.DataFrame columns cannot be cast to cudf list and/or struct columns. Therefore, this PR simply adds a simpole check to avoid casting for list/struct dtypes. We also add a new test (test_cudf_dtypes_from_pandas) to add test coverage for the original bug.

@rjzamora rjzamora added bug Something isn't working 2 - In Progress Currently a work in progress dask Dask issue non-breaking Non-breaking change labels Sep 1, 2021
@rjzamora rjzamora self-assigned this Sep 1, 2021
@rjzamora
rjzamora requested a review from a team as a code owner September 1, 2021 17:14
@github-actions github-actions Bot added the Python Affects Python cuDF API. label Sep 1, 2021
@codecov

codecov Bot commented Sep 1, 2021

Copy link
Copy Markdown

Codecov Report

❗ No coverage uploaded for pull request base (branch-21.10@1935a8a). Click here to learn what that means.
The diff coverage is n/a.

❗ Current head e5096b6 differs from pull request most recent head 0b60f21. Consider uploading reports for the commit 0b60f21 to get more accurate results
Impacted file tree graph

@@               Coverage Diff               @@
##             branch-21.10    #9159   +/-   ##
===============================================
  Coverage                ?   10.85%           
===============================================
  Files                   ?      115           
  Lines                   ?    18742           
  Branches                ?        0           
===============================================
  Hits                    ?     2034           
  Misses                  ?    16708           
  Partials                ?        0           

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 1935a8a...0b60f21. Read the comment docs.

@rjzamora rjzamora added 3 - Ready for Review Ready for review by team and removed 2 - In Progress Currently a work in progress labels Sep 1, 2021
galipremsagar added a commit to galipremsagar/cudf that referenced this pull request Sep 14, 2021
@rjzamora

Copy link
Copy Markdown
Contributor Author

Closing in favor of #9203

@rjzamora rjzamora closed this Sep 14, 2021
rapids-bot Bot pushed a commit that referenced this pull request Sep 30, 2021
A similar fix for this problem was recently submitted in #9159 and closed in favor of #9203. It seems that the test added in the latter PR was not actually capturing the original problem. However, after [dask#8072](dask/dask#8072) is merged, the new test will certainly start failing.

Authors:
  - Richard (Rick) Zamora (https://github.com/rjzamora)

Approvers:
  - GALI PREM SAGAR (https://github.com/galipremsagar)
  - Benjamin Zaitlen (https://github.com/quasiben)

URL: #9314
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3 - Ready for Review Ready for review by team bug Something isn't working dask Dask issue non-breaking Non-breaking change Python Affects Python cuDF API.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant