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: Assertion condition when value is 0 by kysersozelee · Pull Request #3401 · feast-dev/feast

fix: Assertion condition when value is 0 #3401

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.

Sign up for GitHub

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

Merged
feast-ci-bot merged 4 commits into feast-dev:master from kysersozelee:fix_valid_scala_assertion_condition
Dec 20, 2022

Uh oh!

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

Merged

fix: Assertion condition when value is 0 #3401

Changes from all commits
Commits
Show all changes
4 commits
Select commit Hold shift + click to select a range
619f6c9
fix: Add assertion condition when value is 0
km-zlatan-el Dec 19, 2022
e0c952f
chore: Add comment about zero value validation
km-zlatan-el Dec 19, 2022
033a432
chore: Modifiy the comment
km-zlatan-el Dec 19, 2022
4b2fc9d
chore: Add the comment
km-zlatan-el Dec 19, 2022
File filter
Filter by extension

Clear filters
Conversations
Failed to load comments.
Loading

Uh oh!

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

Jump to
Jump to file
Failed to load files.
Loading

Uh oh!

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

Diff view
Diff view

There are no files selected for viewing

7 changes: 6 additions & 1 deletion 7 sdk/python/feast/type_map.py
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,12 @@ def _python_value_to_proto_value(
valid_scalar_types,
) = PYTHON_SCALAR_VALUE_TYPE_TO_PROTO_VALUE[feast_value_type]
if valid_scalar_types:
assert type(sample) in valid_scalar_types
if sample == 0 or sample == 0.0:
Comment thread Outdated

@felixwang9817 felixwang9817 Dec 19, 2022

Copy link
Copy Markdown
Collaborator

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.

nit: would you mind adding a comment indicating why this special case is necessary?

Sorry, something went wrong.

Uh oh!

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

All reactions

@kysersozelee kysersozelee Dec 19, 2022

Copy link
Copy Markdown
Contributor Author

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.

e0c952f Left the comment. Let me know if it is not inappropriate!

Sorry, something went wrong.

Uh oh!

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

All reactions

@felixwang9817 felixwang9817 Dec 19, 2022

Copy link
Copy Markdown
Collaborator

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.

@kysersozelee hm I think this comment is still not super clear to me - it would be great if you could add why type validation cannot be performed with only one type (if I understand correctly from #3400, the issue is because you might e.g. have an int value in a float column)

Sorry, something went wrong.

Uh oh!

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

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

@kysersozelee kysersozelee Dec 19, 2022 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Contributor Author

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.

@felixwang9817

Left the two comments. Let me know if it is inappropriate!

# Numpy convert 0 to int. However, in the feature view definition, the type of column may be a float.
# So, if value is 0, type validation must pass if scalar_types are either int or float.

Sorry, something went wrong.

Uh oh!

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

All reactions

@felixwang9817 felixwang9817 Dec 19, 2022

Copy link
Copy Markdown
Collaborator

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.

thanks @kysersozelee!

Sorry, something went wrong.

Uh oh!

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

All reactions
# Numpy convert 0 to int. However, in the feature view definition, the type of column may be a float.
# So, if value is 0, type validation must pass if scalar_types are either int or float.
assert type(sample) in [np.int64, int, np.float64, float]
else:
assert type(sample) in valid_scalar_types
if feast_value_type == ValueType.BOOL:
# ProtoValue does not support conversion of np.bool_ so we need to convert it to support np.bool_.
return [
Expand Down
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 01402520 — 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.