11from datetime import timedelta
22
33from feast import (
4- Bool ,
54 Entity ,
65 FeatureService ,
76 FeatureView ,
87 Field ,
98 FileSource ,
10- Int64 ,
11- String ,
129 ValueType ,
1310)
1411from feast .data_source import RequestSource
1512from feast .request_feature_view import RequestFeatureView
1613from feast .on_demand_feature_view import on_demand_feature_view
17- from feast .field import Field
14+ from feast .types import Bool , Int64 , String
1815import pandas as pd
1916
2017zipcode = Entity (
2118 name = "zipcode" ,
2219 value_type = ValueType .INT64 ,
2320 description = "A zipcode" ,
24- labels = {"owner" : "danny@tecton.ai" , "team" : "hack week" ,},
21+ tags = {"owner" : "danny@tecton.ai" , "team" : "hack week" ,},
2522)
2623
2724zipcode_source = FileSource (
4340 Field (name = "population" , dtype = Int64 ),
4441 Field (name = "total_wages" , dtype = Int64 ),
4542 ],
46- batch_source = zipcode_source ,
43+ source = zipcode_source ,
4744 tags = {
4845 "date_added" : "2022-02-7" ,
4946 "experiments" : "experiment-A,experiment-B,experiment-C" ,
6461 Field (name = "population" , dtype = Int64 ),
6562 Field (name = "total_wages" , dtype = Int64 ),
6663 ],
67- batch_source = zipcode_source ,
64+ source = zipcode_source ,
6865 tags = {
6966 "date_added" : "2022-02-7" ,
7067 "experiments" : "experiment-A,experiment-B,experiment-C" ,
8178 Field (name = "tax_returns_filed" , dtype = Int64 ),
8279 Field (name = "total_wages" , dtype = Int64 ),
8380 ],
84- batch_source = zipcode_source ,
81+ source = zipcode_source ,
8582 tags = {
8683 "date_added" : "2022-02-7" ,
8784 "experiments" : "experiment-A,experiment-B,experiment-C" ,
9491 name = "dob_ssn" ,
9592 value_type = ValueType .STRING ,
9693 description = "Date of birth and last four digits of social security number" ,
97- labels = {"owner" : "tony@tecton.ai" , "team" : "hack week" ,},
94+ tags = {"owner" : "tony@tecton.ai" , "team" : "hack week" ,},
9895)
9996
10097credit_history_source = FileSource (
119116 Field (name = "missed_payments_6m" , dtype = Int64 ),
120117 Field (name = "bankruptcies" , dtype = Int64 ),
121118 ],
122- batch_source = credit_history_source ,
119+ source = credit_history_source ,
123120 tags = {
124121 "date_added" : "2022-02-6" ,
125122 "experiments" : "experiment-A" ,
@@ -152,16 +149,10 @@ def transaction_gt_last_credit_card_due(inputs: pd.DataFrame) -> pd.DataFrame:
152149 )
153150 return df
154151
155-
156- # Define request feature view
157- transaction_request_fv = RequestFeatureView (
158- name = "transaction_request_fv" , request_data_source = input_request ,
159- )
160-
161152model_v1 = FeatureService (
162153 name = "credit_score_v1" ,
163154 features = [
164- credit_history [["mortgage_due" , " credit_card_due" , "missed_payments_1y" ]],
155+ credit_history [["credit_card_due" , "missed_payments_1y" ]],
165156 zipcode_features ,
166157 ],
167158 tags = {"owner" : "tony@tecton.ai" , "stage" : "staging" },
@@ -173,7 +164,6 @@ def transaction_gt_last_credit_card_due(inputs: pd.DataFrame) -> pd.DataFrame:
173164 features = [
174165 credit_history [["mortgage_due" , "credit_card_due" , "missed_payments_1y" ]],
175166 zipcode_features ,
176- transaction_request_fv ,
177167 ],
178168 tags = {"owner" : "tony@tecton.ai" , "stage" : "prod" },
179169 description = "Credit scoring model" ,
0 commit comments