ihji commented on a change in pull request #13729:
URL: https://github.com/apache/beam/pull/13729#discussion_r591878343



##########
File path: sdks/python/apache_beam/runners/portability/expansion_service_test.py
##########
@@ -226,6 +230,27 @@ def from_runner_api_parameter(
     return PartitionTransform()
 
 
+class ExtractHtmlTitleDoFn(beam.DoFn):
+  def process(self, element):
+    from bs4 import BeautifulSoup
+    soup = BeautifulSoup(element, 'html.parser')
+    return [soup.title.string]
+
+
[email protected]_urn(TEST_PYTHON_BS4_URN, None)
+class ExtractHtmlTitleTransform(ptransform.PTransform):
+  def expand(self, pcoll):
+    return pcoll | 
beam.ParDo(ExtractHtmlTitleDoFn()).with_output_types(unicode)
+
+  def to_runner_api_parameter(self, unused_context):

Review comment:
       It's for defining Python ptransform and not specific to x-lang 
transforms. Python SDK doesn't have builder/registrar for x-lang transforms. In 
Python SDK, x-lang transforms are just ordinary ptransforms annotated with 
x-lang compatible urns.




----------------------------------------------------------------
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