diff --git a/sdks/python/apache_beam/transforms/fully_qualified_named_transform_test.py b/sdks/python/apache_beam/transforms/fully_qualified_named_transform_test.py index 940e9df6dd26e..ac07280023532 100644 --- a/sdks/python/apache_beam/transforms/fully_qualified_named_transform_test.py +++ b/sdks/python/apache_beam/transforms/fully_qualified_named_transform_test.py @@ -120,13 +120,29 @@ def test_glob_filter(self): FullyQualifiedNamedTransform._resolve('apache_beam.Row') @patch('importlib.import_module') - def test_resolve(self, mock_import_module): + def test_resolve_by_path_segment(self, mock_import_module): mock_import_module.return_value = None with FullyQualifiedNamedTransform.with_filter('*'): FullyQualifiedNamedTransform._resolve('a.b.c.d') mock_import_module.assert_has_calls( [call('a'), call('a.b'), call('a.b.c'), call('a.b.c.d')]) + def test_resolve(self): + # test _resolve with the module that is not exposed to the top level + with FullyQualifiedNamedTransform.with_filter('*'): + dataframe_transform = FullyQualifiedNamedTransform._resolve( + 'apache_beam.dataframe.transforms.DataframeTransform') + from apache_beam.dataframe.transforms import DataframeTransform + self.assertIs(dataframe_transform, DataframeTransform) + + # test _resolve with the module that will never be exposed + # to the top level in the future + with FullyQualifiedNamedTransform.with_filter('*'): + argument_placeholder = FullyQualifiedNamedTransform._resolve( + 'apache_beam.internal.util.ArgumentPlaceholder') + from apache_beam.internal.util import ArgumentPlaceholder + self.assertIs(argument_placeholder, ArgumentPlaceholder) + class _TestTransform(beam.PTransform): @classmethod