Skip to content

Commit eed7669

Browse files
committed
updating the docs
1 parent 000ec0b commit eed7669

File tree

6 files changed

+52
-50
lines changed

6 files changed

+52
-50
lines changed

CHANGELOG.md

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

3+
- v8-2-0
4+
- Small optimizations so we don't load functions that are not needed
5+
- Updated the minimum version of Orderly-set
6+
- Normalize all datetimes into UTC. Assume timezone naive datetimes are UTC.
37

48
- v8-1-0
59
- Removing deprecated lines from setup.py

README.md

+6-50
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,12 @@ Tested on Python 3.8+ and PyPy3.
2323

2424
Please check the [ChangeLog](CHANGELOG.md) file for the detailed information.
2525

26+
DeepDiff 8-2-0
27+
28+
- Small optimizations so we don't load functions that are not needed
29+
- Updated the minimum version of Orderly-set
30+
- Normalize all datetimes into UTC. Assume timezone naive datetimes are UTC.
31+
2632
DeepDiff 8-1-0
2733

2834
- Removing deprecated lines from setup.py
@@ -40,56 +46,6 @@ DeepDiff 8-1-0
4046
- Fixes accessing the affected_root_keys property on the diff object returned by DeepDiff fails when one of the dicts is empty
4147
- Fixes accessing the affected_root_keys property on the diff object returned by DeepDiff fails when one of the dicts is empty #508
4248

43-
DeepDiff 8-0-1
44-
45-
- Bugfix. Numpy should be optional.
46-
47-
DeepDiff 8-0-0
48-
49-
With the introduction of `threshold_to_diff_deeper`, the values returned are different than in previous versions of DeepDiff. You can still get the older values by setting `threshold_to_diff_deeper=0`. However to signify that enough has changed in this release that the users need to update the parameters passed to DeepDiff, we will be doing a major version update.
50-
51-
- `use_enum_value=True` makes it so when diffing enum, we use the enum's value. It makes it so comparing an enum to a string or any other value is not reported as a type change.
52-
- `threshold_to_diff_deeper=float` is a number between 0 and 1. When comparing dictionaries that have a small intersection of keys, we will report the dictionary as a `new_value` instead of reporting individual keys changed. If you set it to zero, you get the same results as DeepDiff 7.0.1 and earlier, which means this feature is disabled. The new default is 0.33 which means if less that one third of keys between dictionaries intersect, report it as a new object.
53-
- Deprecated `ordered-set` and switched to `orderly-set`. The `ordered-set` package was not being maintained anymore and starting Python 3.6, there were better options for sets that ordered. I forked one of the new implementations, modified it, and published it as `orderly-set`.
54-
- Added `use_log_scale:bool` and `log_scale_similarity_threshold:float`. They can be used to ignore small changes in numbers by comparing their differences in logarithmic space. This is different than ignoring the difference based on significant digits.
55-
- json serialization of reversed lists.
56-
- Fix for iterable moved items when `iterable_compare_func` is used.
57-
- Pandas and Polars support.
58-
59-
DeepDiff 7-0-1
60-
61-
- Fixes the translation between Difflib opcodes and Delta flat rows.
62-
63-
DeepDiff 7-0-0
64-
65-
- 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).
66-
- Subtracting delta objects have dramatically improved at the cost of holding more metadata about the original objects.
67-
- When `verbose=2`, and the "path" of an item has changed in a report between t1 and t2, we include it as `new_path`.
68-
- `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)
69-
- Python 3.7 support is dropped and Python 3.12 is officially supported.
70-
71-
72-
DeepDiff 6-7-1
73-
74-
- Support for subtracting delta objects when iterable_compare_func is used.
75-
- Better handling of force adding a delta to an object.
76-
- Fix for [`Can't compare dicts with both single and double quotes in keys`](https://github.com/seperman/deepdiff/issues/430)
77-
- Updated docs for Inconsistent Behavior with math_epsilon and ignore_order = True
78-
79-
DeepDiff 6-7-0
80-
81-
- Delta can be subtracted from other objects now.
82-
- verify_symmetry is deprecated. Use bidirectional instead.
83-
- always_include_values flag in Delta can be enabled to include values in the delta for every change.
84-
- Fix for Delta.__add__ breaks with esoteric dict keys.
85-
- You can load a delta from the list of flat dictionaries.
86-
87-
DeepDiff 6-6-1
88-
89-
- Fix for [DeepDiff raises decimal exception when using significant digits](https://github.com/seperman/deepdiff/issues/426)
90-
- Introducing group_by_sort_key
91-
- Adding group_by 2D. For example `group_by=['last_name', 'zip_code']`
92-
9349

9450
## Installation
9551

docs/basics.rst

+13
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,19 @@ Object attribute added:
148148
'values_changed': {'root.b': {'new_value': 2, 'old_value': 1}}}
149149

150150

151+
Datetime
152+
DeepDiff converts all datetimes into UTC. If a datetime is timezone naive, we assume it is in UTC too.
153+
That is different than what Python does. Python assumes your timezone naive datetime is in your local timezone.
154+
>>> from deepdiff import DeepDiff
155+
>>> from datetime import datetime, timezone
156+
>>> d1 = datetime(2020, 8, 31, 13, 14, 1)
157+
>>> d2 = datetime(2020, 8, 31, 13, 14, 1, tzinfo=timezone.utc)
158+
>>> d1 == d2
159+
False
160+
>>> DeepDiff(d1, d2)
161+
{}
162+
163+
151164
.. note::
152165
All the examples above use the default :ref:`text_view_label`.
153166
If you want traversing functionality in the results, use the :ref:`tree_view_label`.

docs/changelog.rst

+6
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@ Changelog
66
DeepDiff Changelog
77

88

9+
- v8-2-0
10+
- Small optimizations so we don't load functions that are not needed
11+
- Updated the minimum version of Orderly-set
12+
- Normalize all datetimes into UTC. Assume timezone naive datetimes are UTC.
13+
14+
915
- v8-1-0
1016

1117
- Removing deprecated lines from setup.py

docs/faq.rst

+22
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,28 @@ Or use the tree view so you can use path(output_format='list'):
148148
[4, 'b']
149149

150150

151+
Q: Why my datetimes are reported in UTC?
152+
153+
**Answer**
154+
155+
DeepDiff converts all datetimes into UTC. If a datetime is timezone naive, we assume it is in UTC too.
156+
That is different than what Python does. Python assumes your timezone naive datetime is in your local timezone.
157+
158+
>>> from deepdiff import DeepDiff
159+
>>> from datetime import datetime, timezone
160+
>>> d1 = datetime(2020, 8, 31, 13, 14, 1)
161+
>>> d2 = datetime(2020, 8, 31, 13, 14, 1, tzinfo=timezone.utc)
162+
>>> d1 == d2
163+
False
164+
>>> DeepDiff(d1, d2)
165+
{}
166+
167+
>>> d3 = d2.astimezone(pytz.timezone('America/New_York'))
168+
>>> DeepDiff(d1, d3)
169+
{}
170+
>>> d1 == d3
171+
False
172+
151173
---------
152174

153175
.. admonition:: A message from `Sep <https://github.com/seperman>`__, the creator of DeepDiff

tests/test_diff_datetime.py

+1
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ def test_datetime_within_array_with_timezone_diff(self):
9595
d1 = [datetime(2020, 8, 31, 13, 14, 1)]
9696
d2 = [datetime(2020, 8, 31, 13, 14, 1, tzinfo=timezone.utc)]
9797

98+
assert d1 != d2, "Python doesn't think these are the same datetimes"
9899
assert not DeepDiff(d1, d2)
99100
assert not DeepDiff(d1, d2, ignore_order=True)
100101
assert not DeepDiff(d1, d2, truncate_datetime='second')

0 commit comments

Comments
 (0)