Commit 3413fa3 1 parent 4e450ad commit 3413fa3 Copy full SHA for 3413fa3
File tree 2 files changed +24
-2
lines changed
2 files changed +24
-2
lines changed Original file line number Diff line number Diff line change @@ -284,7 +284,6 @@ def __copy__(self):
284
284
fv = StreamFeatureView (
285
285
name = self .name ,
286
286
schema = self .schema ,
287
- entities = self .entities ,
288
287
ttl = self .ttl ,
289
288
tags = self .tags ,
290
289
online = self .online ,
@@ -293,9 +292,12 @@ def __copy__(self):
293
292
aggregations = self .aggregations ,
294
293
mode = self .mode ,
295
294
timestamp_field = self .timestamp_field ,
296
- source = self .source ,
295
+ source = self .stream_source if self . stream_source else self . batch_source ,
297
296
udf = self .udf ,
298
297
)
298
+ fv .entities = self .entities
299
+ fv .features = copy .copy (self .features )
300
+ fv .entity_columns = copy .copy (self .entity_columns )
299
301
fv .projection = copy .copy (self .projection )
300
302
return fv
301
303
Original file line number Diff line number Diff line change
1
+ import copy
1
2
from datetime import timedelta
2
3
3
4
import pytest
@@ -299,3 +300,22 @@ def test_stream_feature_view_proto_type():
299
300
aggregations = [],
300
301
)
301
302
assert sfv .proto_class is StreamFeatureViewProto
303
+
304
+
305
+ def test_stream_feature_view_copy ():
306
+ stream_source = KafkaSource (
307
+ name = "kafka" ,
308
+ timestamp_field = "event_timestamp" ,
309
+ kafka_bootstrap_servers = "" ,
310
+ message_format = AvroFormat ("" ),
311
+ topic = "topic" ,
312
+ batch_source = FileSource (path = "some path" ),
313
+ )
314
+ sfv = StreamFeatureView (
315
+ name = "test stream featureview proto class" ,
316
+ entities = [],
317
+ ttl = timedelta (days = 30 ),
318
+ source = stream_source ,
319
+ aggregations = [],
320
+ )
321
+ assert sfv == copy .copy (sfv )
You can’t perform that action at this time.
0 commit comments