@@ -136,8 +136,8 @@ taxi_entity = Entity(name='taxi', join_keys=['taxi_id'])
136136``` python
137137trips_stats_fv = BatchFeatureView(
138138 name = ' trip_stats' ,
139- entities = [' taxi ' ],
140- features = [
139+ entities = [taxi_entity ],
140+ schema = [
141141 Field(name = " total_miles_travelled" , dtype = Float64),
142142 Field(name = " total_trip_seconds" , dtype = Float64),
143143 Field(name = " total_earned" , dtype = Float64),
@@ -154,17 +154,17 @@ trips_stats_fv = BatchFeatureView(
154154
155155``` python
156156@on_demand_feature_view (
157- schema = [
158- Field(" avg_fare" , Float64),
159- Field(" avg_speed" , Float64),
160- Field(" avg_trip_seconds" , Float64),
161- Field(" earned_per_hour" , Float64),
162- ],
163157 sources = [
164158 trips_stats_fv,
159+ ],
160+ schema = [
161+ Field(name = " avg_fare" , dtype = Float64),
162+ Field(name = " avg_speed" , dtype = Float64),
163+ Field(name = " avg_trip_seconds" , dtype = Float64),
164+ Field(name = " earned_per_hour" , dtype = Float64),
165165 ]
166166)
167- def on_demand_stats (inp ) :
167+ def on_demand_stats (inp : pd.DataFrame) -> pd.DataFrame :
168168 out = pd.DataFrame()
169169 out[" avg_fare" ] = inp[" total_earned" ] / inp[" trip_count" ]
170170 out[" avg_speed" ] = 3600 * inp[" total_miles_travelled" ] / inp[" total_trip_seconds" ]
@@ -647,7 +647,7 @@ Now we can create validation reference from dataset and profiler function:
647647
648648
649649``` python
650- validation_reference = ds.as_reference(profiler = stats_profiler)
650+ validation_reference = ds.as_reference(name = " validation_reference_dataset " , profiler = stats_profiler)
651651```
652652
653653and test it against our existing retrieval job
0 commit comments