Skip to content

Commit b34a1b0

Browse files
committed
replace numpy with math
1 parent 272a40c commit b34a1b0

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

elementary/utils/json_utils.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import json
2+
import math
23
from typing import Any, List, Optional, Union
34

4-
import numpy as np
5+
56

67

78
def try_load_json(value: Optional[Union[str, dict, list]]):
@@ -83,9 +84,9 @@ def append_prefix_if_missing(string: str, prefix: str) -> str:
8384
def inf_and_nan_to_str(obj) -> Any:
8485
"""Replaces occurrences of float("nan") for float("infinity") in the given dict object."""
8586
if isinstance(obj, float):
86-
if np.isinf(obj):
87+
if math.isinf(obj):
8788
return "Infinity" if obj > 0 else "-Infinity"
88-
elif np.isnan(obj):
89+
elif math.isnan(obj):
8990
return "NaN"
9091
else:
9192
return obj

pyproject.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ documentation = "https://docs.elementary-data.com"
1313
packages = [{include = "elementary"}]
1414

1515
[tool.poetry.dependencies]
16-
# matches the versions supported by dbt as of v1.9, which are probably due to the limits of numpy 1.26.x
16+
# 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)
1717
python = ">=3.9,<3.13"
1818
click = ">=7.0,<9.0"
1919
dbt-core = ">=0.20,<2.0.0"
@@ -32,7 +32,6 @@ networkx = ">=2.3,<3"
3232
packaging = ">=20.9"
3333
azure-storage-blob = ">=12.11.0"
3434
pymsteams = ">=0.2.2,<1.0.0"
35-
numpy = "<2.0.0"
3635
tabulate = ">= 0.9.0"
3736
pytz = ">= 2025.1"
3837

0 commit comments

Comments
 (0)