diff --git a/python/tempo/tsdf.py b/python/tempo/tsdf.py index d0ac0185..583142cd 100644 --- a/python/tempo/tsdf.py +++ b/python/tempo/tsdf.py @@ -164,12 +164,11 @@ def __addPrefixToColumns(self, col_list: list[str], prefix: str) -> "TSDF": # df = self.df.withColumnsRenamed(col_map) # build a list of column expressions to rename columns in a select - rename_fn = ( - lambda col: sfn.col(col).alias(col_map[col]) - if col in col_map + select_exprs = [ + sfn.col(col).alias(col_map[col] if col in col_map else sfn.col(col) - ) - select_exprs = [rename_fn(col) for col in self.df.columns] + for col in self.df.columns + ] # select the renamed columns renamed_df = self.df.select(*select_exprs)