diff --git a/AUTHORS.md b/AUTHORS.md index 85a84db..842256b 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -59,3 +59,5 @@ Authors in order of the timeline of their contributions: - [martin-kokos](https://github.com/martin-kokos) for using tomli and tomli-w for dealing with tomli files. - [Alex Sauer-Budge](https://github.com/amsb) for the bugfix for `datetime.date`. - [William Jamieson](https://github.com/WilliamJamieson) for [NumPy 2.0 compatibility](https://github.com/seperman/deepdiff/pull/422) +- [Leo Sin](https://github.com/leoslf) for Supporting Python 3.12 in the build process +- [sf-tcalhoun](https://github.com/sf-tcalhoun) for fixing "Instantiating a Delta with a flat_dict_list unexpectedly mutates the flat_dict_list" diff --git a/CHANGELOG.md b/CHANGELOG.md index 24300d0..6769077 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,18 @@ # DeepDiff Change log +- v7-0-0 + - When verbose=2, return `new_path` when the `path` and `new_path` are different (for example when ignore_order=True and the index of items have changed). + - Dropping support for Python 3.7 + - Introducing serialize to flat rows for delta objects. + - fixes the issue with hashing `datetime.date` objects where it treated them as numbers instead of dates (fixes #445). + - upgrading orjson to the latest version + - Fix for bug when diffing two lists with ignore_order and providing compare_func + - Fixes "Wrong diff on list of strings" #438 + - Supporting Python 3.12 in the build process by [Leo Sin](https://github.com/leoslf) + - Fixes "Instantiating a Delta with a flat_dict_list unexpectedly mutates the flat_dict_list" #457 by [sf-tcalhoun](https://github.com/sf-tcalhoun) + - Fixes "Error on Delta With None Key and Removed Item from List" #441 + - Fixes "Error when comparing two nested dicts with 2 added fields" #450 + - Fixes "Error when subtracting Delta from a dictionary" #443 - v6-7-1 - Support for subtracting delta objects when iterable_compare_func is used. - Better handling of force adding a delta to an object. diff --git a/README.md b/README.md index e4a1f7c..b6590a9 100644 --- a/README.md +++ b/README.md @@ -23,6 +23,15 @@ Tested on Python 3.8+ and PyPy3. Please check the [ChangeLog](CHANGELOG.md) file for the detailed information. +DeepDiff 7-0-0 + +- DeepDiff 7 comes with an improved delta object. [Delta to flat dictionaries](https://zepworks.com/deepdiff/current/serialization.html#delta-serialize-to-flat-dictionaries) have undergone a major change. We have also introduced [Delta serialize to flat rows](https://zepworks.com/deepdiff/current/serialization.html#delta-serialize-to-flat-rows). +- Subtracting delta objects have dramatically improved at the cost of holding more metadata about the original objects. +- When `verbose=2`, and the "path" of an item has changed in a report between t1 and t2, we include it as `new_path`. +- `path(use_t2=True)` returns the correct path to t2 in any reported change in the [`tree view`](https://zepworks.com/deepdiff/current/view.html#tree-view) +- Python 3.7 support is dropped and Python 3.12 is officially supported. + + DeepDiff 6-7-1 - Support for subtracting delta objects when iterable_compare_func is used. diff --git a/docs/authors.rst b/docs/authors.rst index 317998d..5d18e02 100644 --- a/docs/authors.rst +++ b/docs/authors.rst @@ -84,6 +84,11 @@ Authors in order of the timeline of their contributions: - `Alex Sauer-Budge `__ for the bugfix for ``datetime.date``. - `William Jamieson `__ for `NumPy 2.0 compatibility `__ +- `Leo Sin `__ for Supporting Python 3.12 in + the build process +- `sf-tcalhoun `__ for fixing + “Instantiating a Delta with a flat_dict_list unexpectedly mutates the + flat_dict_list” .. _Sep Dehpour (Seperman): http://www.zepworks.com .. _Victor Hahn Castell: http://hahncastell.de diff --git a/docs/basics.rst b/docs/basics.rst index ede3224..b120303 100644 --- a/docs/basics.rst +++ b/docs/basics.rst @@ -45,6 +45,17 @@ Set verbose level to 2 in order to see the added or removed items with their val { 'dictionary_item_added': {'root[5]': 5, 'root[6]': 6}, 'dictionary_item_removed': {'root[4]': 4}} +Set verbose level to 2 includes new_path when the path has changed for a report between t1 and t2: + >>> t1 = [1, 3] + >>> t2 = [3, 2] + >>> + >>> + >>> diff = DeepDiff(t1, t2, ignore_order=True, verbose_level=2) + >>> pprint(diff) + {'values_changed': {'root[0]': {'new_path': 'root[1]', + 'new_value': 2, + 'old_value': 1}}} + String difference >>> t1 = {1:1, 2:2, 3:3, 4:{"a":"hello", "b":"world"}} >>> t2 = {1:1, 2:4, 3:3, 4:{"a":"hello", "b":"world!"}} diff --git a/docs/changelog.rst b/docs/changelog.rst index 3e44fd7..9cd1096 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -5,6 +5,30 @@ Changelog DeepDiff Changelog +- v7-0-0 + + - When verbose=2, return ``new_path`` when the ``path`` and + ``new_path`` are different (for example when ignore_order=True and + the index of items have changed). + - Dropping support for Python 3.7 + - Introducing serialize to flat rows for delta objects. + - fixes the issue with hashing ``datetime.date`` objects where it + treated them as numbers instead of dates (fixes #445). + - upgrading orjson to the latest version + - Fix for bug when diffing two lists with ignore_order and providing + compare_func + - Fixes “Wrong diff on list of strings” #438 + - Supporting Python 3.12 in the build process by `Leo + Sin `__ + - Fixes “Instantiating a Delta with a flat_dict_list unexpectedly + mutates the flat_dict_list” #457 by + `sf-tcalhoun `__ + - Fixes “Error on Delta With None Key and Removed Item from List” + #441 + - Fixes “Error when comparing two nested dicts with 2 added fields” + #450 + - Fixes “Error when subtracting Delta from a dictionary” #443 + - v6-7-1 - Support for subtracting delta objects when iterable_compare_func diff --git a/docs/index.rst b/docs/index.rst index e520c14..7783448 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -31,6 +31,24 @@ The DeepDiff library includes the following modules: What Is New *********** +DeepDiff 7-0-0 +-------------- + +- DeepDiff 7 comes with an improved delta object. `Delta to flat + dictionaries `__ + have undergone a major change. We have also introduced `Delta + serialize to flat + rows `__. +- Subtracting delta objects have dramatically improved at the cost of + holding more metadata about the original objects. +- When ``verbose=2``, and the “path” of an item has changed in a report + between t1 and t2, we include it as ``new_path``. +- ``path(use_t2=True)`` returns the correct path to t2 in any reported + change in the + ```tree view`` `__ +- Python 3.7 support is dropped and Python 3.12 is officially + supported. + DeepDiff 6-7-1 -------------- diff --git a/docs/view.rst b/docs/view.rst index 58ee755..f50fc9f 100644 --- a/docs/view.rst +++ b/docs/view.rst @@ -68,7 +68,7 @@ You can traverse through the tree elements! :up: Move up to the parent node aka parent level :down: Move down to the child node aka child level -:path(): Get the path to the current node in string representation, path(output_format='list') gives you the path in list representation. +:path(): Get the path to the current node in string representation, path(output_format='list') gives you the path in list representation. path(use_t2=True) gives you the path to t2. :t1: The first item in the current node that is being diffed :t2: The second item in the current node that is being diffed :additional: Additional information about the node i.e. repetition