Thanks to visit codestin.com
Credit goes to github.com

Skip to content

KeyRange arguments change is backward-incompatible #4694

@tseaver

Description

@tseaver

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, or end_closed. It verified that the caller passed at most one of start_open / start_closed, and at most one of end_open / end_closed. If the caller passed a start_* argument, she could omit passing an end_* argument to indicate all keys greater than the start; likewise she could omit passing a start_* argument if she passed an end_* 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_closed and exactly one of end_open / end_closed. If the caller wants to include all keys lower / greater than the passed end_* / 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.type: questionRequest for information or clarification. Not an issue.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions