File tree Expand file tree Collapse file tree 2 files changed +10
-9
lines changed
Expand file tree Collapse file tree 2 files changed +10
-9
lines changed Original file line number Diff line number Diff line change 1313from feast .infra .offline_stores .file_source import FileSource
1414from feast .infra .offline_stores .redshift_source import RedshiftSource
1515from feast .infra .offline_stores .snowflake_source import SnowflakeSource
16- from feast .on_demand_feature_view import OnDemandFeatureView
1716from feast .repo_config import RepoConfig
1817from feast .stream_feature_view import StreamFeatureView
1918from feast .on_demand_feature_view import OnDemandFeatureView
Original file line number Diff line number Diff line change @@ -322,16 +322,18 @@ def _convert_arrow_odfv_to_proto(
322322 }
323323 # Adding On Demand Features
324324 for feature in feature_view .features :
325- if feature .name in [c [0 ] for c in columns ]:
325+ if feature .name in [c [0 ] for c in columns ] and feature . name not in proto_values_by_column :
326326 # initializing the column as null
327- proto_values_by_column [feature .name ] = python_values_to_proto_values (
328- table .append_column (
329- feature .name ,
330- pyarrow .array (
331- [None ] * table .shape [0 ],
327+ null_column = pyarrow .array (
328+ [None ] * table .num_rows ,
332329 type = from_feast_to_pyarrow_type (feature .dtype ),
333- ),
334- ),
330+ )
331+ updated_table = pyarrow .RecordBatch .from_arrays (
332+ table .columns + [null_column ],
333+ schema = table .schema .append (pyarrow .field (feature .name , null_column .type ))
334+ )
335+ proto_values_by_column [feature .name ] = python_values_to_proto_values (
336+ updated_table .column (feature .name ).to_numpy (zero_copy_only = False ), feature .dtype .to_value_type (),
335337 )
336338
337339 entity_keys = [
You can’t perform that action at this time.
0 commit comments