[BEAM-14481] Remove unnecessary context by TheNeuralBit · Pull Request #17737 · apache/beam

This self.scoped_start_state context is unecessary. The previous logic did not create the ConsumerSet in the context, and the super().setup() call already applies the context itself:

def setup(self):
# type: () -> None
"""Set up operation.
This must be called before any other methods of the operation."""
with self.scoped_start_state:
self.debug_logging_enabled = logging.getLogger().isEnabledFor(
logging.DEBUG)

Unfortunately I don't quite understand the failure mode, so I'm not sure how to add a test that verifies the fix. For now I have just tested this change internally and found that it fixed the affected pipeline.

GitHub Actions Tests Status (on master branch)

Build python source distribution and wheels
Python tests
Java tests

See CI.md for more information about GitHub Actions CI.