Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add type hint to CounterCell #27522

Merged
merged 3 commits into from
Aug 23, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions sdks/python/apache_beam/metrics/cells.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,9 @@ class CounterCell(MetricCell):

Tracks the current value and delta of a counter metric.

Each cell tracks the state of a metric independently per context per bundle.
Therefore, each metric has a different cell in each bundle, cells are
aggregated by the runner.
Each cell tracks the state of an integer metric independently per context
per bundle. Therefore, each metric has a different cell in each bundle,
cells are aggregated by the runner.

This class is thread safe.
"""
Expand All @@ -126,6 +126,7 @@ def dec(self, n=1):
self.update(-n)

def update(self, value):
# type: (int) -> None
if cython.compiled:
ivalue = value
# Since We hold the GIL, no need for another lock.
Expand Down
Loading