shunping commented on code in PR #34709:
URL: https://github.com/apache/beam/pull/34709#discussion_r2054800454


##########
sdks/python/apache_beam/ml/anomaly/transforms.py:
##########
@@ -454,6 +454,13 @@ def _restore_and_convert(
         ])
     return orig_key, (temp_key, result)
 
+  def _select_features(self, elem: Tuple[Any,
+                                         beam.Row]) -> Tuple[Any, beam.Row]:
+    assert self._offline_detector._features is not None
+    k, v = elem
+    row_dict = v._asdict()
+    return k, beam.Row(**{k: row_dict[k] for k in 
self._offline_detector._features})  # pylint: disable=line-too-long

Review Comment:
   Adding a pair of brackets seem to make the formatter render it differently. 



##########
sdks/python/apache_beam/ml/anomaly/transforms.py:
##########
@@ -454,6 +454,13 @@ def _restore_and_convert(
         ])
     return orig_key, (temp_key, result)
 
+  def _select_features(self, elem: Tuple[Any,
+                                         beam.Row]) -> Tuple[Any, beam.Row]:
+    assert self._offline_detector._features is not None
+    k, v = elem
+    row_dict = v._asdict()
+    return k, beam.Row(**{k: row_dict[k] for k in 
self._offline_detector._features})  # pylint: disable=line-too-long

Review Comment:
   Adding a pair of brackets seems to make the formatter render it differently. 



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

To unsubscribe, e-mail: [email protected]

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

Reply via email to