From f5102b476fc5f42673e5052d60672a72764689e1 Mon Sep 17 00:00:00 2001 From: Jeffrey Kinard Date: Thu, 21 Nov 2024 13:37:52 -0500 Subject: [PATCH 1/2] [yaml] remove PubSubLite from API docs Signed-off-by: Jeffrey Kinard --- sdks/python/apache_beam/yaml/generate_yaml_docs.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/sdks/python/apache_beam/yaml/generate_yaml_docs.py b/sdks/python/apache_beam/yaml/generate_yaml_docs.py index 2123c7a9f202..d11360cc4aeb 100644 --- a/sdks/python/apache_beam/yaml/generate_yaml_docs.py +++ b/sdks/python/apache_beam/yaml/generate_yaml_docs.py @@ -189,11 +189,11 @@ def io_grouping_key(transform_name): return 0, transform_name -SKIP = [ - 'Combine', - 'Filter', - 'MapToFields', -] +# Deprecated providers +SKIP = { + 'ReadFromPubSubLite', + 'WriteToPubSubLite', +} def transform_docs(transform_base, transforms, providers, extra_docs=''): @@ -236,7 +236,8 @@ def main(): options = parser.parse_args() include = re.compile(options.include).match exclude = ( - re.compile(options.exclude).match if options.exclude else lambda _: False) + re.compile(options.exclude).match + if options.exclude else lambda x: x in SKIP) with subprocess_server.SubprocessServer.cache_subprocesses(): json_config_schemas = [] From 9219a49cce4424ecfaffbd4c04728d6d4576bd41 Mon Sep 17 00:00:00 2001 From: Jeffrey Kinard Date: Tue, 3 Dec 2024 19:42:06 -0500 Subject: [PATCH 2/2] add deprecation note Signed-off-by: Jeffrey Kinard --- .../pubsublite/PubsubLiteReadSchemaTransformProvider.java | 7 +++++++ .../pubsublite/PubsubLiteWriteSchemaTransformProvider.java | 7 +++++++ sdks/python/apache_beam/yaml/generate_yaml_docs.py | 7 ++----- 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/pubsublite/PubsubLiteReadSchemaTransformProvider.java b/sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/pubsublite/PubsubLiteReadSchemaTransformProvider.java index 9e83619f7b8d..61b94aeee445 100644 --- a/sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/pubsublite/PubsubLiteReadSchemaTransformProvider.java +++ b/sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/pubsublite/PubsubLiteReadSchemaTransformProvider.java @@ -87,6 +87,13 @@ protected Class configurationClass() return PubsubLiteReadSchemaTransformConfiguration.class; } + @Override + public String description() { + return "Performs a read from Google Pub/Sub Lite.\n" + + "\n" + + "**Note**: This provider is deprecated. See Pub/Sub Lite documentation for more information."; + } + public static class ErrorFn extends DoFn { private final SerializableFunction valueMapper; private final Counter errorCounter; diff --git a/sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/pubsublite/PubsubLiteWriteSchemaTransformProvider.java b/sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/pubsublite/PubsubLiteWriteSchemaTransformProvider.java index ebca921c57e1..54ed7ac495d9 100644 --- a/sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/pubsublite/PubsubLiteWriteSchemaTransformProvider.java +++ b/sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/pubsublite/PubsubLiteWriteSchemaTransformProvider.java @@ -82,6 +82,13 @@ protected Class configurationClass( return PubsubLiteWriteSchemaTransformConfiguration.class; } + @Override + public String description() { + return "Performs a write to Google Pub/Sub Lite.\n" + + "\n" + + "**Note**: This provider is deprecated. See Pub/Sub Lite documentation for more information."; + } + public static class ErrorCounterFn extends DoFn { private final SerializableFunction toBytesFn; private final Counter errorCounter; diff --git a/sdks/python/apache_beam/yaml/generate_yaml_docs.py b/sdks/python/apache_beam/yaml/generate_yaml_docs.py index d11360cc4aeb..38a888fdebe3 100644 --- a/sdks/python/apache_beam/yaml/generate_yaml_docs.py +++ b/sdks/python/apache_beam/yaml/generate_yaml_docs.py @@ -189,11 +189,8 @@ def io_grouping_key(transform_name): return 0, transform_name -# Deprecated providers -SKIP = { - 'ReadFromPubSubLite', - 'WriteToPubSubLite', -} +# Exclude providers +SKIP = {} def transform_docs(transform_base, transforms, providers, extra_docs=''):