Skip to content

Commit

Permalink
Fix new lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
geoffxy committed May 17, 2024
1 parent 919fd57 commit 9683936
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/brad/admin/run_planner.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,9 @@ async def run_planner_impl(args) -> None:
)
).build()

else:
raise RuntimeError(f"Unsupported workload source {args.workload_source}")

# 5. Load the pre-computed predictions.
prediction_dir = pathlib.Path(args.predictions_dir)
prediction_provider = PrecomputedPredictions.load(
Expand Down
2 changes: 2 additions & 0 deletions src/brad/cost_model/inference.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@ def predict(
self._feature_stats,
"AthenaEstSystemCardDetail",
)
else:
raise RuntimeError(f"Unsupported engine {str(self._engine)}")

preds = _infer_one_engine(loader, self._model)

Expand Down
2 changes: 2 additions & 0 deletions src/brad/planner/scoring/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,8 @@ def compute_engine_latency_norm_factor(self) -> None:
elif engine == Engine.Athena:
# No provisioning.
adjusted_latencies = predicted_base_latencies
else:
raise RuntimeError(f"Unsupported engine {str(engine)}")

# 3. Extract query weights (based on arrival frequency) and scale
# the run times.
Expand Down
2 changes: 2 additions & 0 deletions src/brad/provisioning/physical.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ def should_trigger_replan(self, overrides=None) -> bool:
df = redshift
elif engine == "aurora":
df = aurora
else:
raise RuntimeError(f"Unsupported engine {engine}")
metric_value = df[metric_name].iloc[-1]

print(f"Metric {metric_name}: {metric_value}")
Expand Down
2 changes: 2 additions & 0 deletions src/brad/utils/table_sizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ async def table_size_rows(
conn = self._engines.get_connection(Engine.Redshift)
elif location == Engine.Athena:
conn = self._engines.get_connection(Engine.Athena)
else:
raise RuntimeError(f"Unsupported engine location {str(location)}")

if approximate_allowed and location == Engine.Aurora:
# Special case since SELECT COUNT(*) on Aurora is generally slow.
Expand Down

0 comments on commit 9683936

Please sign in to comment.