-
Notifications
You must be signed in to change notification settings - Fork 1.3k
feat: Adding support for Native Python feature transformations for On Demand Feature Views #4045
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
Changes from 1 commit
da3eba3
f8fd949
bbc55de
0ac27be
b028f8f
efe16d5
74b77e6
16850e9
aa90fc1
26c1170
231e2db
8fedca7
5eb583d
b5b71e2
75a3023
c5ecce6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -38,14 +38,14 @@ def udf1(features_df: pd.DataFrame) -> pd.DataFrame: | |
| def udf2(features_df: pd.DataFrame) -> pd.DataFrame: | ||
| df = pd.DataFrame() | ||
| df["output1"] = features_df["feature1"] + 100 | ||
| df["output2"] = features_df["feature2"] + 100 | ||
| df["output2"] = features_df["feature2"] + 101 | ||
| return df | ||
|
|
||
|
|
||
| def python_native_udf(features_dict: Dict[str, List[Any]]) -> Dict[str, List[Any]]: | ||
| def python_native_udf(features_dict: Dict[str, List[Any]]) -> Dict[str, Any]: | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @franciscojavierarceo sorry for the late find. Can you look at this test examples? The signatures are correct, but actual transformation seems to assume that
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. whoops let me update the test case tomorrow but it should be a singleton, the type hint is wrong. I adjusted this late and missed this one.
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ah, got it. If it should be a singleton, then also double-check what is actually passed from odfv class as well. I may be wrong, but I think it's passing a list.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'll add another test when using
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm planning to add an explicit
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. here's the fix for the type: #4054 |
||
| output_dict: Dict[str, List[Any]] = { | ||
| "output1": [features_dict["feature1"] + 100], | ||
| "output2": [features_dict["feature2"] + 100], | ||
| "output1": features_dict["feature1"] + 100, | ||
| "output2": features_dict["feature2"] + 101, | ||
| } | ||
| return output_dict | ||
|
|
||
|
|
@@ -204,6 +204,13 @@ def test_python_native_transformation_mode(): | |
| } | ||
| ) | ||
|
|
||
| assert on_demand_feature_view_python_native.get_transformed_features( | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @HaoXuAI see here as example of usage. |
||
| { | ||
| "feature1": 0, | ||
| "feature2": 1, | ||
| } | ||
| ) == {"feature1": 0, "feature2": 1, "output1": 100, "output2": 102} | ||
|
|
||
|
|
||
| @pytest.mark.filterwarnings("ignore:udf and udf_string parameters are deprecated") | ||
| def test_from_proto_backwards_compatible_udf(): | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.