Skip to content

Conversation

@misolt
Copy link
Member

@misolt misolt commented Aug 29, 2025

This is the first step of a refactor, which is meant to simplify how the queries are built for assessment.

Change the flow of assessment to avoid the partial-substitution trick while creating tasks:

String overrideWhere = arguments.getDefinition(propertyWhere);
if (overrideWhere != null) {
  // Partially format the SQL template by re-introducing the first format specifier.
  return String.format(defaultSql, "%1$s", " WHERE " + overrideWhere);
}

Instead, apply both substitutions in a single step (using AssessmentQuery#substitute).

@misolt misolt requested a review from kpiotrowski August 29, 2025 07:55
@misolt misolt changed the title Refactor: avoid getOverrideableQuery in Assessment flow [b/441876236] Refactor: don't substitute '%s' in Assessment flow Aug 29, 2025
@misolt misolt changed the title [b/441876236] Refactor: don't substitute '%s' in Assessment flow [b/441876236] Refactor: don't "partially format" in Assessment flow Aug 29, 2025
@misolt misolt merged commit e301ca9 into google:main Sep 1, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants