Skip to content

Commit

Permalink
fix timestamp col type checking
Browse files Browse the repository at this point in the history
  • Loading branch information
tnixon committed Apr 16, 2024
1 parent 65eafd3 commit e24ba5a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion python/tempo/tsdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
from pyspark.sql import SparkSession
from pyspark.sql.column import Column
from pyspark.sql.dataframe import DataFrame
from pyspark.sql.types import TimestampType
from pyspark.sql.window import Window, WindowSpec
from scipy.fft import fft, fftfreq # type: ignore

Expand Down Expand Up @@ -1102,7 +1103,7 @@ def withRangeStats(
]

# build window
if str(self.df.schema[self.ts_col].dataType) == "TimestampType":
if isinstance(self.df.schema[self.ts_col].dataType, TimestampType):
self.df = self.__add_double_ts()
prohibited_cols.extend(["double_ts"])
w = self.__rangeBetweenWindow(
Expand Down

0 comments on commit e24ba5a

Please sign in to comment.