diff --git a/sdks/python/apache_beam/yaml/generate_yaml_docs.py b/sdks/python/apache_beam/yaml/generate_yaml_docs.py index 592177dc2bc0..ae1a04661e62 100644 --- a/sdks/python/apache_beam/yaml/generate_yaml_docs.py +++ b/sdks/python/apache_beam/yaml/generate_yaml_docs.py @@ -32,6 +32,7 @@ from apache_beam.version import __version__ as beam_version from apache_beam.yaml import json_utils from apache_beam.yaml import yaml_provider +from apache_beam.yaml import yaml_utils from apache_beam.yaml.yaml_errors import ErrorHandlingConfig @@ -263,7 +264,12 @@ def create_index(include, exclude, options): with subprocess_server.SubprocessServer.cache_subprocesses(): json_config_schemas = [] markdown_out = io.StringIO() - providers = yaml_provider.standard_providers() + if options.provider_source_file: + providers = yaml_provider.merge_providers( + yaml_provider.load_providers( + yaml_utils.locate_data_file(options.provider_source_file))) + else: + providers = yaml_provider.standard_providers() for transform_base, transforms in itertools.groupby( sorted(providers.keys(), key=io_grouping_key), key=lambda s: s.split('-')[0]): @@ -557,6 +563,11 @@ def main(): parser.add_argument('--schema_file') parser.add_argument('--include', default='.*') parser.add_argument('--exclude', default='') + parser.add_argument( + "--provider_source_file", + help="Path to a YAML file containing custom providers. " + "If not provided, uses standard Beam providers.", + ) options = parser.parse_args() include = re.compile(options.include).match exclude = (