Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
93953d5
Add type annotation
felixwang9817 Apr 6, 2022
7057016
Switch from Feature to Field for FeatureViewProjection
felixwang9817 Apr 8, 2022
8de4c6b
Switch from Feature to Field for BaseFeatureView
felixwang9817 Apr 8, 2022
b32bea6
Switch from Feature to Field for RequestFeatureView
felixwang9817 Apr 8, 2022
05f2514
Enforce kwargs for ODFVs and switch from Feature to Field and from `f…
felixwang9817 Apr 8, 2022
58d02c1
Switch from Feature to Field and from `features` to `schema` for Feat…
felixwang9817 Apr 8, 2022
ba0f12e
Fix references to `features` and Feature
felixwang9817 Apr 8, 2022
13c874b
Switch from `Feature` to `Field` for ODFV in tests
felixwang9817 Apr 8, 2022
1d1e603
Switch from Feature to Field in templates
felixwang9817 Apr 9, 2022
1dc0942
Switch from Feature to Field in example test repos
felixwang9817 Apr 9, 2022
02cf8af
Switch from Feature to Field in registration integration tests
felixwang9817 Apr 9, 2022
d5e391b
Switch from Feature to Field in non-registration integration tests
felixwang9817 Apr 9, 2022
57ce182
Switch from Feature to Field in random tests
felixwang9817 Apr 9, 2022
7f5526f
Switch from Feature to Field in ui
felixwang9817 Apr 9, 2022
901a639
Switch from Feature to Field in some universal feature views
felixwang9817 Apr 9, 2022
bb2fe9d
Switch from Feature to Field in docs
felixwang9817 Apr 9, 2022
f93c844
Add assertion that BaseFeatureView is always initialized with a name
felixwang9817 Apr 11, 2022
2267064
Fix imports in docs
felixwang9817 Apr 11, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Switch from Feature to Field for ODFV in tests
Signed-off-by: Felix Wang <wangfelix98@gmail.com>
  • Loading branch information
felixwang9817 committed Apr 9, 2022
commit 13c874b71e95e7d04059c0eae09aacba343c01d7
25 changes: 25 additions & 0 deletions sdk/python/feast/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,22 @@
from .feature_service import FeatureService
from .feature_store import FeatureStore
from .feature_view import FeatureView
from .field import Field
from .on_demand_feature_view import OnDemandFeatureView
from .repo_config import RepoConfig
from .request_feature_view import RequestFeatureView
from .types import (
Array,
Bool,
Bytes,
Float32,
Float64,
Int32,
Int64,
Invalid,
String,
UnixTimestamp,
)
from .value_type import ValueType

logging.basicConfig(
Expand All @@ -35,6 +48,7 @@
"KafkaSource",
"KinesisSource",
"Feature",
"Field",
"FeatureService",
"FeatureStore",
"FeatureView",
Expand All @@ -48,4 +62,15 @@
"RequestFeatureView",
"SnowflakeSource",
"PushSource",
# Types
"Array",
"Invalid",
"Bytes",
"String",
"Bool",
"Int32",
"Int64",
"Float32",
"Float64",
"UnixTimestamp",
]
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,16 @@
import numpy as np
import pandas as pd

from feast import Feature, FeatureView, OnDemandFeatureView, PushSource, ValueType
from feast import (
Feature,
FeatureView,
Field,
Float32,
Float64,
OnDemandFeatureView,
PushSource,
ValueType,
)
from feast.data_source import DataSource, RequestSource


Expand Down Expand Up @@ -55,16 +64,17 @@ def conv_rate_plus_100_feature_view(
infer_features: bool = False,
features: Optional[List[Feature]] = None,
) -> OnDemandFeatureView:
# Test that positional arguments and Features still work for ODFVs.
_features = features or [
Feature("conv_rate_plus_100", ValueType.DOUBLE),
Feature("conv_rate_plus_val_to_add", ValueType.DOUBLE),
Feature("conv_rate_plus_100_rounded", ValueType.INT32),
]
return OnDemandFeatureView(
name=conv_rate_plus_100.__name__,
sources=sources,
features=[] if infer_features else _features,
udf=conv_rate_plus_100,
conv_rate_plus_100.__name__,
[] if infer_features else _features,
sources,
conv_rate_plus_100,
)


Expand All @@ -90,14 +100,17 @@ def similarity_feature_view(
infer_features: bool = False,
features: Optional[List[Feature]] = None,
) -> OnDemandFeatureView:
_features = features or [
Feature("cos_double", ValueType.DOUBLE),
Feature("cos_float", ValueType.FLOAT),
_fields = [
Field(name="cos_double", dtype=Float64),
Field(name="cos_float", dtype=Float32),
]
if features is not None:
_fields = [Field.from_feature(feature) for feature in features]

return OnDemandFeatureView(
name=similarity.__name__,
sources=sources,
features=[] if infer_features else _features,
schema=[] if infer_features else _fields,
udf=similarity,
)

Expand Down