saavannanavati commented on a change in pull request #12352: URL: https://github.com/apache/beam/pull/12352#discussion_r468329643
########## File path: sdks/python/apache_beam/runners/worker/opcounters.py ########## @@ -224,8 +230,25 @@ def _observable_callback_inner(value, is_encoded=False): return _observable_callback_inner + def type_check(self, value): + # type: (any, bool) -> None + for transform_label, type_constraint_tuple in self.output_type_constraints.items(): + parameter_name, constraint = type_constraint_tuple + if constraint is not None: + try: + _check_instance_type(constraint, value, parameter_name, verbose=True) + except TypeCheckError as e: + if not transform_label.startswith('ParDo'): Review comment: Okay, I pushed the logic up. The reason is so we stay consistent with how the [existing error message](https://github.com/apache/beam/blob/3e7371eae49b7aba142c8c0e898a62f583b49276/sdks/python/apache_beam/typehints/typecheck.py#L93) is formatted. ---------------------------------------------------------------- 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: us...@infra.apache.org