udim commented on a change in pull request #14431:
URL: https://github.com/apache/beam/pull/14431#discussion_r618838488



##########
File path: examples/notebooks/tour-of-beam/reading-and-writing-data.ipynb
##########
@@ -348,36 +396,37 @@
           "base_uri": "https://localhost:8080/";
         },
         "id": "m8iXqE1CRnn5",
-        "outputId": "5c9fa281-1a05-4d20-ccdf-7899df6cc083"
+        "outputId": "4f28f0f9-6ba9-4814-ddab-7fed39e64640"
       },
       "source": [
         "import apache_beam as beam\n",
-        "\n",
-        "class Count(beam.PTransform):\n",
-        "  def __init__(self, n):\n",
-        "    self.n = n\n",
-        "\n",
-        "  @staticmethod\n",
-        "  def count(n):\n",
+        "from apache_beam.options.pipeline_options import PipelineOptions\n",
+        "from typing import Iterable\n",
+        "\n",
+        "@beam.ptransform_fn\n",
+        "@beam.typehints.with_input_types(beam.pvalue.PBegin)\n",
+        "@beam.typehints.with_output_types(int)\n",
+        "def Count(pcollection: beam.PCollection, n: int):\n",

Review comment:
       ```
           "def Count(pcollection: beam.pvalue.PBegin, n: int) -> 
beam.PCollection[int]:\n",
   ```




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to