Skip to content

Commit 451dd04

Browse files
committed
Fix CreateCatalogItem lint
1 parent 8373231 commit 451dd04

1 file changed

Lines changed: 9 additions & 6 deletions

File tree

sdks/python/apache_beam/ml/gcp/recommendations_ai.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,11 @@ def get_recommendation_user_event_client():
7979

8080

8181
class CreateCatalogItem(PTransform):
82-
"""Creates catalogitem information.
83-
The ``PTransform`` returns a PCollectionTuple with a PCollections of
84-
successfully and failed created CatalogItems.
82+
"""Creates catalog item records.
83+
84+
The ``PTransform`` returns a ``PCollectionTuple`` of successfully created
85+
catalog items (``created_catalog_items``) and failures
86+
(``failed_catalog_items``).
8587
8688
Example usage::
8789
@@ -125,14 +127,15 @@ def expand(self, pcoll):
125127
raise ValueError(
126128
"""GCP project name needs to be specified in "project" pipeline
127129
option""")
128-
return pcoll | ParDo(
130+
pardo = ParDo(
129131
_CreateCatalogItemFn(
130132
self.project,
131133
self.retry,
132134
self.timeout,
133135
self.metadata,
134-
self.catalog_name)).with_outputs(
135-
FAILED_CATALOG_ITEMS, main='created_catalog_items')
136+
self.catalog_name))
137+
return pardo.with_outputs(
138+
FAILED_CATALOG_ITEMS, main='created_catalog_items')
136139

137140

138141
class _CreateCatalogItemFn(DoFn):

0 commit comments

Comments
 (0)