Skip to content
This repository was archived by the owner on Apr 1, 2026. It is now read-only.

Commit e9877fd

Browse files
committed
removed cancel from spec
1 parent 8707d40 commit e9877fd

4 files changed

Lines changed: 0 additions & 22 deletions

File tree

google/cloud/bigtable/data/_async/mutations_batcher.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,6 @@ async def add_to_flow_with_metrics(
195195
try:
196196
value = await inner_generator.__anext__()
197197
except CrossSync.StopIteration:
198-
metric.cancel()
199198
return
200199
metric.flow_throttling_time_ns = time.monotonic_ns() - flow_start_time
201200
yield value, metric

google/cloud/bigtable/data/_metrics/data_model.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -368,13 +368,6 @@ def end_with_success(self):
368368
"""
369369
return self.end_with_status(StatusCode.OK)
370370

371-
def cancel(self):
372-
"""
373-
Called to cancel an operation without processing emitting it.
374-
"""
375-
for handler in self.handlers:
376-
handler.on_operation_cancelled(self)
377-
378371
@staticmethod
379372
def _exc_to_status(exc: BaseException) -> StatusCode:
380373
"""

google/cloud/bigtable/data/_metrics/handlers/_base.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,6 @@ def __init__(self, **kwargs):
2929
def on_operation_complete(self, op: CompletedOperationMetric) -> None:
3030
pass
3131

32-
def on_operation_cancelled(self, op: ActiveOperationMetric) -> None:
33-
pass
34-
3532
def on_attempt_complete(
3633
self, attempt: CompletedAttemptMetric, op: ActiveOperationMetric
3734
) -> None:

tests/unit/data/_metrics/test_data_model.py

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -545,17 +545,6 @@ def test_interceptor_metadata(self):
545545
assert key == OPERATION_INTERCEPTOR_METADATA_KEY
546546
assert value == metric.uuid
547547

548-
def test_cancel(self):
549-
"""
550-
cancel should call on_operation_cancelled on handlers
551-
"""
552-
handlers = [mock.Mock(), mock.Mock()]
553-
metric = self._make_one(mock.Mock(), handlers=handlers)
554-
metric.cancel()
555-
for h in handlers:
556-
assert h.on_operation_cancelled.call_count == 1
557-
assert h.on_operation_cancelled.call_args[0][0] == metric
558-
559548
def test_end_with_status_with_default_cluster_zone(self):
560549
"""
561550
ending the operation should use default cluster and zone if not set

0 commit comments

Comments
 (0)