GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix: Dask zero division error if parquet dataset has only one partition by mzwiessele · Pull Request #3236 · feast-dev/feast

Conversation

@mzwiessele

@mzwiessele mzwiessele commented Sep 20, 2022 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Signed-off-by: Max Zwiessele [email protected]

What this PR does / why we need it:
When loading data in parquet dataset format it can happen that the dataset only has one partition in the event_timestamp column. If that is the case, dask will fail to process the dataset, erroring with a ZeroDividionError similar to

feast/sdk/python/feast/infra/offline_stores/file.py

Line 327 in 769c318

# try-catch block is added to deal with this issue https://github.com/dask/dask/issues/8939.

This PR adds a try-catch block to gracefully circumvent the error and process the data in only one partition.

Which issue(s) this PR fixes:

N/A

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@feast-ci-bot feast-ci-bot added the size/M label Sep 20, 2022
@mzwiessele mzwiessele changed the title fix: dask zero division error if parquet dataset has only one partition fix: Dask zero division error if parquet dataset has only one partition Sep 20, 2022
@mzwiessele
mzwiessele force-pushed the zero_division_dask_drop_duplicates branch 3 times, most recently from f1736d3 to 225910e Compare September 20, 2022 16:16
mzwiessele
mzwiessele commented Sep 20, 2022
View reviewed changes
Comment thread sdk/python/feast/infra/offline_stores/file.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

@mzwiessele

mzwiessele commented Sep 20, 2022

Copy link
Copy Markdown
Contributor Author

/assign @woop

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@feast-ci-bot feast-ci-bot assigned woop Sep 20, 2022
achals
achals approved these changes Sep 20, 2022
View reviewed changes

@achals achals left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Could you add a test for this case?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@feast-ci-bot feast-ci-bot added the approved label Sep 20, 2022
@mzwiessele

mzwiessele commented Sep 21, 2022 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor Author

Could you add a test for this case?

Yes, I need help though. We need a test folder with a parquet dataset in the test S3 bucket. That parquet dataset must have only one partition in the event_timestamp column. The reason is simply that this code correction fixes exactly that edge case.

Related to #3235

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@mzwiessele

mzwiessele commented Sep 21, 2022

Copy link
Copy Markdown
Contributor Author

Before merging this: Is it possible to update the Dask version feast relies on? Or in other words, why is the version restricted like this?

"dask>=2021.*,<2022.02.0"
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@mzwiessele
mzwiessele force-pushed the zero_division_dask_drop_duplicates branch from 225910e to f75f44a Compare September 23, 2022 09:09
@mzwiessele

mzwiessele commented Sep 23, 2022

Copy link
Copy Markdown
Contributor Author

@achals I'll need help with the tests. Happy to do the ground work. Please point me to the right testing suite (in the unit tests) for loading a local parquet file from a FileSource.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@mzwiessele
mzwiessele force-pushed the zero_division_dask_drop_duplicates branch from 7e34e2f to 393bf5c Compare September 23, 2022 16:06
@codecov-commenter

codecov-commenter commented Sep 23, 2022 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Codecov Report

Base: 67.50% // Head: 58.12% // Decreases project coverage by -9.38% ⚠️

Coverage data is based on head (393bf5c) compared to base (b48d36b).
Patch coverage: 45.45% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3236      +/-   ##
==========================================
- Coverage   67.50%   58.12%   -9.39%     
==========================================
  Files         179      213      +34     
  Lines       16371    17832    +1461     
==========================================
- Hits        11051    10364     -687     
- Misses       5320     7468    +2148     
Flag Coverage Δ
integrationtests ?
unittests 58.12% <45.45%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
sdk/python/tests/utils/e2e_test_validation.py 55.44% <ø> (-33.67%) ⬇️
...ation/feature_repos/universal/data_sources/file.py 45.63% <40.00%> (-24.27%) ⬇️
sdk/python/feast/infra/offline_stores/file.py 72.90% <50.00%> (-22.57%) ⬇️
...sts/integration/registration/test_universal_cli.py 20.20% <0.00%> (-79.80%) ⬇️
...ts/integration/offline_store/test_offline_write.py 26.08% <0.00%> (-73.92%) ⬇️
...fline_store/test_universal_historical_retrieval.py 28.75% <0.00%> (-71.25%) ⬇️
...ests/integration/e2e/test_python_feature_server.py 29.50% <0.00%> (-70.50%) ⬇️
...dk/python/tests/integration/e2e/test_validation.py 27.55% <0.00%> (-69.30%) ⬇️
...s/integration/registration/test_universal_types.py 32.25% <0.00%> (-67.75%) ⬇️
sdk/python/feast/infra/online_stores/redis.py 28.39% <0.00%> (-66.67%) ⬇️
... and 169 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@mzwiessele

mzwiessele commented Sep 23, 2022

Copy link
Copy Markdown
Contributor Author

@achals I've added the test, please take a look and tell me if this does the trick!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@felixwang9817 felixwang9817 assigned felixwang9817 and unassigned woop Sep 24, 2022
@felixwang9817

felixwang9817 commented Sep 24, 2022

Copy link
Copy Markdown
Collaborator

hey @mzwiessele thanks for the PR! a few responses to your comments above:

Yes, I need help though. We need a test folder with a parquet dataset in the test S3 bucket. That parquet dataset must have only one partition in the event_timestamp column. The reason is simply that this code correction fixes exactly that edge case.

unless I'm misunderstanding, there's no need for the parquet dataset to be in an S3 bucket, right? the only thing that matters is that the Parquet dataset doesn't have npartitions set

if that's correct, I think the best way to write a test would be to do it locally - you can check out our unit tests in sdk/python/feast/infra/tests/unit, all of which run locally. I would try to imitate test_e2e_local in test_e2e_local.py - it's a good example of setting up a dataset locally, constructing a feature repo + FeatureStore object, and then running some tests, in your case I think you would just want to check that get_historical_features works on a Parquet dataset with npartitions unset

Before merging this: Is it possible to update the Dask version feast relies on? Or in other words, why is the version restricted like this?

I forget exactly why we restricted that version; I'll go back and check, and if there's no strong reason I'm happy to bump up the upper bound restriction (although I think that can happen in a follow up PR)

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@felixwang9817

felixwang9817 commented Sep 24, 2022

Copy link
Copy Markdown
Collaborator

@mzwiessele also left some additional comments for you on #3235!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@mzwiessele

mzwiessele commented Oct 5, 2022

Copy link
Copy Markdown
Contributor Author

@felixwang9817 I've added the dataset source to the test suite as suggested at #3235 to test loading of parquet datasets.

Do you know if any of the created datasets feature only one partition in the event_timestamp column?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@mzwiessele

mzwiessele commented Oct 11, 2022 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor Author

@felixwang9817 @achals kind ping :)

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@achals

achals commented Oct 11, 2022

Copy link
Copy Markdown
Member

@felixwang9817 @achals kind ping :)

The DCO check still seems to be failing! Good to merge as soon as that's fixed. https://github.com/feast-dev/feast/pull/3236/checks?check_run_id=8744237672

mzwiessele reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

mzwiessele added 3 commits October 12, 2022 16:31
@mzwiessele
fix: dask zero division error if parquet dataset has only one partition
91835d1
Signed-off-by: Max Zwiessle <[email protected]>
@mzwiessele
Update file.py
69b3fae
Signed-off-by: Max Zwiessle <[email protected]>
@mzwiessele
Update file.py
f60862b
Signed-off-by: Max Zwiessle <[email protected]>
@mzwiessele
mzwiessele force-pushed the zero_division_dask_drop_duplicates branch from 7343c26 to f60862b Compare October 12, 2022 15:31
@mzwiessele

mzwiessele commented Oct 12, 2022

Copy link
Copy Markdown
Contributor Author

@achals fixed :)

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

achals
achals approved these changes Oct 12, 2022
View reviewed changes

@achals achals left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

/lgtm

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@feast-ci-bot feast-ci-bot assigned achals Oct 12, 2022
@feast-ci-bot feast-ci-bot added the lgtm label Oct 12, 2022
@feast-ci-bot

feast-ci-bot commented Oct 12, 2022

Copy link
Copy Markdown
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: achals, mzwiessele

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:
  • OWNERS [achals]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@achals achals added the ok-to-test label Oct 12, 2022
@feast-ci-bot
feast-ci-bot merged commit 69e4a7d into feast-dev:master Oct 12, 2022
franciscojavierarceo pushed a commit to franciscojavierarceo/feast that referenced this pull request Oct 18, 2022
@mzwiessele @franciscojavierarceo
fix: Dask zero division error if parquet dataset has only one partiti…
4d50b3e
…on (feast-dev#3236)

* fix: dask zero division error if parquet dataset has only one partition

Signed-off-by: Max Zwiessle <[email protected]>

* Update file.py

Signed-off-by: Max Zwiessle <[email protected]>

* Update file.py

Signed-off-by: Max Zwiessle <[email protected]>

Signed-off-by: Max Zwiessle <[email protected]>
kevjumba pushed a commit that referenced this pull request Dec 5, 2022
@feast-ci-bot
chore(release): release 0.27.0
1d3c111
# [0.27.0](v0.26.0...v0.27.0) (2022-12-05)

### Bug Fixes

* Changing Snowflake template code to avoid query not implemented … ([#3319](#3319)) ([1590d6b](1590d6b))
* Dask zero division error if parquet dataset has only one partition ([#3236](#3236)) ([69e4a7d](69e4a7d))
* Enable Spark materialization on Yarn ([#3370](#3370)) ([0c20a4e](0c20a4e))
* Ensure that Snowflake accounts for number columns that overspecify precision ([#3306](#3306)) ([0ad0ace](0ad0ace))
* Fix memory leak from usage.py not properly cleaning up call stack ([#3371](#3371)) ([a0c6fde](a0c6fde))
* Fix workflow to contain env vars ([#3379](#3379)) ([548bed9](548bed9))
* Update bytewax materialization ([#3368](#3368)) ([4ebe00f](4ebe00f))
* Update the version counts ([#3378](#3378)) ([8112db5](8112db5))
* Updated AWS Athena template ([#3322](#3322)) ([5956981](5956981))
* Wrong UI data source type display ([#3276](#3276)) ([8f28062](8f28062))

### Features

* Cassandra online store, concurrency in bulk write operations ([#3367](#3367)) ([eaf354c](eaf354c))
* Cassandra online store, concurrent fetching for multiple entities ([#3356](#3356)) ([00fa21f](00fa21f))
* Get Snowflake Query Output As Pyspark Dataframe ([#2504](#2504)) ([#3358](#3358)) ([2f18957](2f18957))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@achals achals achals approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@achals achals

@felixwang9817 felixwang9817

Labels

approved lgtm ok-to-test size/M

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

6 participants

@mzwiessele @codecov-commenter @felixwang9817 @achals @feast-ci-bot @woop
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.