Skip to content

applied black formatting #307

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion python/tempo/interpol.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,10 @@ def __generate_time_series_fill(
:param partition_cols: partition column names
:param ts_col: timestamp column name
"""
return df.withColumn("previous_timestamp", col(ts_col),).withColumn(
return df.withColumn(
"previous_timestamp",
col(ts_col),
).withColumn(
"next_timestamp",
lead(df[ts_col]).over(Window.partitionBy(*partition_cols).orderBy(ts_col)),
)
Expand Down
4 changes: 0 additions & 4 deletions python/tempo/intervals.py
Original file line number Diff line number Diff line change
Expand Up @@ -346,14 +346,12 @@ def __merge_adjacent_overlaps(
"""

if how == "left":

# new boundary for interval end will become the start of the next
# interval
new_boundary_col = self.end_ts
new_boundary_val = f"_lead_1_{self.start_ts}"

else:

# new boundary for interval start will become the end of the
# previous interval
new_boundary_col = self.start_ts
Expand Down Expand Up @@ -386,7 +384,6 @@ def __merge_adjacent_overlaps(
)

if how == "left":

for c in self.metric_columns:
df = df.withColumn(
c,
Expand Down Expand Up @@ -599,7 +596,6 @@ def toDF(self, stack: bool = False) -> DataFrame:
"""

if stack:

n_cols = len(self.metric_columns)
metric_cols_expr = ",".join(
tuple(f"'{col}', {col}" for col in self.metric_columns)
Expand Down
1 change: 0 additions & 1 deletion python/tempo/tsdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -1236,7 +1236,6 @@ def interpolate(
return TSDF(interpolated_df, ts_col=ts_col, partition_cols=partition_cols)

def calc_bars(tsdf, freq, func=None, metricCols=None, fill=None):

resample_open = tsdf.resample(
freq=freq, func="floor", metricCols=metricCols, prefix="open", fill=fill
)
Expand Down