Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
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
refactor based on PR review
Signed-off-by: Blake <blaketastic2@gmail.com>
  • Loading branch information
blaketastic2 committed Feb 25, 2025
commit 92a8a58184587e899eb573ee10b89ffb396ab51f
4 changes: 2 additions & 2 deletions README.md
Comment thread
blaketastic2 marked this conversation as resolved.
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ The list below contains the functionality that contributors are planning to deve
* [x] Python Client
* [x] [Python feature server](https://docs.feast.dev/reference/feature-servers/python-feature-server)
* [x] [Java feature server (alpha)](https://github.com/feast-dev/feast/blob/master/infra/charts/feast/README.md)
* [x] [Go feature server (alpha)](https://github.com/feast-dev/feast/blob/master/go/README.md)
* [x] [Go feature server (alpha)](https://docs.feast.dev/reference/feature-servers/go-feature-server)
* **Data Quality Management (See [RFC](https://docs.google.com/document/d/110F72d4NTv80p35wDSONxhhPBqWRwbZXG4f9mNEMd98/edit))**
* [x] Data profiling and validation (Great Expectations)
* **Feature Discovery and Governance**
Expand Down Expand Up @@ -249,4 +249,4 @@ Thanks goes to these incredible people:

<a href="https://github.com/feast-dev/feast/graphs/contributors">
<img src="https://contrib.rocks/image?repo=feast-dev/feast" />
</a>
</a>
16 changes: 9 additions & 7 deletions sdk/python/tests/unit/test_on_demand_feature_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
)
from feast.types import Float32

CUSTOM_FUNCTION_NAME = "custom-function-name"
Comment thread
blaketastic2 marked this conversation as resolved.
Outdated


def udf1(features_df: pd.DataFrame) -> pd.DataFrame:
df = pd.DataFrame()
Expand Down Expand Up @@ -388,14 +390,14 @@ def transform_features(features_df: pd.DataFrame) -> pd.DataFrame:
)(transform_features)

# Verify default name behavior
assert odfv.name == "transform_features"
assert odfv.name == transform_features.__name__
assert isinstance(odfv, OnDemandFeatureView)

proto = odfv.to_proto()
assert proto.spec.name == "transform_features"
assert proto.spec.name == transform_features.__name__

deserialized = OnDemandFeatureView.from_proto(proto)
assert deserialized.name == "transform_features"
assert deserialized.name == transform_features.__name__

# Test with custom name
def another_transform(features_df: pd.DataFrame) -> pd.DataFrame:
Expand All @@ -405,7 +407,7 @@ def another_transform(features_df: pd.DataFrame) -> pd.DataFrame:
return df

odfv_custom = on_demand_feature_view(
name="custom-function-name",
name=CUSTOM_FUNCTION_NAME,
sources=sources,
schema=[
Field(name="output1", dtype=Float32),
Expand All @@ -414,11 +416,11 @@ def another_transform(features_df: pd.DataFrame) -> pd.DataFrame:
)(another_transform)

# Verify custom name behavior
assert odfv_custom.name == "custom-function-name"
assert odfv_custom.name == CUSTOM_FUNCTION_NAME
assert isinstance(odfv_custom, OnDemandFeatureView)

proto = odfv_custom.to_proto()
assert proto.spec.name == "custom-function-name"
assert proto.spec.name == CUSTOM_FUNCTION_NAME

deserialized = OnDemandFeatureView.from_proto(proto)
assert deserialized.name == "custom-function-name"
assert deserialized.name == CUSTOM_FUNCTION_NAME