Skip to content

Commit 681eeeb

Browse files
mtopo27claude
andcommitted
fix(preprod): Rename variable to fix mypy shadowing error
Use `detector_base_metric` to avoid shadowing the outer `base_metric` variable, which caused an incompatible assignment and unreachable statement error in mypy. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 32989ef commit 681eeeb

File tree

1 file changed

+5
-5
lines changed
  • src/sentry/preprod/size_analysis

1 file changed

+5
-5
lines changed

src/sentry/preprod/size_analysis/tasks.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -673,14 +673,14 @@ def _maybe_emit_issues_from_diff_size_results(
673673
)
674674
continue
675675

676-
base_metric = base_artifact_to_metric.get(base_artifact.id)
677-
if base_metric is None:
676+
detector_base_metric = base_artifact_to_metric.get(base_artifact.id)
677+
if detector_base_metric is None:
678678
continue
679679

680680
metadata: SizeAnalysisMetadata = {
681681
"platform": _get_platform(artifact),
682682
"head_metric_id": head_metric.id,
683-
"base_metric_id": base_metric.id,
683+
"base_metric_id": detector_base_metric.id,
684684
"head_artifact_id": artifact.id,
685685
"base_artifact_id": base_artifact.id,
686686
"head_artifact": artifact,
@@ -690,8 +690,8 @@ def _maybe_emit_issues_from_diff_size_results(
690690
size_data: SizeAnalysisValue = {
691691
"head_install_size_bytes": head_metric.max_install_size or 0,
692692
"head_download_size_bytes": head_metric.max_download_size or 0,
693-
"base_install_size_bytes": base_metric.max_install_size or 0,
694-
"base_download_size_bytes": base_metric.max_download_size or 0,
693+
"base_install_size_bytes": detector_base_metric.max_install_size or 0,
694+
"base_download_size_bytes": detector_base_metric.max_download_size or 0,
695695
"metadata": metadata,
696696
}
697697

0 commit comments

Comments
 (0)