chore: Add conversion from ValueTypeProto.Enum to new Feast type system#2489
chore: Add conversion from ValueTypeProto.Enum to new Feast type system#2489feast-ci-bot merged 2 commits intofeast-dev:masterfrom
Conversation
Signed-off-by: Felix Wang <[email protected]>
Codecov Report
@@ Coverage Diff @@
## master #2489 +/- ##
==========================================
- Coverage 84.63% 84.62% -0.01%
==========================================
Files 130 130
Lines 10998 11031 +33
==========================================
+ Hits 9308 9335 +27
- Misses 1690 1696 +6
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
sdk/python/feast/types.py
Outdated
| """ | ||
| A PrimitiveFeastType represents a primitive type in Feast. | ||
|
|
||
| Note that these values must match the values in ValueTypeProto.Enum. |
sdk/python/feast/types.py
Outdated
| return PrimitiveFeastType(value_type) | ||
|
|
||
| # Complex types must be constructed. Currently only arrays are supported. Note that | ||
| # enum values for arrays are precisely the enum value for the array's base type plus 10. |
There was a problem hiding this comment.
Honestly a map is better here because this is sure to break if we add enums that aren't supported or something. We should have a map, and a test that iterates over all possible enum values and ensures that you get a valid feast type.
Signed-off-by: Felix Wang <[email protected]>
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: achals, felixwang9817 The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Signed-off-by: Felix Wang [email protected]
What this PR does / why we need it: #2475 added a new type system but did not include a method to convert from the existing type system enums (
ValueTypeProto.Enum) to the new type system. This PR adds that conversion method.Which issue(s) this PR fixes:
Fixes #