You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by GitBox <gi...@apache.org> on 2022/06/10 20:08:45 UTC

[GitHub] [beam] ryanthompson591 commented on a diff in pull request #21777: Make keying of examples explicit.

ryanthompson591 commented on code in PR #21777:
URL: https://github.com/apache/beam/pull/21777#discussion_r894853598


##########
sdks/python/apache_beam/ml/inference/base.py:
##########
@@ -93,6 +95,100 @@ def batch_elements_kwargs(self) -> Mapping[str, Any]:
     return {}
 
 
+class KeyedModelHandler(Generic[KeyT, ExampleT, PredictionT, ModelT],

Review Comment:
   I wonder if there's any way to make this more readable or simple.  All these nested lists are making my eyes a little buggy.
   
   Can we perhaps use constants here?
   BASIC_MODEL_HANDLER = ModelHandler[Tuple[KeyT, ExampleT]
   KEYED_PREDICTION = Tuple[KeyT, PredictionT]
   
   Or are there any other ways to make some of this templating go away?



-- 
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-unsubscribe@beam.apache.org

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