Skip to content

Commit

Permalink
Add extra test case, TODO
Browse files Browse the repository at this point in the history
  • Loading branch information
jrmccluskey committed Nov 6, 2023
1 parent dac4061 commit c2148fa
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions sdks/python/apache_beam/typehints/typehints.py
Original file line number Diff line number Diff line change
Expand Up @@ -1043,6 +1043,8 @@ def _is_subclass_constraint(sub):
FrozenSetTypeConstraint,
SetTypeConstraint))

# TODO(https://github.com/apache/beam/issues/29135): allow for consistency
# with Mapping types
def _consistent_with_check_(self, sub):
if self._is_subclass_constraint(sub):
return is_consistent_with(sub.inner_type, self.inner_type)
Expand Down
1 change: 1 addition & 0 deletions sdks/python/apache_beam/typehints/typehints_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -873,6 +873,7 @@ def test_type_constraint_compatibility(self):
self.assertCompatible(
typehints.Collection[typehints.Any], typehints.Collection[int])
self.assertCompatible(typehints.Collection[int], typehints.Tuple[int])
self.assertCompatible(typehints.Any, typehints.Collection[str])

def test_one_way_compatibility(self):
self.assertNotCompatible(typehints.Set[int], typehints.Collection[int])
Expand Down

0 comments on commit c2148fa

Please sign in to comment.