neo4j / neo4j-python-driver

Neo4j Bolt driver for Python
https://neo4j.com/docs/api/python-driver/current/
Other
898 stars 186 forks source link

TypeError when serializing DateTime object with pickle #1001

Closed Tanguy-Boisset closed 10 months ago

Tanguy-Boisset commented 10 months ago

My Environment

Python Version: Python 3.10.12 Driver Version: 5.15.dev0 Operating System: Pop!_OS 22.04 LTS

Steps to reproduce

import pickle

expected = DateTime(2023, 12, 7, 12, 34, 56, 7890)
dump = pickle.dumps(expected)
actual = pickle.loads(dump)
print(expected == actual)

Expected behavior

True

Actual behavior

Traceback (most recent call last):
  File "neo4j_driver/test2.py", line 4, in <module>
    dump = pickle.dumps(expected)

TypeError: DateTime.__new__() missing 3 required positional arguments: 'year', 'month', and 'day'