From 1e5a616ffd7609ab7f0ef9c10ed6c14e0fdf2791 Mon Sep 17 00:00:00 2001 From: Stefan Krawczyk Date: Tue, 7 May 2024 17:45:44 -0700 Subject: [PATCH] Fixing unit tests --- ui/sdk/tests/tracking/test_stats.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/ui/sdk/tests/tracking/test_stats.py b/ui/sdk/tests/tracking/test_stats.py index 0e6f13ca4..10aa9a095 100644 --- a/ui/sdk/tests/tracking/test_stats.py +++ b/ui/sdk/tests/tracking/test_stats.py @@ -1,3 +1,4 @@ +import sys from collections import namedtuple from typing import NamedTuple @@ -41,6 +42,13 @@ def test_compute_stats_tuple_dataloader(): "test_node", {"hamilton.data_loader": True}, ) + # in python 3.11 numbers change + if sys.version_info >= (3, 11): + index = 132 + memory = 156 + else: + index = 128 + memory = 152 assert actual == { "observability_schema_version": "0.0.2", "observability_type": "dict", @@ -48,8 +56,8 @@ def test_compute_stats_tuple_dataloader(): "type": "", "value": { "CONNECTION_INFO": {"URL": "SOME_URL"}, - "DF_MEMORY_BREAKDOWN": {"Index": 128, "a": 24}, - "DF_MEMORY_TOTAL": 152, + "DF_MEMORY_BREAKDOWN": {"Index": index, "a": 24}, + "DF_MEMORY_TOTAL": memory, "QUERIED_TABLES": { "table-0": {"catalog": "FOO", "database": "BAR", "name": "TABLE"} },