seperman / deepdiff

DeepDiff: Deep Difference and search of any Python object/data. DeepHash: Hash of any object based on its contents. Delta: Use deltas to reconstruct objects by adding deltas together.
http://zepworks.com
Other
2.03k stars 224 forks source link

why exclude_regex_paths dont work with ignore_order #453

Open alisherdev98 opened 8 months ago

alisherdev98 commented 8 months ago
class Image(BaseModel):
    size: SizeFormat
    extension: ImageFormat
    data: bytes

Image object contains the data field, which is a byte string representing the image. When comparing Image lists, an error occurs:

{UnicodeDecodeError}UnicodeDecodeError('utf-8', b'RIFF\x84-\x03\x00WEBPVP8 x-\x03\x00P\xe1\n\x9d\x01\x80\x078\x04>m2\x95H\xa4"\xa4\xa6$\x93\xca\x...x03\x00P\n\x01\x078...'. Please either pass ignore_encoding_errors=True or pass the encoding via encodings=['utf-8', '...'].")

I'm trying to calculate the differences in the following way: DeepDiff([image1], [image2], ignore_order=True, exclude_regex_paths=r'\[\d+\].data') But the error does not disappear...

seperman commented 7 months ago

@alisherdev98 Thanks for reporting the bug. Can you give me reproducible code please?