Skip to content

Commit

Permalink
Fix: DataFrame Where Clause Quoting (#793)
Browse files Browse the repository at this point in the history
* remove extra quoting around string

* fix where clause

* remove pass
  • Loading branch information
eakmanrq authored May 1, 2023
1 parent ccd1cc6 commit cf5948a
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions sqlmesh/core/model/definition.py
Original file line number Diff line number Diff line change
Expand Up @@ -829,17 +829,9 @@ def render(
assert self.time_column

if PySparkDataFrame is not None and isinstance(df, PySparkDataFrame):
import pyspark

df = df.where(
pyspark.sql.functions.col(self.time_column.column).between(
pyspark.sql.functions.lit(
self.convert_to_time_column(start).sql("spark")
),
pyspark.sql.functions.lit(
self.convert_to_time_column(end).sql("spark")
),
)
f"{self.time_column.column} BETWEEN {self.convert_to_time_column(start).sql('spark')} "
f"AND {self.convert_to_time_column(end).sql('spark')}"
)
else:
assert self.time_column.format, "Time column format is required."
Expand Down

0 comments on commit cf5948a

Please sign in to comment.