From 5208c14e60f3e92a19284f8909c70b437435bead Mon Sep 17 00:00:00 2001 From: Gianluca Cacace Date: Fri, 17 Apr 2026 23:47:22 +0000 Subject: [PATCH 1/3] Merge customizations for CloudWatch OTel enrichment --- botocore/__init__.py | 6 ++++++ tests/unit/test_utils.py | 12 ++++++++++++ 2 files changed, 18 insertions(+) diff --git a/botocore/__init__.py b/botocore/__init__.py index eb87143e40..7257f4b1b3 100644 --- a/botocore/__init__.py +++ b/botocore/__init__.py @@ -104,6 +104,8 @@ 'GetLinkedWhatsAppBusinessAccountPhoneNumber', '-', ): 'get-linked-whatsapp-business-account-phone-number', + ('GetOTelEnrichment', '_'): 'get_otel_enrichment', + ('GetOTelEnrichment', '-'): 'get-otel-enrichment', ('GetWhatsAppMessageMedia', '_'): 'get_whatsapp_message_media', ('GetWhatsAppMessageMedia', '-'): 'get-whatsapp-message-media', ('GetWhatsAppMessageTemplate', '_'): 'get_whatsapp_message_template', @@ -132,6 +134,10 @@ ): 'put-whatsapp-business-account-event-destinations', ('SendWhatsAppMessage', '_'): 'send_whatsapp_message', ('SendWhatsAppMessage', '-'): 'send-whatsapp-message', + ('StartOTelEnrichment', '_'): 'start_otel_enrichment', + ('StartOTelEnrichment', '-'): 'start-otel-enrichment', + ('StopOTelEnrichment', '_'): 'stop_otel_enrichment', + ('StopOTelEnrichment', '-'): 'stop-otel-enrichment', ('UpdateWhatsAppMessageTemplate', '_'): 'update_whatsapp_message_template', ('UpdateWhatsAppMessageTemplate', '-'): 'update-whatsapp-message-template', } diff --git a/tests/unit/test_utils.py b/tests/unit/test_utils.py index afac117765..96a485a1c2 100644 --- a/tests/unit/test_utils.py +++ b/tests/unit/test_utils.py @@ -330,6 +330,10 @@ def test_special_cases(self): xform_name('GetLinkedWhatsAppBusinessAccountPhoneNumber', '-'), 'get-linked-whatsapp-business-account-phone-number', ) + self.assertEqual( + xform_name('GetOTelEnrichment', '-'), + 'get-otel-enrichment', + ) self.assertEqual( xform_name('GetWhatsAppMessageMedia', '-'), 'get-whatsapp-message-media', @@ -361,6 +365,14 @@ def test_special_cases(self): self.assertEqual( xform_name('SendWhatsAppMessage', '-'), 'send-whatsapp-message' ) + self.assertEqual( + xform_name('StartOTelEnrichment', '-'), + 'start-otel-enrichment', + ) + self.assertEqual( + xform_name('StopOTelEnrichment', '-'), + 'stop-otel-enrichment', + ) self.assertEqual( xform_name('UpdateWhatsAppMessageTemplate', '-'), 'update-whatsapp-message-template', From cd619ff3e61c60d6da232c5d504e53fcc9004a2b Mon Sep 17 00:00:00 2001 From: SamRemis Date: Thu, 23 Apr 2026 12:14:16 -0400 Subject: [PATCH 2/3] Add hidden aliases for otel operations --- botocore/handlers.py | 12 ++++++ tests/functional/test_cloudwatch.py | 59 +++++++++++++++++++++++++++++ 2 files changed, 71 insertions(+) create mode 100644 tests/functional/test_cloudwatch.py diff --git a/botocore/handlers.py b/botocore/handlers.py index 473c314fe3..675a763939 100644 --- a/botocore/handlers.py +++ b/botocore/handlers.py @@ -1494,6 +1494,18 @@ def get_bearer_auth_supported_services(): 'getattr.socialmessaging.delete_whatsapp_media_message', ClientMethodAlias('delete_whatsapp_message_media'), ), + ( + 'getattr.cloudwatch.get_o_tel_enrichment', + ClientMethodAlias('get_otel_enrichment'), + ), + ( + 'getattr.cloudwatch.start_o_tel_enrichment', + ClientMethodAlias('start_otel_enrichment'), + ), + ( + 'getattr.cloudwatch.stop_o_tel_enrichment', + ClientMethodAlias('stop_otel_enrichment'), + ), ( 'before-parameter-build.s3.UploadPart', convert_body_to_file_like_object, diff --git a/tests/functional/test_cloudwatch.py b/tests/functional/test_cloudwatch.py new file mode 100644 index 0000000000..94a81493d3 --- /dev/null +++ b/tests/functional/test_cloudwatch.py @@ -0,0 +1,59 @@ +# Copyright 2026 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"). You +# may not use this file except in compliance with the License. A copy of +# the License is located at +# +# http://aws.amazon.com/apache2.0/ +# +# or in the "license" file accompanying this file. This file is +# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF +# ANY KIND, either express or implied. See the License for the specific +# language governing permissions and limitations under the License. +import pytest + +from botocore import xform_name +from botocore.session import get_session +from botocore.stub import Stubber + +_OTEL_OPERATIONS = [ + 'GetOTelEnrichment', + 'StartOTelEnrichment', + 'StopOTelEnrichment', +] + + +@pytest.mark.validates_models +@pytest.mark.parametrize("operation", _OTEL_OPERATIONS) +def test_otel_xform_name(operation): + assert 'otel' in xform_name(operation, '_') + assert 'otel' in xform_name(operation, '-') + + +class TestCloudWatchOTelEnrichment: + def setup_method(self): + session = get_session() + self.client = session.create_client('cloudwatch', 'us-east-1') + self.stubber = Stubber(self.client) + self.stubber.activate() + + @pytest.mark.parametrize( + "old_name, new_name, response", + [ + ( + 'get_o_tel_enrichment', + 'get_otel_enrichment', + {'Status': 'Running'}, + ), + ('start_o_tel_enrichment', 'start_otel_enrichment', {}), + ('stop_o_tel_enrichment', 'stop_otel_enrichment', {}), + ], + ) + def test_otel_enrichment_aliased(self, old_name, new_name, response): + self.stubber.add_response(new_name, response) + self.stubber.add_response(new_name, response) + + getattr(self.client, old_name)() + getattr(self.client, new_name)() + + self.stubber.assert_no_pending_responses() From acc2870b89609d63f6e650aede72b27bce95f1cb Mon Sep 17 00:00:00 2001 From: SamRemis Date: Thu, 23 Apr 2026 14:14:47 -0400 Subject: [PATCH 3/3] Create bugfix-cloudwatch-91803.json --- .changes/next-release/bugfix-cloudwatch-91803.json | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changes/next-release/bugfix-cloudwatch-91803.json diff --git a/.changes/next-release/bugfix-cloudwatch-91803.json b/.changes/next-release/bugfix-cloudwatch-91803.json new file mode 100644 index 0000000000..dc903f3723 --- /dev/null +++ b/.changes/next-release/bugfix-cloudwatch-91803.json @@ -0,0 +1,5 @@ +{ + "type": "bugfix", + "category": "``cloudwatch``", + "description": "Alias ``get_o_tel_enrichment``, ``start_o_tel_enrichment``, and ``stop_o_tel_enrichment`` botocore methods to use ``otel`` instead of ``o_tel``." +}