Skip to content

Commit b3d629f

Browse files
committed
Improving documentation
1 parent 9e6f3c0 commit b3d629f

1 file changed

Lines changed: 12 additions & 2 deletions

File tree

sdks/python/apache_beam/runners/worker/statesampler.pyx

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,8 @@ cdef class StateSampler(object):
111111
def __init__(self, prefix, counter_factory,
112112
sampling_period_ms=DEFAULT_SAMPLING_PERIOD_MS):
113113

114-
# TODO(pabloem) - Remove this once the worker has been rebuilt(by 17/10/1).
114+
# TODO(pabloem) - Remove this once all dashed prefixes are removed from
115+
# the worker.
115116
# We stop using prefixes with included dash.
116117
self.prefix = prefix[:-1] if prefix[-1] == '-' else prefix
117118
self.counter_factory = counter_factory
@@ -184,7 +185,16 @@ cdef class StateSampler(object):
184185
self.state_transition_count)
185186

186187
def scoped_state(self, step_name, state_name=None, io_target=None):
187-
"""Returns a context manager managing transitions for a given state."""
188+
"""Returns a context manager managing transitions for a given state.
189+
Args:
190+
step_name: A string with the name of the running step.
191+
state_name: A string with the name of the state (e.g. 'process', 'start')
192+
io_target: An IOTargetName object describing the io_target (e.g. writing
193+
or reading to side inputs, shuffle or state). Will often be None.
194+
195+
Returns:
196+
A ScopedState for the set of step-state-io_target.
197+
"""
188198
cdef ScopedState scoped_state
189199
if state_name is None:
190200
# If state_name is None, the worker is still using old style

0 commit comments

Comments
 (0)