-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Closed
Labels
api: spannerIssues related to the Spanner API.Issues related to the Spanner API.type: questionRequest for information or clarification. Not an issue.Request for information or clarification. Not an issue.
Description
FYC, @dhermes / @chemelnucfin / @lukesneeringer .
PR #4618 introduced a backward-incompatible change to the way arguments to the KeyRange constructor are validated:
- Prior to the PR, the constructor required that the caller pass at least one of
start_open,start_closed,end_open, orend_closed. It verified that the caller passed at most one ofstart_open/start_closed, and at most one ofend_open/end_closed. If the caller passed astart_*argument, she could omit passing anend_*argument to indicate all keys greater than the start; likewise she could omit passing astart_*argument if she passed anend_*argument to indicate all keys less than the end. - After the PR, the constructor requires that the caller pass exactly one of
start_open/start_closedand exactly one ofend_open/end_closed. If the caller wants to include all keys lower / greater than the passedend_*/start_*, the new implementation requires that she pass an empty key for the other end.
I would argue that the new surface is inferior: the KeyRange is perfectly capable of divining the intent when only one of the four arguments is passed, and could assign the now-required-to-be-passed value itself.
Metadata
Metadata
Assignees
Labels
api: spannerIssues related to the Spanner API.Issues related to the Spanner API.type: questionRequest for information or clarification. Not an issue.Request for information or clarification. Not an issue.