diff --git a/examples/notebooks/getting_started_with_nat.ipynb b/examples/notebooks/getting_started_with_nat.ipynb index 068eb63520..88e5c8c11f 100644 --- a/examples/notebooks/getting_started_with_nat.ipynb +++ b/examples/notebooks/getting_started_with_nat.ipynb @@ -442,7 +442,11 @@ { "cell_type": "code", "execution_count": null, - "metadata": {}, + "metadata": { + "tags": [ + "skip_e2e_test" + ] + }, "outputs": [], "source": [ "!uv pip uninstall dask" diff --git a/examples/observability/simple_calculator_observability/tests/test_simple_calc_observability.py b/examples/observability/simple_calculator_observability/tests/test_simple_calc_observability.py index 6af72004a0..d96e3b1205 100644 --- a/examples/observability/simple_calculator_observability/tests/test_simple_calc_observability.py +++ b/examples/observability/simple_calculator_observability/tests/test_simple_calc_observability.py @@ -14,9 +14,7 @@ # limitations under the License. import asyncio -import importlib import json -import os import random import time import types @@ -80,19 +78,25 @@ def fixture_weave_query(weave_attribute_key: str, weave_identifier: str) -> dict @pytest.fixture(name="aiq_compatibility_span_prefix") def aiq_compatibility_span_prefix_fixture(): + """ + The values of the SpanAttributes are defined on import based upon the NAT_SPAN_PREFIX environment variable. + Setting the environment variable after the fact has no impact. + """ from nat.data_models import span - orig_span_prefix = os.environ.get("NAT_SPAN_PREFIX") - os.environ["NAT_SPAN_PREFIX"] = "aiq" - importlib.reload(span) - yield + orig_span_prefix = span._SPAN_PREFIX - if orig_span_prefix is not None: - os.environ["NAT_SPAN_PREFIX"] = orig_span_prefix - else: - del os.environ["NAT_SPAN_PREFIX"] + orig_enum_values = {} + for enum_item in span.SpanAttributes: + enum_value = enum_item.value + if enum_value.startswith(f"{orig_span_prefix}."): + orig_enum_values[enum_item.name] = enum_value + enum_item._value_ = enum_value.replace(f"{orig_span_prefix}.", "aiq.", 1) + yield - importlib.reload(span) + span._SPAN_PREFIX = orig_span_prefix + for (enum_item_name, enum_value) in orig_enum_values.items(): + span.SpanAttributes[enum_item_name]._value_ = enum_value @pytest.fixture(name="weave_client") diff --git a/pyproject.toml b/pyproject.toml index 2ac99a4b38..6fdf6ed458 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -303,6 +303,8 @@ markers = [ "slow: Slow tests", ] filterwarnings = [ + # Work-around for a warning emitted by strands https://github.com/strands-agents/sdk-python/issues/1236 + "ignore:^These events have been moved to production.*strands:DeprecationWarning", ] testpaths = ["tests", "examples/**/tests", "packages/**/tests"] asyncio_mode = "auto"