From b34a1b09492b85f44871d6a5fb943aa52c363518 Mon Sep 17 00:00:00 2001 From: Vugar Yagubov Date: Mon, 15 Dec 2025 13:01:06 +0100 Subject: [PATCH 1/2] replace numpy with math --- elementary/utils/json_utils.py | 7 ++++--- pyproject.toml | 3 +-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/elementary/utils/json_utils.py b/elementary/utils/json_utils.py index d5a885a47..7b6169748 100644 --- a/elementary/utils/json_utils.py +++ b/elementary/utils/json_utils.py @@ -1,7 +1,8 @@ import json +import math from typing import Any, List, Optional, Union -import numpy as np + def try_load_json(value: Optional[Union[str, dict, list]]): @@ -83,9 +84,9 @@ def append_prefix_if_missing(string: str, prefix: str) -> str: def inf_and_nan_to_str(obj) -> Any: """Replaces occurrences of float("nan") for float("infinity") in the given dict object.""" if isinstance(obj, float): - if np.isinf(obj): + if math.isinf(obj): return "Infinity" if obj > 0 else "-Infinity" - elif np.isnan(obj): + elif math.isnan(obj): return "NaN" else: return obj diff --git a/pyproject.toml b/pyproject.toml index 5e08c4985..f7721cab0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -13,7 +13,7 @@ documentation = "https://docs.elementary-data.com" packages = [{include = "elementary"}] [tool.poetry.dependencies] -# matches the versions supported by dbt as of v1.9, which are probably due to the limits of numpy 1.26.x +# matches the versions supported by dbt as of v1.9, which are probably due to the limits of numpy 1.26.x(which was removed) python = ">=3.9,<3.13" click = ">=7.0,<9.0" dbt-core = ">=0.20,<2.0.0" @@ -32,7 +32,6 @@ networkx = ">=2.3,<3" packaging = ">=20.9" azure-storage-blob = ">=12.11.0" pymsteams = ">=0.2.2,<1.0.0" -numpy = "<2.0.0" tabulate = ">= 0.9.0" pytz = ">= 2025.1" From f2eb9e79fc873de04791163242958b4c9bd8a3eb Mon Sep 17 00:00:00 2001 From: Vugar Yagubov Date: Wed, 17 Dec 2025 13:35:44 +0100 Subject: [PATCH 2/2] dummy commit to run pre-commit --- elementary/utils/json_utils.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/elementary/utils/json_utils.py b/elementary/utils/json_utils.py index 7b6169748..d0e3ee3c1 100644 --- a/elementary/utils/json_utils.py +++ b/elementary/utils/json_utils.py @@ -3,8 +3,6 @@ from typing import Any, List, Optional, Union - - def try_load_json(value: Optional[Union[str, dict, list]]): if value is None: return None