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: Add check for bool type in addition to sample #3452

Merged
merged 1 commit into from Jan 20, 2023

Conversation

beauchbum
Copy link
Contributor

@beauchbum beauchbum commented Jan 19, 2023

Signed-off-by: Ryan Beauchamp ryan.beauchamp@ezcater.com

What this PR does / why we need it:
The current implementation throws an exception when sample == False as it enters this conditional:

# This block is entered as `False == 0` evaluates to `True`
if sample == 0 or sample == 0.0:

  # However, this fails because `type(False) => bool`
  assert type(sample) in [np.int64, int, np.float64, float]

This PR adds an additional check to bypass this condition when dealing with bool.

Which issue(s) this PR fixes:

Fixes #3451

Signed-off-by: Ryan Beauchamp <ryan.beauchamp@ezcater.com>
@beauchbum beauchbum changed the title fix: add check for bool type in addition to sample fix: Add check for bool type in addition to sample Jan 19, 2023
Copy link
Collaborator

@adchia adchia left a comment

Choose a reason for hiding this comment

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

/lgtm

@feast-ci-bot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: adchia, beauchbum

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

The pull request process is described here

Needs approval from an approver in each of these files:

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

@feast-ci-bot feast-ci-bot merged commit 1c7c491 into feast-dev:master Jan 20, 2023
kevjumba pushed a commit that referenced this pull request Jan 31, 2023
# [0.29.0](v0.28.0...v0.29.0) (2023-01-31)

### Bug Fixes

* Add check for bool type in addition to sample ([#3452](#3452)) ([1c7c491](1c7c491))
* Buggy SQL for postgres source ([#3424](#3424)) ([1ea100e](1ea100e))
* Ensure no duplicates in `fv.schema` ([#3460](#3460)) ([08ffa8d](08ffa8d))
* Fix delete sfv twice issue ([#3466](#3466)) ([dfd5eae](dfd5eae))
* Stream feature view UI shows transformation issue ([#3464](#3464)) ([1ef5137](1ef5137))
* Update registry.refresh to have a default arg ([#3450](#3450)) ([2f7c4ed](2f7c4ed))
* Updating the batch field so that you can query create and event date. ([#3411](#3411)) ([01ab462](01ab462)), closes [#3401](#3401)

### Features

* Add data source search ([#3449](#3449)) ([fbbb293](fbbb293))
* Adding list_validation_references for default and sql registry ([#3436](#3436)) ([21dd253](21dd253))
* Make UI accessible behind proxy ([#3428](#3428)) ([753d8db](753d8db))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

0.28.0 Python SDK: Assertion failure on Boolean types in type_map.py #3443
3 participants