Skip to content

Commit 96913f5

Browse files
authored
Issue397 with range stats not recog timestamp (#400)
* fix timestamp col type checking * fixing another instance of a bad runtime type check
1 parent 57c373e commit 96913f5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

python/tempo/tsdf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
from pyspark.sql import SparkSession
1414
from pyspark.sql.column import Column
1515
from pyspark.sql.dataframe import DataFrame
16-
from pyspark.sql.types import TimestampType
16+
from pyspark.sql.types import StringType, TimestampType
1717
from pyspark.sql.window import Window, WindowSpec
1818
from scipy.fft import fft, fftfreq # type: ignore
1919

@@ -64,7 +64,7 @@ def __init__(
6464
# this if clause seems unneeded. Perhaps we should check for non-valid
6565
# Timestamp string matching then do some pattern matching to extract
6666
# the time stamp.
67-
if df.schema[ts_col].dataType == "StringType": # pragma: no cover
67+
if isinstance(df.schema[ts_col].dataType, StringType): # pragma: no cover
6868
sample_ts = df.limit(1).collect()[0][0]
6969
self.__validate_ts_string(sample_ts)
7070
self.df = self.__add_double_ts().withColumnRenamed("double_ts", self.ts_col)

0 commit comments

Comments
 (0)