15
15
#
16
16
from __future__ import annotations
17
17
18
- import datetime
19
-
20
18
import hopsworks_common
21
19
import numpy
22
20
import pandas as pd
@@ -1717,19 +1715,16 @@ def test_serialize_to_avro(self, mocker):
1717
1715
mock_to_avro = mocker .patch ('hsfs.engine.spark.to_avro' )
1718
1716
mock_to_avro .return_value = lit (b'111' )
1719
1717
1720
- now = datetime .datetime .now ()
1721
-
1722
1718
fg_data = []
1723
- fg_data .append (("ekarson" , ["GRAVITY RUSH 2" , "KING'S QUEST" ], pd . Timestamp ( now . timestamp ()) ))
1724
- fg_data .append (("ratmilkdrinker" , ["NBA 2K" , "CALL OF DUTY" ], pd . Timestamp ( now . timestamp ()) ))
1725
- pandas_df = pd .DataFrame (fg_data , columns = ["account_id" , "last_played_games" , "event_time" ])
1719
+ fg_data .append (("ekarson" , ["GRAVITY RUSH 2" , "KING'S QUEST" ]))
1720
+ fg_data .append (("ratmilkdrinker" , ["NBA 2K" , "CALL OF DUTY" ]))
1721
+ pandas_df = pd .DataFrame (fg_data , columns = ["account_id" , "last_played_games" ])
1726
1722
1727
1723
df = spark_engine ._spark_session .createDataFrame (pandas_df )
1728
1724
1729
1725
features = [
1730
1726
feature .Feature (name = "account_id" , type = "str" ),
1731
1727
feature .Feature (name = "last_played_games" , type = "array" ),
1732
- feature .Feature (name = "event_time" , type = "timestamp" ),
1733
1728
]
1734
1729
1735
1730
fg = feature_group .FeatureGroup (
@@ -1745,7 +1740,7 @@ def test_serialize_to_avro(self, mocker):
1745
1740
'id' : 1025 ,
1746
1741
'subject' : 'fg_1' ,
1747
1742
'version' : 1 ,
1748
- 'schema' : '{"type":"record","name":"fg_1","namespace":"test_featurestore.db","fields":[{"name":"account_id","type":["null","string"]},{"name":"last_played_games","type":["null",{"type":"array","items":["null","string"]}]},{"name":"event_time","type":["null",{"type":"long","logicalType":"timestamp-micros"}]} ]}'
1743
+ 'schema' : '{"type":"record","name":"fg_1","namespace":"test_featurestore.db","fields":[{"name":"account_id","type":["null","string"]},{"name":"last_played_games","type":["null",{"type":"array","items":["null","string"]}]}]}'
1749
1744
}
1750
1745
1751
1746
# Act
0 commit comments