BigQuery-Agent-Analytics-SDK icon indicating copy to clipboard operation
BigQuery-Agent-Analytics-SDK copied to clipboard

Refactor: Rename CodeEvaluator to SystemEvaluator

Open gigistark-google opened this issue 6 months ago • 5 comments

Rename CodeEvaluator to SystemEvaluator to align with its focus on system-level metrics. A CodeEvaluator alias is kept in evaluators.py for backward-compatibility.

gigistark-google avatar May 06 '26 18:05 gigistark-google

Fresh follow-up after the existing REQUEST_CHANGES review:

One additional polish item I don't see captured yet:

Low / release-note gap — the public rename needs an Unreleased changelog entry and an alias policy.

This PR introduces SystemEvaluator as the preferred public name while keeping CodeEvaluator = SystemEvaluator as a compatibility alias. That's the right compatibility shape, but CHANGELOG.md still only documents the older CodeEvaluator behavior from v0.2.2 and has no note for the rename or the support policy for the alias.

Suggested addition under Unreleased after the rebase:

  • Added SystemEvaluator as the preferred name for deterministic/code-defined metrics.
  • Kept CodeEvaluator as a backward-compatible alias; state whether it is permanent or deprecated-but-supported.

That matters because users reading release notes need to know whether to migrate imports immediately or whether existing CodeEvaluator code remains supported.

caohy1988 avatar May 11 '26 22:05 caohy1988

Thanks Haiyuan! Addressed all comments on this PR.

gigistark-google avatar May 12 '26 20:05 gigistark-google

Addressed all prior feedback. Thanks for following up on this! Appreciate it!

gigistark-google avatar Jun 05 '26 16:06 gigistark-google

Fresh review against current head e861dc3.

The proposed follow-up comments check out against the source.

Findings:

  1. B1: CodeEvaluator().name contract changed. CodeEvaluator is now a true alias of SystemEvaluator, and CodeEvaluator().name resolves to system_evaluator instead of the legacy code_evaluator. That means EvaluationReport.evaluator_name changes for direct legacy constructor callers. This may be intentional, but it should be treated as a user-visible compatibility decision. Recommended resolution: keep the alias if that is the intended API shape, and document the evaluator-name change explicitly in the CHANGELOG/migration note.

  2. H1: notebook formatting noise is back. The notebook diff is still mostly reformat churn. My count on this head is about 2,601 changed notebook lines, with only 51 lines matching the evaluator rename surface. The exact count differs slightly from the earlier 2,595/43 number, but the conclusion is the same: the signal is buried in unrelated notebook churn.

  3. H2: deprecation wording and behavior disagree. The CHANGELOG says CodeEvaluator is “deprecated but supported,” but the current alias cannot emit a DeprecationWarning. Either add an actual warning path, or soften the wording to “backward-compatible alias” without calling it deprecated.

  4. H3: unrelated scope leaks remain. dashboard/app.py is import-formatting only, and scripts/quality_report.py removes a blank line. Neither has evaluator rename relevance; the quality_report.py hunk is also likely to conflict with #174 once that lands.

Additional process note: this PR is currently behind main and overlaps heavily with #123 in the evaluator migration surface. Before final review, please rebase after removing the notebook/scope noise and make the intended stack/merge order explicit so reviewers are not comparing stale migration text across overlapping PRs.

caohy1988 avatar Jun 05 '26 23:06 caohy1988

Thanks Haiyuan for your feedback on this! The latest round of feedback has been addressed.

gigistark-google avatar Jun 07 '26 20:06 gigistark-google

Thank you! Addressed these final requests.

gigistark-google avatar Jun 17 '26 21:06 gigistark-google