Skip to content

Commit

Permalink
small fix: removing repartition as it has no effect before groupby
Browse files Browse the repository at this point in the history
  • Loading branch information
ryuta-yoshimatsu committed Dec 1, 2023
1 parent 2838a51 commit c5a6c4e
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions forecasting_sa/Forecaster.py
Original file line number Diff line number Diff line change
Expand Up @@ -467,8 +467,7 @@ def evaluate_local_model(self, model_conf):
)

res_sdf = (
src_df.repartition(100)
.groupby(self.conf["group_id"])
src_df.groupby(self.conf["group_id"])
.applyInPandas(evaluate_one_model_fn, schema=output_schema_intm)
)

Expand All @@ -477,8 +476,7 @@ def evaluate_local_model(self, model_conf):
)

res_sdf = (
res_sdf.repartition(100)
.groupby(self.conf["group_id"])
res_sdf.groupby(self.conf["group_id"])
.applyInPandas(unpack_fn, schema=output_schema_final)
)

Expand Down Expand Up @@ -610,8 +608,7 @@ def run_scoring_for_local_model(self, model_conf):
score_one_model_fn = functools.partial(Forecaster.score_one_model, model=model)

res_sdf = (
src_df.repartition(100)
.groupby(self.conf["group_id"])
src_df.groupby(self.conf["group_id"])
.applyInPandas(score_one_model_fn, schema=output_schema)
)
if not isinstance(res_sdf.schema[self.conf["group_id"]].dataType, StringType):
Expand Down

0 comments on commit c5a6c4e

Please sign in to comment.