Skip to content

Commit e3ebdca

Browse files
committed
add output_type_inferrer for the resolver function filter_property_equal
PiperOrigin-RevId: 653829750
1 parent 86df648 commit e3ebdca

File tree

1 file changed

+18
-4
lines changed

1 file changed

+18
-4
lines changed

tfx/dsl/input_resolution/canned_resolver_functions.py

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -627,8 +627,8 @@ def filter_property_equal(
627627
628628
filter_property_equal(
629629
[A, B, C],
630-
property_key='blessed',
631-
property_value=False,
630+
key='blessed',
631+
value=False,
632632
)
633633
634634
will return [C].
@@ -649,6 +649,13 @@ def filter_property_equal(
649649
)
650650

651651

652+
@filter_property_equal.output_type_inferrer
653+
def _infer_filter_property_equal_type(
654+
channel: channel_types.BaseChannel, **kwargs # pylint: disable=unused-argument
655+
):
656+
return channel.type
657+
658+
652659
@resolver_function.resolver_function
653660
def filter_custom_property_equal(
654661
artifacts,
@@ -665,8 +672,8 @@ def filter_custom_property_equal(
665672
666673
filter_custom_property_equal(
667674
[A, B, C],
668-
property_key='purity',
669-
property_value=2,
675+
key='purity',
676+
value=2,
670677
)
671678
672679
will return [C].
@@ -687,6 +694,13 @@ def filter_custom_property_equal(
687694
)
688695

689696

697+
@filter_custom_property_equal.output_type_inferrer
698+
def _infer_filter_custom_property_equal_type(
699+
channel: channel_types.BaseChannel, **kwargs # pylint: disable=unused-argument
700+
):
701+
return channel.type
702+
703+
690704
@resolver_function.resolver_function
691705
def _slice(artifacts, **kwargs):
692706
# It's important to not pass the None value which cannot be serialized to IR.

0 commit comments

Comments
 (0)