Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion examples/notebooks/getting_started_with_nat.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,11 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"metadata": {
"tags": [
"skip_e2e_test"
]
},
"outputs": [],
"source": [
"!uv pip uninstall dask"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@
# limitations under the License.

import asyncio
import importlib
import json
import os
import random
import time
import types
Expand Down Expand Up @@ -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")
Expand Down
2 changes: 2 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down