Skip to content

Commit

Permalink
Issue397 with range stats not recog timestamp (#400)
Browse files Browse the repository at this point in the history
* fix timestamp col type checking

* fixing another instance of a bad runtime type check
  • Loading branch information
tnixon authored Apr 19, 2024
1 parent 57c373e commit 96913f5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions python/tempo/tsdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +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.types import StringType, TimestampType
from pyspark.sql.window import Window, WindowSpec
from scipy.fft import fft, fftfreq # type: ignore

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

0 comments on commit 96913f5

Please sign in to comment.