Greetings! I did not create an issue for this before hand but let me know if you want one.
What does this changes
By using the is operator to check for empty values the package can support custom fields that have values that override the comparison operators (__eq__ and __ne__), like numpy arrays.
What was wrong
>>> import numpy as np
>>> from django_fakery.faker_factory import Empty
>>> if np.arange(3) != Empty:
... print("success")
...
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()
How this fixes it
>>> if np.arange(3) is not Empty:
... print("success")
...
success
Greetings! I did not create an issue for this before hand but let me know if you want one.
What does this changes
By using the
is
operator to check for empty values the package can support custom fields that have values that override the comparison operators (__eq__
and__ne__
), like numpy arrays.What was wrong
How this fixes it