Skip to content

Commit df5f490

Browse files
authored
Merge pull request #208 from seperman/dev
v5-0-2: Bug Fix NoneType in ignore type groups
2 parents fdb1062 + 2b52f49 commit df5f490

13 files changed

+182
-129
lines changed

AUTHORS

+31-33
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,33 @@
1-
Developer:
1+
Authors:
22

3-
- Seperman
3+
Authors in order of the contributions:
44

5-
And many thanks to the following people for their contributions to DeepDiff!
6-
7-
- Victor Hahn Castell @ Flexoptix for tree view and major contributions.
8-
- nfvs for Travis-CI setup script.
9-
- brbsix for initial Py3 porting.
10-
- WangFenjin for Unicode support.
11-
- timoilya for comparing list of sets when ignoring order.
12-
- Bernhard10 for significant digits comparison.
13-
- b-jazz for PEP257 cleanup, Standardize on full names, fixing line endings.
14-
- finnhughes for fixing __slots__
15-
- moloney for Unicode vs. Bytes default
16-
- serv-inc for adding help(deepdiff)
17-
- movermeyer for updating docs
18-
- maxrothman for search in inherited class attributes
19-
- maxrothman for search for types/objects
20-
- MartyHub for exclude regex paths
21-
- sreecodeslayer for DeepSearch match_string
22-
- Brian Maissy (brianmaissy) for weakref fix, enum tests
23-
- Bartosz Borowik (boba-2) for Exclude types fix when ignoring order
24-
- Brian Maissy (brianmaissy) for fixing classes which inherit from classes with slots didn't have all of their slots compared
25-
- Juan Soler (Soleronline) for adding ignore_type_number
26-
- mthaddon for adding timedelta diffing support
27-
- Necrophagos for Hashing of the number 1 vs. True
28-
- Hugo (hugovk) for fixes for Python 3.10 and dropping support for EOL Python 3.4
29-
- Andrey Gavrilin (gaal-dev) for hashing classes.
30-
- Ivan Piskunov (van-ess0) for deprecation warning enhancement.
31-
- Nathaniel Brown (nathanielobrown) Adds support for datetime.time
32-
- Michał Karaś (MKaras93) for the pretty view
33-
- Christian Kothe (chkothe) for the basic support for diffing numpy arrays
34-
- Timothy (timson) for truncate_datetime
35-
- d0b3rm4n for bugfix to not apply format to non numbers.
5+
- [Sep Dehpour (Seperman)](http://www.zepworks.com)
6+
- [Victor Hahn Castell](http://hahncastell.de) for the tree view and major contributions:
7+
- [nfvs](https://github.com/nfvs) for Travis-CI setup script.
8+
- [brbsix](https://github.com/brbsix) for initial Py3 porting.
9+
- [WangFenjin](https://github.com/WangFenjin) for unicode support.
10+
- [timoilya](https://github.com/timoilya) for comparing list of sets when ignoring order.
11+
- [Bernhard10](https://github.com/Bernhard10) for significant digits comparison.
12+
- [b-jazz](https://github.com/b-jazz) for PEP257 cleanup, Standardize on full names, fixing line endings.
13+
- [finnhughes](https://github.com/finnhughes) for fixing __slots__
14+
- [moloney](https://github.com/moloney) for Unicode vs. Bytes default
15+
- [serv-inc](https://github.com/serv-inc) for adding help(deepdiff)
16+
- [movermeyer](https://github.com/movermeyer) for updating docs
17+
- [maxrothman](https://github.com/maxrothman) for search in inherited class attributes
18+
- [maxrothman](https://github.com/maxrothman) for search for types/objects
19+
- [MartyHub](https://github.com/MartyHub) for exclude regex paths
20+
- [sreecodeslayer](https://github.com/sreecodeslayer) for DeepSearch match_string
21+
- Brian Maissy [brianmaissy](https://github.com/) for weakref fix, enum tests
22+
- Bartosz Borowik [boba-2](https://github.com/boba-2) for Exclude types fix when ignoring order
23+
- Brian Maissy [brianmaissy](https://github.com/brianmaissy) for fixing classes which inherit from classes with slots didn't have all of their slots compared
24+
- Juan Soler [Soleronline](https://github.com/Soleronline) for adding ignore_type_number
25+
- [mthaddon](https://github.com/mthaddon) for adding timedelta diffing support
26+
- [Necrophagos](https://github.com/Necrophagos) for Hashing of the number 1 vs. True
27+
- [gaal-dev](https://github.com/gaal-dev) for adding exclude_obj_callback
28+
- Ivan Piskunov [van-ess0](https://github.com/van-ess0) for deprecation warning enhancement.
29+
- Michał Karaś [MKaras93](https://github.com/MKaras93) for the pretty view
30+
- Christian Kothe [chkothe](https://github.com/chkothe) for the basic support for diffing numpy arrays
31+
- [Timothy](https://github.com/timson) for truncate_datetime
32+
- [d0b3rm4n](https://github.com/d0b3rm4n) for bugfix to not apply format to non numbers.
33+
- [MyrikLD](https://github.com/MyrikLD) for Bug Fix NoneType in ignore type groups

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
DeepDiff Change log
22

3+
- v5-0-2: Bug Fix NoneType in ignore type groups https://github.com/seperman/deepdiff/issues/207
34
- v5-0-1: Bug fix to not apply format to non numbers.
45
- v5-0-0: Introducing the Delta object, Improving Numpy support, Fixing tuples comparison when ignore_order=True, Dramatically improving the results when ignore_order=True by running in passes, Introducing pretty print view, deep_distance, purge, progress logging, cache and truncate_datetime.
56
- v4-3-3: Adds support for datetime.time

README.md

+44-48
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# DeepDiff v 5.0.1
1+
# DeepDiff v 5.0.2
22

33
![Downloads](https://img.shields.io/pypi/dm/deepdiff.svg?style=flat)
44
![Python Versions](https://img.shields.io/pypi/pyversions/deepdiff.svg?style=flat)
@@ -17,7 +17,7 @@ Tested on Python 3.5+ and PyPy3.
1717
**NOTE: Python 2 is not supported any more. DeepDiff v3.3.0 was the last version to support Python 2**
1818

1919

20-
- [Documentation](https://zepworks.com/deepdiff/5.0.1/)
20+
- [Documentation](https://zepworks.com/deepdiff/5.0.2/)
2121

2222

2323
## Installation
@@ -46,13 +46,13 @@ If you are running into trouble installing Murmur3, please take a look at the [T
4646

4747
DeepDiff gets the difference of 2 objects.
4848

49-
> - Please take a look at the [DeepDiff docs](https://zepworks.com/deepdiff/5.0.1/diff.html)
50-
> - The full documentation can be found on <https://zepworks.com/deepdiff/5.0.1/>
49+
> - Please take a look at the [DeepDiff docs](https://zepworks.com/deepdiff/5.0.2/diff.html)
50+
> - The full documentation can be found on <https://zepworks.com/deepdiff/5.0.2/>
5151
> - Tutorials can be found on <https://zepworks.com/tags/deepdiff/>
5252
5353
## A few Examples
5454

55-
> Note: This is just a brief overview of what DeepDiff can do. Please visit <https://zepworks.com/deepdiff/5.0.1/> for full documentation.
55+
> Note: This is just a brief overview of what DeepDiff can do. Please visit <https://zepworks.com/deepdiff/5.0.2/> for full documentation.
5656
5757
### List difference ignoring order or duplicates
5858

@@ -256,8 +256,8 @@ Example:
256256
```
257257

258258

259-
> - Please take a look at the [DeepDiff docs](https://zepworks.com/deepdiff/5.0.1/diff.html)
260-
> - The full documentation can be found on <https://zepworks.com/deepdiff/5.0.1/>
259+
> - Please take a look at the [DeepDiff docs](https://zepworks.com/deepdiff/5.0.2/diff.html)
260+
> - The full documentation can be found on <https://zepworks.com/deepdiff/5.0.2/>
261261
262262

263263
# Deep Search
@@ -289,17 +289,17 @@ And you can pass all the same kwargs as DeepSearch to grep too:
289289
{'matched_paths': {"root['somewhere']": 'around'}, 'matched_values': {"root['long']": 'somewhere'}}
290290
```
291291

292-
> - Please take a look at the [DeepSearch docs](https://zepworks.com/deepdiff/5.0.1/dsearch.html)
293-
> - The full documentation can be found on <https://zepworks.com/deepdiff/5.0.1/>
292+
> - Please take a look at the [DeepSearch docs](https://zepworks.com/deepdiff/5.0.2/dsearch.html)
293+
> - The full documentation can be found on <https://zepworks.com/deepdiff/5.0.2/>
294294
295295
# Deep Hash
296296
(New in v4-0-0)
297297

298298
DeepHash is designed to give you hash of ANY python object based on its contents even if the object is not considered hashable!
299299
DeepHash is supposed to be deterministic in order to make sure 2 objects that contain the same data, produce the same hash.
300300

301-
> - Please take a look at the [DeepHash docs](https://zepworks.com/deepdiff/5.0.1/deephash.html)
302-
> - The full documentation can be found on <https://zepworks.com/deepdiff/5.0.1/>
301+
> - Please take a look at the [DeepHash docs](https://zepworks.com/deepdiff/5.0.2/deephash.html)
302+
> - The full documentation can be found on <https://zepworks.com/deepdiff/5.0.2/>
303303
304304
Let's say you have a dictionary object.
305305

@@ -347,8 +347,8 @@ Which you can write as:
347347
At first it might seem weird why DeepHash(obj)[obj] but remember that DeepHash(obj) is a dictionary of hashes of all other objects that obj contains too.
348348

349349

350-
> - Please take a look at the [DeepHash docs](https://zepworks.com/deepdiff/5.0.1/deephash.html)
351-
> - The full documentation can be found on <https://zepworks.com/deepdiff/5.0.1/>
350+
> - Please take a look at the [DeepHash docs](https://zepworks.com/deepdiff/5.0.2/deephash.html)
351+
> - The full documentation can be found on <https://zepworks.com/deepdiff/5.0.2/>
352352
353353

354354
# Using DeepDiff in unit tests
@@ -443,38 +443,34 @@ Thank you!
443443

444444
# Authors
445445

446-
Developer:
447-
448-
- Seperman (Sep Dehpour)
449-
- [Github](https://github.com/seperman)
450-
- [Linkedin](http://www.linkedin.com/in/sepehr)
451-
- [ZepWorks](http://www.zepworks.com)
452-
453-
And many thanks to the following people for their contributions to DeepDiff!
454-
455-
- Victor Hahn Castell for the tree view and major contributions:
456-
- [hahncastell.de](http://hahncastell.de)
457-
- [flexoptix.net](http://www.flexoptix.net)
458-
- nfvs for Travis-CI setup script.
459-
- brbsix for initial Py3 porting.
460-
- WangFenjin for unicode support.
461-
- timoilya for comparing list of sets when ignoring order.
462-
- Bernhard10 for significant digits comparison.
463-
- b-jazz for PEP257 cleanup, Standardize on full names, fixing line endings.
464-
- finnhughes for fixing __slots__
465-
- moloney for Unicode vs. Bytes default
466-
- serv-inc for adding help(deepdiff)
467-
- movermeyer for updating docs
468-
- maxrothman for search in inherited class attributes
469-
- maxrothman for search for types/objects
470-
- MartyHub for exclude regex paths
471-
- sreecodeslayer for DeepSearch match_string
472-
- Brian Maissy (brianmaissy) for weakref fix, enum tests
473-
- Bartosz Borowik (boba-2) for Exclude types fix when ignoring order
474-
- Brian Maissy (brianmaissy) for fixing classes which inherit from classes with slots didn't have all of their slots compared
475-
- Juan Soler (Soleronline) for adding ignore_type_number
476-
- mthaddon for adding timedelta diffing support
477-
- Necrophagos for Hashing of the number 1 vs. True
478-
- gaal-dev for adding exclude_obj_callback
479-
- Ivan Piskunov (van-ess0) for deprecation warning enhancement.
480-
- Michał Karaś (MKaras93) for the pretty view
446+
Authors listed in the order of the contributions:
447+
448+
- [Sep Dehpour (Seperman)](http://www.zepworks.com)
449+
- [Victor Hahn Castell](http://hahncastell.de) for the tree view and major contributions:
450+
- [nfvs](https://github.com/nfvs) for Travis-CI setup script.
451+
- [brbsix](https://github.com/brbsix) for initial Py3 porting.
452+
- [WangFenjin](https://github.com/WangFenjin) for unicode support.
453+
- [timoilya](https://github.com/timoilya) for comparing list of sets when ignoring order.
454+
- [Bernhard10](https://github.com/Bernhard10) for significant digits comparison.
455+
- [b-jazz](https://github.com/b-jazz) for PEP257 cleanup, Standardize on full names, fixing line endings.
456+
- [finnhughes](https://github.com/finnhughes) for fixing __slots__
457+
- [moloney](https://github.com/moloney) for Unicode vs. Bytes default
458+
- [serv-inc](https://github.com/serv-inc) for adding help(deepdiff)
459+
- [movermeyer](https://github.com/movermeyer) for updating docs
460+
- [maxrothman](https://github.com/maxrothman) for search in inherited class attributes
461+
- [maxrothman](https://github.com/maxrothman) for search for types/objects
462+
- [MartyHub](https://github.com/MartyHub) for exclude regex paths
463+
- [sreecodeslayer](https://github.com/sreecodeslayer) for DeepSearch match_string
464+
- Brian Maissy [brianmaissy](https://github.com/) for weakref fix, enum tests
465+
- Bartosz Borowik [boba-2](https://github.com/boba-2) for Exclude types fix when ignoring order
466+
- Brian Maissy [brianmaissy](https://github.com/brianmaissy) for fixing classes which inherit from classes with slots didn't have all of their slots compared
467+
- Juan Soler [Soleronline](https://github.com/Soleronline) for adding ignore_type_number
468+
- [mthaddon](https://github.com/mthaddon) for adding timedelta diffing support
469+
- [Necrophagos](https://github.com/Necrophagos) for Hashing of the number 1 vs. True
470+
- [gaal-dev](https://github.com/gaal-dev) for adding exclude_obj_callback
471+
- Ivan Piskunov [van-ess0](https://github.com/van-ess0) for deprecation warning enhancement.
472+
- Michał Karaś [MKaras93](https://github.com/MKaras93) for the pretty view
473+
- Christian Kothe [chkothe](https://github.com/chkothe) for the basic support for diffing numpy arrays
474+
- [Timothy](https://github.com/timson) for truncate_datetime
475+
- [d0b3rm4n](https://github.com/d0b3rm4n) for bugfix to not apply format to non numbers.
476+
- [MyrikLD](https://github.com/MyrikLD) for Bug Fix NoneType in ignore type groups

deepdiff/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"""This module offers the DeepDiff, DeepSearch, grep, Delta and DeepHash classes."""
22
# flake8: noqa
3-
__version__ = '5.0.1'
3+
__version__ = '5.0.2'
44
import logging
55

66
if __name__ == '__main__':

deepdiff/diff.py

+3
Original file line numberDiff line numberDiff line change
@@ -1139,6 +1139,9 @@ def __diff(self, level, parents_ids=frozenset(), _original_type=None):
11391139
if report_type_change:
11401140
self.__diff_types(level)
11411141
return
1142+
# This is an edge case where t1=None and None is in the ignore type group.
1143+
if level.t1 is None:
1144+
self.__report_result('values_changed', level)
11421145

11431146
if self.ignore_nan_inequality and isinstance(level.t1, float) and str(level.t1) == str(level.t2) == 'nan':
11441147
return

deepdiff/helper.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,9 @@ def type_in_type_group(item, type_group):
309309

310310

311311
def type_is_subclass_of_type_group(item, type_group):
312-
return isinstance(item, type_group) or issubclass(item, type_group) or type_in_type_group(item, type_group)
312+
return isinstance(item, type_group) \
313+
or (isinstance(item, type) and issubclass(item, type_group)) \
314+
or type_in_type_group(item, type_group)
313315

314316

315317
def get_doc(doc_filename):

docs/authors.rst

+61-40
Original file line numberDiff line numberDiff line change
@@ -3,47 +3,68 @@
33
Authors
44
=======
55

6-
DeepDiff Core Developer:
6+
Authors listed in the order of the contributions:
77

8-
- Sep Dehpour
8+
- `Sep Dehpour (Seperman)`_
9+
- `Victor Hahn Castell`_ for the tree view and major contributions:
10+
- `nfvs`_ for Travis-CI setup script.
11+
- `brbsix`_ for initial Py3 porting.
12+
- `WangFenjin`_ for unicode support.
13+
- `timoilya`_ for comparing list of sets when ignoring order.
14+
- `Bernhard10`_ for significant digits comparison.
15+
- `b-jazz`_ for PEP257 cleanup, Standardize on full names, fixing line
16+
endings.
17+
- `finnhughes`_ for fixing **slots**
18+
- `moloney`_ for Unicode vs. Bytes default
19+
- `serv-inc`_ for adding help(deepdiff)
20+
- `movermeyer`_ for updating docs
21+
- `maxrothman`_ for search in inherited class attributes
22+
- `maxrothman`_ for search for types/objects
23+
- `MartyHub`_ for exclude regex paths
24+
- `sreecodeslayer`_ for DeepSearch match_string
25+
- Brian Maissy `brianmaissy`_ for weakref fix, enum tests
26+
- Bartosz Borowik `boba-2`_ for Exclude types fix when ignoring order
27+
- Brian Maissy `brianmaissy <https://github.com/brianmaissy>`__ for
28+
fixing classes which inherit from classes with slots didn’t have all
29+
of their slots compared
30+
- Juan Soler `Soleronline`_ for adding ignore_type_number
31+
- `mthaddon`_ for adding timedelta diffing support
32+
- `Necrophagos`_ for Hashing of the number 1 vs. True
33+
- `gaal-dev`_ for adding exclude_obj_callback
34+
- Ivan Piskunov `van-ess0`_ for deprecation warning enhancement.
35+
- Michał Karaś `MKaras93`_ for the pretty view
36+
- Christian Kothe `chkothe`_ for the basic support for diffing numpy
37+
arrays
38+
- `Timothy`_ for truncate_datetime
39+
- `d0b3rm4n`_ for bugfix to not apply format to non numbers.
40+
- `MyrikLD`_ for Bug Fix NoneType in ignore type groups
941

10-
- `Github <https://github.com/seperman>`_
11-
- `ZepWorks <http://www.zepworks.com>`_
12-
- `Articles about Deepdiff <https://zepworks.com/tags/deepdiff/>`_
13-
14-
And many thanks to the following people for their contributions to DeepDiff!
15-
16-
- Victor Hahn Castell for major contributions
17-
- `hahncastell.de <http://hahncastell.de>`_
18-
- `flexoptix.net <http://www.flexoptix.net>`_
19-
- nfvs for Travis-CI setup script.
20-
- brbsix for initial Py3 porting.
21-
- WangFenjin for Unicode support.
22-
- timoilya for comparing list of sets when ignoring order.
23-
- Bernhard10 for significant digits comparison.
24-
- b-jazz for PEP257 cleanup, Standardize on full names, fixing line endings.
25-
- finnhughes for fixing __slots__
26-
- moloney for Unicode vs. Bytes default
27-
- serv-inc for adding help(deepdiff)
28-
- movermeyer for updating docs
29-
- maxrothman for search in inherited class attributes
30-
- maxrothman for search for types/objects
31-
- MartyHub for exclude regex paths
32-
- sreecodeslayer for DeepSearch match_string
33-
- Brian Maissy (brianmaissy) for weakref fix, enum tests
34-
- Bartosz Borowik (boba-2) for Exclude types fix when ignoring order
35-
- Brian Maissy (brianmaissy) for fixing classes which inherit from classes with slots didn't have all of their slots compared
36-
- Juan Soler (Soleronline) for adding ignore_type_number
37-
- mthaddon for adding timedelta diffing support
38-
- Necrophagos for Hashing of the number 1 vs. True
39-
- Hugo (hugovk) for fixes for Python 3.10 and dropping support for EOL Python 3.4
40-
- Andrey Gavrilin (gaal-dev) for hashing classes.
41-
- gaal-dev for adding exclude_obj_callback
42-
- Ivan Piskunov (van-ess0) for deprecation warning enhancement.
43-
- Nathaniel Brown (nathanielobrown) Adds support for datetime.time
44-
- Michał Karaś (MKaras93) for the pretty view
45-
- Christian Kothe (chkothe) for the basic support for diffing numpy arrays
46-
- Timothy (timson) for truncate_datetime
47-
- d0b3rm4n for bugfix to not apply format to non numbers.
42+
.. _Sep Dehpour (Seperman): http://www.zepworks.com
43+
.. _Victor Hahn Castell: http://hahncastell.de
44+
.. _nfvs: https://github.com/nfvs
45+
.. _brbsix: https://github.com/brbsix
46+
.. _WangFenjin: https://github.com/WangFenjin
47+
.. _timoilya: https://github.com/timoilya
48+
.. _Bernhard10: https://github.com/Bernhard10
49+
.. _b-jazz: https://github.com/b-jazz
50+
.. _finnhughes: https://github.com/finnhughes
51+
.. _moloney: https://github.com/moloney
52+
.. _serv-inc: https://github.com/serv-inc
53+
.. _movermeyer: https://github.com/movermeyer
54+
.. _maxrothman: https://github.com/maxrothman
55+
.. _MartyHub: https://github.com/MartyHub
56+
.. _sreecodeslayer: https://github.com/sreecodeslayer
57+
.. _brianmaissy: https://github.com/
58+
.. _boba-2: https://github.com/boba-2
59+
.. _Soleronline: https://github.com/Soleronline
60+
.. _mthaddon: https://github.com/mthaddon
61+
.. _Necrophagos: https://github.com/Necrophagos
62+
.. _gaal-dev: https://github.com/gaal-dev
63+
.. _van-ess0: https://github.com/van-ess0
64+
.. _MKaras93: https://github.com/MKaras93
65+
.. _chkothe: https://github.com/chkothe
66+
.. _Timothy: https://github.com/timson
67+
.. _d0b3rm4n: https://github.com/d0b3rm4n
68+
.. _MyrikLD: https://github.com/MyrikLD
4869

4970
Back to :doc:`/index`

docs/changelog.rst

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ Changelog
55

66
DeepDiff Changelog
77

8+
- v5-0-2: Bug Fix NoneType in ignore type groups https://github.com/seperman/deepdiff/issues/207
89
- v5-0-1: Bug fix to not apply format to non numbers.
910
- v5-0-0: Introducing the Delta object, Improving Numpy support, Fixing tuples comparison when ignore_order=True, Dramatically improving the results when ignore_order=True by running in passes, Introducing pretty print view, deep_distance, purge, progress logging, cache and truncate_datetime.
1011
- v4-3-3: Adds support for datetime.time

docs/conf.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,9 @@
6060
# built documents.
6161
#
6262
# The short X.Y version.
63-
version = '5.0.1'
63+
version = '5.0.2'
6464
# The full version, including alpha/beta/rc tags.
65-
release = '5.0.1'
65+
release = '5.0.2'
6666

6767
load_dotenv(override=True)
6868
DOC_VERSION = os.environ.get('DOC_VERSION', version)

docs/index.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
contain the root `toctree` directive.
55
66
7-
DeepDiff 5.0.1 documentation!
7+
DeepDiff 5.0.2 documentation!
88
=============================
99

1010
*****************

setup.cfg

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[bumpversion]
2-
current_version = 5.0.1
2+
current_version = 5.0.2
33
commit = True
44
tag = True
55
tag_name = {new_version}

0 commit comments

Comments
 (0)