diff --git a/AUTHORS.md b/AUTHORS.md index 79d9edb..1f8fe5c 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -63,5 +63,12 @@ Authors in order of the timeline of their contributions: - [sf-tcalhoun](https://github.com/sf-tcalhoun) for fixing "Instantiating a Delta with a flat_dict_list unexpectedly mutates the flat_dict_list" - [dtorres-sf](https://github.com/dtorres-sf) for fixing iterable moved items when iterable_compare_func is used. - [Florian Finkernagel](https://github.com/TyberiusPrime) for pandas and polars support. -- Mathis Chenuet [artemisart](https://github.com/artemisart) for fixing slots classes comparison. -- [Aaron D. Marasco](https://github.com/AaronDMarasco) added `prefix` option to `pretty()` +- Mathis Chenuet [artemisart](https://github.com/artemisart) for fixing slots classes comparison and PR review. +- Sherjeel Shabih [sherjeelshabih](https://github.com/sherjeelshabih) for fixing the issue where the key deep_distance is not returned when both compared items are equal #510 +- [Aaron D. Marasco](https://github.com/AaronDMarasco) for adding `prefix` option to `pretty()` +- [Juergen Skrotzky](https://github.com/Jorgen-VikingGod) for adding empty `py.typed` +- [Mate Valko](https://github.com/vmatt) for fixing the issue so we lower only if clean_key is instance of str via #504 +- [jlaba](https://github.com/jlaba) for fixing #493 include_paths, when only certain keys are included via #499 +- [Doron Behar](https://github.com/doronbehar) for fixing DeepHash for numpy booleans via #496 +- [Aaron D. Marasco](https://github.com/AaronDMarasco) for adding print() options which allows a user-defined string (or callback function) to prefix every output when using the pretty() call. +- [David Hotham](https://github.com/dimbleby) for relaxing orderly-set dependency via #486 diff --git a/CHANGELOG.md b/CHANGELOG.md index 61c4013..9273ca5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,10 +2,23 @@ - v8-1-0 - - Fixed slots-classes comparison. + - Removing deprecated lines from setup.py - Added `prefix` option to `pretty()` - - Relax `orderly-set` dependency. - Fixes hashing of numpy boolean values. + - Fixes __slots__ comparison when the attribute doesn't exist. + - Relaxing orderly-set reqs + - Added Python 3.13 support + - Only lower if clean_key is instance of str + - Only lower if clean_key is instance of str #504 + - Fixes issue where the key deep_distance is not returned when both compared items are equal + - Fixes issue where the key deep_distance is not returned when both compared items are equal #510 + - Fixes exclude_paths fails to work in certain cases + - exclude_paths fails to work #509 + - Fixes to_json() method chokes on standard json.dumps() kwargs such as sort_keys + - to_dict() method chokes on standard json.dumps() kwargs #490 + - Fixes accessing the affected_root_keys property on the diff object returned by DeepDiff fails when one of the dicts is empty + - In version 8.0.1, accessing the affected_root_keys property on the diff object returned by DeepDiff fails when one of the dicts is empty #508 + - v8-0-1 - Bugfix. Numpy should be optional. diff --git a/README.md b/README.md index 22d86dc..5636f17 100644 --- a/README.md +++ b/README.md @@ -23,6 +23,25 @@ Tested on Python 3.8+ and PyPy3. Please check the [ChangeLog](CHANGELOG.md) file for the detailed information. +DeepDiff 8-1-0 + +- Removing deprecated lines from setup.py +- Added `prefix` option to `pretty()` +- Fixes hashing of numpy boolean values. +- Fixes __slots__ comparison when the attribute doesn't exist. +- Relaxing orderly-set reqs +- Added Python 3.13 support +- Only lower if clean_key is instance of str +- Only lower if clean_key is instance of str #504 +- Fixes issue where the key deep_distance is not returned when both compared items are equal +- Fixes issue where the key deep_distance is not returned when both compared items are equal #510 +- Fixes exclude_paths fails to work in certain cases +- exclude_paths fails to work #509 +- Fixes to_json() method chokes on standard json.dumps() kwargs such as sort_keys +- to_dict() method chokes on standard json.dumps() kwargs #490 +- Fixes accessing the affected_root_keys property on the diff object returned by DeepDiff fails when one of the dicts is empty +- In version 8.0.1, accessing the affected_root_keys property on the diff object returned by DeepDiff fails when one of the dicts is empty #508 + DeepDiff 8-0-1 - Bugfix. Numpy should be optional. diff --git a/deepdiff/serialization.py b/deepdiff/serialization.py index 1ad12a5..13c1da6 100644 --- a/deepdiff/serialization.py +++ b/deepdiff/serialization.py @@ -44,6 +44,7 @@ from copy import deepcopy, copy from functools import partial from collections.abc import Mapping +from typing import Callable from deepdiff.helper import ( strings, get_type, @@ -306,11 +307,13 @@ def _to_delta_dict(self, directed=True, report_repetition_required=True, always_ return deepcopy(dict(result)) - def pretty(self, prefix=None): + def pretty(self, prefix: str | Callable=None): """ The pretty human readable string output for the diff object regardless of what view was used to generate the diff. + prefix can be a callable or a string or None. + Example: >>> t1={1,2,4} >>> t2={2,3} diff --git a/docs/authors.rst b/docs/authors.rst index 1ca60ae..1226d62 100644 --- a/docs/authors.rst +++ b/docs/authors.rst @@ -93,6 +93,24 @@ Authors in order of the timeline of their contributions: moved items when iterable_compare_func is used. - `Florian Finkernagel `__ for pandas and polars support. +- Mathis Chenuet `artemisart `__ for + fixing slots classes comparison and PR review. +- Sherjeel Shabih `sherjeelshabih `__ + for fixing the issue where the key deep_distance is not returned when + both compared items are equal #510 +- `Juergen Skrotzky `__ for adding + empty ``py.typed`` +- `Mate Valko `__ for fixing the issue so we + lower only if clean_key is instance of str via #504 +- `jlaba `__ for fixing #493 include_paths, + when only certain keys are included via #499 +- `Doron Behar `__ for fixing DeepHash + for numpy booleans via #496 +- `Aaron D. Marasco `__ for adding + print() options which allows a user-defined string (or callback + function) to prefix every output when using the pretty() call. +- `David Hotham `__ for relaxing + orderly-set dependency via #486 .. _Sep Dehpour (Seperman): http://www.zepworks.com .. _Victor Hahn Castell: http://hahncastell.de diff --git a/docs/index.rst b/docs/index.rst index dcaafef..bccdc8d 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -31,6 +31,32 @@ The DeepDiff library includes the following modules: What Is New *********** +DeepDiff v8-1-0 + + - Removing deprecated lines from setup.py + - Added ``prefix`` option to ``pretty()`` + - Fixes hashing of numpy boolean values. + - Fixes **slots** comparison when the attribute doesn’t exist. + - Relaxing orderly-set reqs + - Added Python 3.13 support + - Only lower if clean_key is instance of str + - Only lower if clean_key is instance of str #504 + - Fixes issue where the key deep_distance is not returned when both + compared items are equal + - Fixes issue where the key deep_distance is not returned when both + compared items are equal #510 + - Fixes exclude_paths fails to work in certain cases + - exclude_paths fails to work #509 + - Fixes to_json() method chokes on standard json.dumps() kwargs such + as sort_keys + - to_dict() method chokes on standard json.dumps() kwargs #490 + - Fixes accessing the affected_root_keys property on the diff object + returned by DeepDiff fails when one of the dicts is empty + - In version 8.0.1, accessing the affected_root_keys property on the + diff object returned by DeepDiff fails when one of the dicts is + empty #508 + + DeepDiff 8-0-1 - Bugfix. Numpy should be optional.