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


##########
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:
   > Also here it looks a bit strange to access _features (with underscore) on 
_offline_detector.
   
   Ack. I think it is fine as it is referred in the same package.
   



-- 
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: github-unsubscr...@beam.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to