Skip to content

Commit 8824213

Browse files
authored
update sample 14 (#40)
1 parent 0dbe7bb commit 8824213

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Diff for: Python/pubsub/read_pubsub_subscription.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,17 @@ def run():
2828
class ReadPubSubOptions(PipelineOptions):
2929
@classmethod
3030
def _add_argparse_args(cls, parser):
31+
# Add a required flag to allow inputting a subscription from
32+
# the command line
3133
parser.add_argument(
3234
"--subscription",
3335
required=True,
3436
help="PubSub subscription to read.",
3537
)
36-
38+
# Create an instance of our custom options class
3739
options = ReadPubSubOptions(streaming=True)
3840

41+
# Read from the input PubSub subscription and log the output
3942
with beam.Pipeline(options=options) as p:
4043
(
4144
p
@@ -48,5 +51,4 @@ def _add_argparse_args(cls, parser):
4851

4952
if __name__ == "__main__":
5053
logging.getLogger().setLevel(logging.INFO)
51-
logging.info("Exit with Ctrl+C.")
5254
run()

0 commit comments

Comments
 (0)