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
7 changes: 3 additions & 4 deletions elementary/utils/json_utils.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
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]]):
if value is None:
Expand Down Expand Up @@ -83,9 +82,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
Expand Down
3 changes: 1 addition & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"

Expand Down
Loading