Skip to content

Commit

Permalink
Update session_events.py (#69)
Browse files Browse the repository at this point in the history
timestamp in the data source is stored in unix epoch seconds.
  • Loading branch information
zhongyangfu authored Dec 13, 2023
1 parent 4fb05ab commit bbc7636
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion recsys/data_sources/session_events.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@ def sessions_data_source_function(spark):
schema = StructType([
StructField("session", IntegerType(), True),
StructField("aid", IntegerType(), True),
StructField("ts", TimestampType(), True),
StructField("ts", IntegerType(), True),
StructField("type", StringType(), True)
])

df = spark.read.schema(schema).parquet("s3://tecton.ai.public/tutorials/recsys-demo/train.parquet")
df = df.withColumn("ts", df.ts.cast(TimestampType()))
return df

sessions_batch = BatchSource(
Expand Down

0 comments on commit bbc7636

Please sign in to comment.