Skip to content
Open
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
2 changes: 1 addition & 1 deletion .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 9.0.0
current_version = 9.1.0
commit = False
tag = False
tag_name = {new_version}
Expand Down
2 changes: 1 addition & 1 deletion CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ authors:
given-names: "Sep"
orcid: "https://orcid.org/0009-0009-5828-4345"
title: "DeepDiff"
version: 9.0.0
version: 9.1.0
date-released: 2026
url: "https://github.com/seperman/deepdiff"
2 changes: 1 addition & 1 deletion deepdiff/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""This module offers the DeepDiff, DeepSearch, grep, Delta and DeepHash classes."""
# flake8: noqa
__version__ = '9.0.0'
__version__ = '9.1.0'
import logging

if __name__ == '__main__':
Expand Down
2 changes: 1 addition & 1 deletion deepdiff/docstrings/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
contain the root `toctree` directive.


DeepDiff 9.0.0 documentation!
DeepDiff 9.1.0 documentation!
=============================

.. |qluster_link| raw:: html
Expand Down
3 changes: 2 additions & 1 deletion deepdiff/helper.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import sys
import re
import os
import math
import datetime
import uuid
import logging
Expand Down Expand Up @@ -513,7 +514,7 @@ def number_to_string(number: Any, significant_digits: int, number_format_notatio
else:
number = round(number=number, ndigits=significant_digits) # type: ignore

if significant_digits == 0:
if significant_digits == 0 and math.isfinite(number): # type: ignore
number = int(number) # type: ignore

if number == 0.0:
Expand Down
4 changes: 2 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@
# built documents.
#
# The short X.Y version.
version = '9.0.0'
version = '9.1.0'
# The full version, including alpha/beta/rc tags.
release = '9.0.0'
release = '9.1.0'

load_dotenv(override=True)
DOC_VERSION = os.environ.get('DOC_VERSION', version)
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "flit_core.buildapi"

[project]
name = "deepdiff"
version = "9.0.0"
version = "9.1.0"
dependencies = [
"cachebox>=5.2,<6",
"orderly-set>=5.5.0,<6",
Expand Down
23 changes: 23 additions & 0 deletions tests/test_diff_text.py
Original file line number Diff line number Diff line change
Expand Up @@ -1877,6 +1877,29 @@ def gen2():
def test_ignore_nan_inequality(self, t1, t2, params, expected_result):
assert expected_result == list(DeepDiff(t1, t2, **params).keys())

@pytest.mark.parametrize('t1, t2, params', [
(float('nan'), float('nan'), {'significant_digits': 0}),
(float('nan'), float('nan'), {'significant_digits': 2}),
(float('inf'), float('inf'), {'significant_digits': 0}),
(float('inf'), float('inf'), {'significant_digits': 2}),
(float('-inf'), float('-inf'), {'significant_digits': 0}),
(float('-inf'), float('-inf'), {'significant_digits': 2}),
({'a': float('nan'), 'b': 1.5}, {'a': float('nan'), 'b': 2.7},
{'significant_digits': 0}),
({'a': float('inf')}, {'a': float('inf')},
{'significant_digits': 0}),
])
def test_significant_digits_with_nan_inf(self, t1, t2, params):
"""
Test that significant_digits does not crash with NaN or Inf values.
Regression test for ValueError/OverflowError when converting NaN/Inf
to int in number_to_string with significant_digits=0.
"""
try:
DeepDiff(t1, t2, **params)
except (ValueError, OverflowError) as e:
pytest.fail(f"DeepDiff with {params} on {t1!r} raised {type(e).__name__}: {e}")

@pytest.mark.parametrize('ignore_order, ignore_private_variables, expected', [
(True, True, {}),
(False, True, {}),
Expand Down