From bdc6b0ac1f3fa475980dcf2788a275535d73ee72 Mon Sep 17 00:00:00 2001 From: David Gardner Date: Fri, 21 Nov 2025 10:41:43 -0800 Subject: [PATCH 1/5] Don't uninstall dask Signed-off-by: David Gardner --- .../notebooks/getting_started_with_nat.ipynb | 13 +------------ .../notebooks/mcp_setup_and_integration.ipynb | 18 ------------------ 2 files changed, 1 insertion(+), 30 deletions(-) diff --git a/examples/notebooks/getting_started_with_nat.ipynb b/examples/notebooks/getting_started_with_nat.ipynb index 068eb63520..e435275f1a 100644 --- a/examples/notebooks/getting_started_with_nat.ipynb +++ b/examples/notebooks/getting_started_with_nat.ipynb @@ -434,18 +434,7 @@ "\n", "## 2.2) Run as a NAT server\n", "\n", - "NAT provides another mechanism for running workflows through `nat serve`. `nat serve` creates and launches a REST FastAPI web server for interfacing with the toolkit as though it was an OpenAI-compatible endpoint. To learn more about all endpoints served by `nat serve`, please consult [this documentation](https://docs.nvidia.com/nemo/agent-toolkit/latest/reference/api-server-endpoints.html).\n", - "\n", - "note: If running this notebook in a cloud provider such as Google Colab, `dask` may be installed. If it is, you will first have to uninstall it via:" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "!uv pip uninstall dask" + "NAT provides another mechanism for running workflows through `nat serve`. `nat serve` creates and launches a REST FastAPI web server for interfacing with the toolkit as though it was an OpenAI-compatible endpoint. To learn more about all endpoints served by `nat serve`, please consult [this documentation](https://docs.nvidia.com/nemo/agent-toolkit/latest/reference/api-server-endpoints.html)." ] }, { diff --git a/examples/notebooks/mcp_setup_and_integration.ipynb b/examples/notebooks/mcp_setup_and_integration.ipynb index 9aa957d867..e500f0defe 100644 --- a/examples/notebooks/mcp_setup_and_integration.ipynb +++ b/examples/notebooks/mcp_setup_and_integration.ipynb @@ -1118,24 +1118,6 @@ "time.sleep(10)" ] }, - { - "cell_type": "markdown", - "id": "4c34f7ed", - "metadata": {}, - "source": [ - "note: If running this notebook in a cloud provider such as Google Colab, `dask` may be installed. If it is, you will first have to uninstall it via:" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "c8df6918", - "metadata": {}, - "outputs": [], - "source": [ - "#!uv pip uninstall dask" - ] - }, { "cell_type": "code", "execution_count": null, From 939221967203142cf386a3246b337d7946e53a85 Mon Sep 17 00:00:00 2001 From: David Gardner Date: Fri, 21 Nov 2025 14:21:10 -0800 Subject: [PATCH 2/5] Don't reload the span module in the fixture, this causes pydantic type checks to fail in other modules which have already imported the span module Signed-off-by: David Gardner --- .../tests/test_simple_calc_observability.py | 26 +++++++++++-------- 1 file changed, 15 insertions(+), 11 deletions(-) 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") From 9949fc634f342a23c9a4bdd8f2507ad8480f0c16 Mon Sep 17 00:00:00 2001 From: David Gardner Date: Fri, 21 Nov 2025 14:38:38 -0800 Subject: [PATCH 3/5] Revert "Don't uninstall dask" This reverts commit bdc6b0ac1f3fa475980dcf2788a275535d73ee72. Signed-off-by: David Gardner --- .../notebooks/getting_started_with_nat.ipynb | 13 ++++++++++++- .../notebooks/mcp_setup_and_integration.ipynb | 18 ++++++++++++++++++ 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/examples/notebooks/getting_started_with_nat.ipynb b/examples/notebooks/getting_started_with_nat.ipynb index e435275f1a..068eb63520 100644 --- a/examples/notebooks/getting_started_with_nat.ipynb +++ b/examples/notebooks/getting_started_with_nat.ipynb @@ -434,7 +434,18 @@ "\n", "## 2.2) Run as a NAT server\n", "\n", - "NAT provides another mechanism for running workflows through `nat serve`. `nat serve` creates and launches a REST FastAPI web server for interfacing with the toolkit as though it was an OpenAI-compatible endpoint. To learn more about all endpoints served by `nat serve`, please consult [this documentation](https://docs.nvidia.com/nemo/agent-toolkit/latest/reference/api-server-endpoints.html)." + "NAT provides another mechanism for running workflows through `nat serve`. `nat serve` creates and launches a REST FastAPI web server for interfacing with the toolkit as though it was an OpenAI-compatible endpoint. To learn more about all endpoints served by `nat serve`, please consult [this documentation](https://docs.nvidia.com/nemo/agent-toolkit/latest/reference/api-server-endpoints.html).\n", + "\n", + "note: If running this notebook in a cloud provider such as Google Colab, `dask` may be installed. If it is, you will first have to uninstall it via:" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "!uv pip uninstall dask" ] }, { diff --git a/examples/notebooks/mcp_setup_and_integration.ipynb b/examples/notebooks/mcp_setup_and_integration.ipynb index e500f0defe..9aa957d867 100644 --- a/examples/notebooks/mcp_setup_and_integration.ipynb +++ b/examples/notebooks/mcp_setup_and_integration.ipynb @@ -1118,6 +1118,24 @@ "time.sleep(10)" ] }, + { + "cell_type": "markdown", + "id": "4c34f7ed", + "metadata": {}, + "source": [ + "note: If running this notebook in a cloud provider such as Google Colab, `dask` may be installed. If it is, you will first have to uninstall it via:" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "c8df6918", + "metadata": {}, + "outputs": [], + "source": [ + "#!uv pip uninstall dask" + ] + }, { "cell_type": "code", "execution_count": null, From 7a5a360199f82969de5bbd8957d015e292a0c57b Mon Sep 17 00:00:00 2001 From: David Gardner Date: Fri, 21 Nov 2025 15:43:31 -0800 Subject: [PATCH 4/5] Apply the skip_e2e_test tag to the uninstall command so that the tests are not altering the installed packages Signed-off-by: David Gardner --- examples/notebooks/getting_started_with_nat.ipynb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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" From 8e3f6e3792209f7a6a24b4e14c6f58450ad443cc Mon Sep 17 00:00:00 2001 From: David Gardner Date: Fri, 21 Nov 2025 17:25:06 -0800 Subject: [PATCH 5/5] Silence a warning emitted by strands Signed-off-by: David Gardner --- pyproject.toml | 2 ++ 1 file changed, 2 insertions(+) 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"