Skip to content

Commit

Permalink
Merge branch 'main' into ODSC-60499/additional_tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mayoor authored Aug 9, 2024
2 parents b74fd3b + dc168a5 commit ed2c854
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 10 deletions.
21 changes: 12 additions & 9 deletions ads/jobs/builders/infrastructure/dsc_job.py
Original file line number Diff line number Diff line change
Expand Up @@ -377,13 +377,12 @@ def delete(self, force_delete: bool = False) -> DSCJob:
"""
runs = self.run_list()
for run in runs:
if force_delete:
if run.lifecycle_state in [
DataScienceJobRun.LIFECYCLE_STATE_ACCEPTED,
DataScienceJobRun.LIFECYCLE_STATE_IN_PROGRESS,
DataScienceJobRun.LIFECYCLE_STATE_NEEDS_ATTENTION,
]:
run.cancel(wait_for_completion=True)
if force_delete and run.lifecycle_state in [
DataScienceJobRun.LIFECYCLE_STATE_ACCEPTED,
DataScienceJobRun.LIFECYCLE_STATE_IN_PROGRESS,
DataScienceJobRun.LIFECYCLE_STATE_NEEDS_ATTENTION,
]:
run.cancel(wait_for_completion=True)
run.delete()
self.client.delete_job(self.id)
return self
Expand Down Expand Up @@ -894,10 +893,14 @@ def download(self, to_dir):
return self

def delete(self, force_delete: bool = False):
if force_delete:
if force_delete and self.status in [
DataScienceJobRun.LIFECYCLE_STATE_ACCEPTED,
DataScienceJobRun.LIFECYCLE_STATE_IN_PROGRESS,
DataScienceJobRun.LIFECYCLE_STATE_NEEDS_ATTENTION,
]:
self.cancel(wait_for_completion=True)
super().delete()
return
return self


# This is for backward compatibility
Expand Down
4 changes: 3 additions & 1 deletion ads/opctl/operator/lowcode/forecast/model/arima.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,9 @@ def _train_model(self, i, s_id, df, model_kwargs):
self.forecast_output.init_series_output(series_id=s_id, data_at_series=df)
# If trend is constant, remove constant columns
if "trend" not in model_kwargs or model_kwargs["trend"] == "c":
self.constant_cols[s_id] = df.columns[df.nunique() == 1]
self.constant_cols[s_id] = list(df.columns[df.nunique() == 1])
if target in self.constant_cols[s_id]:
self.constant_cols[s_id].remove(target)
df = df.drop(columns=self.constant_cols[s_id])

# format the dataframe for this target. Dropping NA on target[df] will remove all future data
Expand Down

0 comments on commit ed2c854

Please sign in to comment.